Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Very simple multiple video player

  1. #11
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,336
    Thanks
    30
    Thanked 137 Times in 132 Posts
    Blog Entries
    32

    Default

    Quote Originally Posted by bernie1227 View Post
    The point however is that he doesn't want any controls.
    If you mean there's a play bar with controls, and if the person doesn't want that, he can do:

    http://www.youtube.com/v/ROVy9PC8_8A...fxfBlnY&loop=1

    (controls=0 in the url).

    Arie.

  2. #12
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    47
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    It would be more efficient to do it offline, as I'm guessing ukstormer doesn't want to use up bandwidth getting the video.
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  3. #13
    Join Date
    Jun 2012
    Location
    Lancashire
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Hi Guys,

    Firstly, Bernie, yes the code simple plays both videos and then stops which is where I was originally.

    Hi Molendijk, the videos are to be played locally on a screen with no connection to the internet (videos will be updated via the intranet).

    Still looking for a solution.

    Ukstormer

  4. #14
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    47
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    sorry ukstormer, it appears i've been barking up the wrong tree. try this:
    Code:
    <!DOCTYPE html> 
    <html> 
    <head> 
    <title>MultipleVideo</title>
    <script type="text/javascript">
    var myVideo = _V_("my_video_1"); 
    function onComplete(){ 
    
    var = document.getElementsByTagName('video')[0]; // get my <video> tag 
    var videoPlaying = myVideo1.currentSrc;  //file being played
    myVideo1.src ='video/test20.mp4';  // set up the new src (reels) 
        myVideo.load();   // load the new video 
        myVideo.play();   // play the new video   
      
    myVideo.removeEvent("ended", onComplete);   // remove the listener        
    }
    myVideo.addEvent("ended", onComplete);//listenerhandler 
    
    function loop(){ 
    if(var videoplaying == 'video/test20.mp3'){
    var = document.getElementsByTagName('video')[0]; // get my <video> tag 
    var videoPlaying = myVideo1.currentSrc;  //file being played
    myVideo1.src ='video/test10.mp4';  // set up the new src (reels) 
        myVideo.load();   // load the new video 
        myVideo.play();   // play the new video   
      
    myVideo.removeEvent("ended", loop);   // remove the listener
    }        
    }
    myVideo.addEvent("ended", loop);//listenerhandler 
    </script>
    </head> 
    <body> 
    <video id="my_video_1"autoplay 
    preload="auto"width="640"height="480" src
    data-setup="{}"> 
    <source id="mp4Vid" src="video/test10.mp4" type='video/mp4'> 
      </video> 
            <script src="js/videoHandlers.js"></script> 
        </body> 
    </html>
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  5. #15
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,336
    Thanks
    30
    Thanked 137 Times in 132 Posts
    Blog Entries
    32

    Default

    Quote Originally Posted by ukstormer View Post
    Hi Molendijk, the videos are to be played locally on a screen with no connection to the internet (videos will be updated via the intranet).Ukstormer
    Then try Bernie's solution or THIS.
    Arie.

  6. #16
    Join Date
    Jun 2012
    Location
    Lancashire
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Hi Bernie,
    The new code just plays the first video and then stops . . . .

    Arie
    Many thanks but that software is Windows based, I am using Linux and a Chrome window in full screen mode.

  7. #17
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    47
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Ok final try:
    Code:
    <!DOCTYPE html> 
    <html> 
    <head> 
    <title>MultipleVideo</title>
    <script type="text/javascript">
    var myVideo = _V_("my_video_1"); 
    function onComplete(){ 
    
    var = document.getElementsByTagName('video')[0]; // get my <video> tag 
    if(myVideo1.currentSrc == "video/test10.mp4"){
    var nextVideo = 'video/test20.mp4';
    }
    else {
    var nextVideo = 'video/test20.mp4';
    }
    var videoPlaying = myVideo1.currentSrc;  //file being played
    myVideo1.src = nextVideo;  // set up the new src (reels) 
        myVideo.load();   // load the new video 
        myVideo.play();   // play the new video   
    }
    myVideo.addEvent("ended", onComplete);//listenerhandler 
    
    </script>
    </head> 
    <body> 
    <video id="my_video_1"autoplay 
    preload="auto"width="640"height="480" src
    data-setup="{}"> 
    <source id="mp4Vid" src="video/test10.mp4" type='video/mp4'> 
      </video> 
            <script src="js/videoHandlers.js"></script> 
        </body> 
    </html>
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  8. #18
    Join Date
    Jun 2012
    Location
    Lancashire
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    No, afraid not, same thing as before, as it stands will not work, remove the 'src' text after the height deceleration and then first video plays and stops at the end.

  9. #19
    Join Date
    Jun 2012
    Location
    Lancashire
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Still looking for a script to play several MP4 files back to back, saw something regards using 'video.onended' but not too sure how to implement it correctly, any help much appreciated.

  10. #20
    Join Date
    Jan 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yo, sup ukstormer, my blog is a bit buggy and I am not replying there, fortunately I found your post here when you mentioned my name. crazy hun?

    So, to keep it playing is simple, create an array with all the videos you want then call it sequentially.

    Code:
    var arrVideos = ["vid01.mp4","vid02.mp4","vid03.mp4"];
    var myIndex = 0;
    var myVideo = _V_("my_video_1");
    function onComplete(){
    
        var myVideo1 = document.getElementsByTagName('video')[0]; // get my <video> tag
        var videoPlaying = myVideo1.currentSrc;  // get the file being played 
        myVideo1.src = arrVideos[myIndex];  // set up the new src (reels)
    if(myIndex == arrVideos.length-1){
    myIndex = 0;
    }
    myIndex++;
        myVideo.load();   // load the new video
        myVideo.play();   // play the new video  
     
    myVideo.addEvent("ended", onComplete);  // listener handler  
    };
    I didn't test it, but it should play. Let me know ninja, my email is marcelo.duende@gmail.com. Peace

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •