Advanced Search

Results 1 to 7 of 7

Thread: Youtube autoplay and loop

  1. #1
    Join Date
    Jan 2009
    Location
    NH
    Posts
    302
    Thanks
    38
    Thanked 8 Times in 8 Posts

    Question Youtube autoplay and loop

    On this page http://www.pscompetitiveedge.com/references.html I have an embedded Youtube video (Greetings Intro) in the middle of the page. I have &autoplay=1&loop=1?rel=0 in the embed code. I got this from the Youtube help page, but it doens't seem to be working.

    The video does start. It does not loop and thus causing related videos to show at the end.
    &loop=1? should cause the loop
    rel=0 should show no related videos

    Why didn't this work?

  2. #2
    Join Date
    May 2013
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    the video is completely working fine for me on the link given by you

  3. #3
    Join Date
    Jan 2009
    Location
    NH
    Posts
    302
    Thanks
    38
    Thanked 8 Times in 8 Posts

    Default

    The video does load and play. The video does not loop, thus causing rel videos to show at the end.

    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	vez0v9.jpg 
Views:	79 
Size:	85.3 KB 
ID:	5133  

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    1,880
    Thanks
    16
    Thanked 288 Times in 287 Posts
    Blog Entries
    4

    Default

    Maybe this can shed some light - from Google developer documentation;
    Note: This parameter (loop) has limited support in the AS3 player and in IFrame embeds, which could load either the AS3 or HTML5 player. Currently, the loop parameter only works in the AS3 player when used in conjunction with the playlist parameter. To loop a single video, set the loop parameter value to 1 and set the playlist parameter value to the same video ID already specified in the Player API URL:
    so it seems you also need to set the playlist parameter too. Ref: https://developers.google.com/youtub...arameters#loop
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

  5. #5
    Join Date
    Jan 2009
    Location
    NH
    Posts
    302
    Thanks
    38
    Thanked 8 Times in 8 Posts

    Default

    I am using this code
    Code:
    <iframe width="420" height="315" src="http://www.youtube.com/embed/JkQS1MIplKI?&autoplay=1&loop=1?&playlist=JkQS1MIplKI?rel=0" frameborder="0" allowfullscreen></iframe>
    would it help if I changed it to the "old" style code and add the &autoplay=1&loop=1?rel=0?
    Code:
    <object width="420" height="315"><param name="movie" value="//www.youtube.com/v/JkQS1MIplKI?version=3&amp;hl=en_US&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="//www.youtube.com/v/JkQS1MIplKI?version=3&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" width="420" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>

  6. #6
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,297
    Thanks
    28
    Thanked 135 Times in 130 Posts
    Blog Entries
    28

    Default

    Code:
    <script type="text/javascript" src="http://www.youtube.com/player_api"></script>
    
    <script type="text/javascript">
    // Works in Firefox, Chrome, IE 8 and up, Opera. Page must be live in order for the script to work with IE. Thanks to jscheuer1 for the assistance
    var controllable_player,start, 
    statechange = function(e){
    	if(e.data === 0){controllable_player.seekTo(0); controllable_player.playVideo()}
    
    };
    function onYouTubeIframeAPIReady() {
    controllable_player = new YT.Player('controllable_player', {events: {'onStateChange': statechange}}); 
    }
    
    if(window.opera){
    addEventListener('load', onYouTubeIframeAPIReady, false);
    }
    setTimeout(function(){
        if (typeof(controllable_player) == 'undefined'){
            onYouTubeIframeAPIReady();
        }
    }, 3000)
    </script>
    
    <iframe id="controllable_player" src="http://www.youtube.com/embed/JkQS1MIplKI?autoplay=1"></iframe>
    rel=0 doesn't make sense in a loop.

  7. The Following User Says Thank You to molendijk For This Useful Post:

    mlegg (07-05-2013)

  8. #7
    Join Date
    Jan 2009
    Location
    NH
    Posts
    302
    Thanks
    38
    Thanked 8 Times in 8 Posts

    Default

    Thank you very much.

Similar Threads

  1. Loading YouTube videos using the most recent YouTube embed code
    By molendijk in forum Submit a DHTML or CSS code
    Replies: 11
    Last Post: 05-28-2012, 11:04 PM
  2. Youtube Autoplay and Autoclose?
    By ceerup in forum Looking for such a script or service
    Replies: 1
    Last Post: 05-22-2012, 01:13 PM
  3. Replies: 3
    Last Post: 04-26-2009, 03:10 AM
  4. autoplay wmp on pop up (avi file)
    By ham in forum HTML
    Replies: 0
    Last Post: 01-25-2007, 04:29 AM
  5. autostart or autoplay?
    By darco9x2 in forum HTML
    Replies: 2
    Last Post: 07-25-2005, 01:54 AM

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
  •