Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9270927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:29:28+00:00 2026-06-18T15:29:28+00:00

I have an application here where I am using jwplayer in basic jquery slider:

  • 0

I have an application here where I am using jwplayer in basic jquery slider: APPLICATION

Info for basic jquery slider here: http://basic-slider.com/

Now this is what I have found out, if a slider contains multiple videos, then it displays the slider, but if a slider has one video only, it does not display video or slider.

Now what is strange is if I replace the videos for images, then it works if I have a single image as it does not display the slider but displays the image, this is fine. But my question is how to do the same thing for the video?

Here is demo for slider with images: APPLICATION

Below is code for video and slider:

     $vidquery = "SELECT s.SessionId, q.QuestionId, v.VideoId, VideoFile
                FROM Session s
                INNER JOIN Question q ON s.SessionId = q.SessionId
                INNER JOIN Video_Question vq ON q.QuestionId = vq.QuestionId
                INNER JOIN Video v ON vq.VideoId = v.VideoId
                WHERE s.SessionId = ?";

    $vidqrystmt=$mysqli->prepare($vidquery);
    // You only need to call bind_param once
    $vidqrystmt->bind_param("i",$session);
    // get result and assign variables (prefix with db)
    $vidqrystmt->execute(); 
    $vidqrystmt->bind_result($vidSessionId,$vidQuestionId,$vidVideoId,$vidVideoFile);

        $arrVideoFile = array();

    while ($vidqrystmt->fetch()) {
    $arrVideoFile[ $vidQuestionId ][] = basename($vidVideoFile);
  }

    $vidqrystmt->close(); 


?>
<form action='results.php' method='post' id='exam'>


<?php
                //start:procedure video
        $vid_result = '';
        if(empty($arrVideoFile[$key])){
          $vid_result = '&nbsp;';
        }else{

            ?>


 <div id="banner-video_<?php echo $key; ?>">
 <ul class="bjqs">
<?php
$i = 0;
foreach ($arrVideoFile[$key] as $v) { ?>
<li><div id="myElement-<?php echo $key.'-'.$i; ?>">Loading the player...

<script type="text/javascript">


jwplayer("myElement-<?php echo $key.'-'.$i; ?>").setup({
    file: "<?php echo 'VideoFiles/'.$v; ?>",
    width: 480,
    height: 270
});

<?php $i++; ?>
</script>

</div>
</li>
<?php } ?>
</ul>
</div>

         <script type="text/javascript">

jQuery(document).ready(function($) {

         $('#banner-video_<?php echo $key; ?>').bjqs({
            animtype      : 'slide',
            height        : 300,
            width         : 700,
            responsive    : true,
            randomstart   : false,
            automatic : false
          });  
          });

          </script>

<?php

        }
        //end:procedure video
?>

</div>



</form>

UPDATE:

If anyone knows how to code it so that if it is able to detect if single video, then do not place it in slider, then I believe this could solve it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:29:29+00:00Added an answer on June 18, 2026 at 3:29 pm

    What I am saying is that by your example it looks like all your slider does it slide a image or video over and display the next or previous, but if you have only one item why not just skip all that entirely.

    You have an array : $arrVideoFile

    You can use count($arrVideoFile); to get the total values in the array.

    So

    if(count($arrVideoFile) != 0 || $arrVideoFile) != 1)
    {
        //do the stuff you pasted above
    }
    
    else
    {
        //if(array == 0) maybe show a default image
    
        //if(array == 1) lets just show that
            //if image show <img> if video show <object> or in your case 
            //<div id="myElement-<?php echo $key.'-0'; ?>"></div>
    }
    

    Let me know if this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the core problem: I have a .NET application that is using COM interop
Here's my question. Right now I have a Linux server application (written using C++
I have a little application here which deals with QuickTime video using QTKit. This
i have downloaded sample mvc application from here http://ravenmvc.codeplex.com/releases/view/45994 It works just fine. But
I have a application here: application In the demo I am using a basic
This is to create a greeting card application and here i have to change
I have created a sample MVC application from here: CLICK HERE I am using
I have application which can export slides to PowerPoint. I'm using Microsoft.Office.Interop.PowerPoint.dll . This
I have an application using Jquery's UI Tabs for an overall menu, and they're
HI, I have a flash application (working demo here ) which I'm using to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.