Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
269 views
in Technique[技术] by (71.8m points)

php - Having videos display in slideshow type fashion

As part of a website project I am currently working on I am trying to have videos display in a slideshow type fashion. There is a main video that is currently playing and underneath it are the other videos which are lined up to play. The one at the front of the list will start playing once the main one finishes. I've attached an image to show what I'm meaning.

enter image description here

I've got the main video to play by doing:

    <video id=v controls loop align="right"> 
     <?php
            try {
               $stmt = $dbconn->query('SELECT videoid, video, videotitle, editedby 
                                       FROM videos 
                                       ORDER BY RAND() 
                                       LIMIT 1');
               while($row = $stmt->fetch()){
                    $video = $row['video'];
               }
           }catch(PDOException $e) {
               echo $e->getMessage();
           }
      ?>
    
        <source src="users/videos/<?php echo $video;?>" type="video/mp4">
    </video> 

As you'll be able to see video is selected at random. So my question is how do I go about to show the rest of the videos in the databases below it in like a slideshow type way? I would like whenever the main video finishes, the next video will start playing automatically and the video that was playing will then join at the end of the slideshow. The user should also be able to look through the slideshows and select a video of their choice which should then start playing and the video that is currently playing will then join the end of the slideshow.

Is there a 3rd party library that I can use or are there other examples out there that can help me with this? I have tried researching this but have not had any luck finding anything that could help me. Thanks in advance

question from:https://stackoverflow.com/questions/65644867/having-videos-display-in-slideshow-type-fashion

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...