Youtubevideo with Autoplay does not work :-(

Missing ‘?’

Yup

ie it should be:
<iframe width="640" height="360" src="https://www.youtube.com/embed/jAH7nw5UrAw?autoplay=1" frameborder="0" allowfullscreen></iframe>

On android player there is more to it (Autoplay Embedded Youtube Videos) but on windows clients it should work with ?autoplay=1

Hi Peter, thanks you for your answer. I will try it at afternoon today. I will copy your link in xibo in the embedded part…(HTML zum Einbetten) right?
and the other parts “Custom Style Sheets” and "HEAD " i do nothing…ok?

And its an windows client.

That’s correct yes, it should autoplay in layout designer as well.

Peter ok. thnaks. And it´s so that when the youtube video is comming in xibo it would play automatically and the play button is not there…ist this also right?

That’s also correct, it play automatically once layout is loaded.

Hello Peter,
thanks for your answers…it´s going on so. But the full size of the Screen is not. Only the video in youtube.
is this right?

The width and height you specify in the iframe along with region size to which you add this embedded item will have impact on how big it is.

Hi,
I have problem with autoplay embedded video in android. It is not supporting to android device.but we can manually play video.
I tried this link

Please help me.

Thanks,
Mahesh

I assume you’ve tried the script posted in topic few months ago?

If that does not work for you, then I’m afraid we do not have a good alternative, we’re aware that the workaround does not work on all devices, as stated in the topic with it.

Hi Peter,
That script is working fine. but i want to pass videoId value.In script having only one video.

before i used this

frame.Attributes[“src”] = Application[“link”].ToString();
frame.Visible = true;

iframe id=“frame” name=“myIframe” runat=“server” style=“width:100%; height:700px; margin-top:-50px”>

how can i pass the frame src value to script?

function onYouTubeIframeAPIReady() {
player = new YT.Player(‘player’, {
height: ‘720’,
width: ‘1280’,
----------> videoId: ‘onldzSzdqlM’,
events: {
‘onReady’: onPlayerReady
}
});
}

Thanks,
Mahesh.

Hello, The auto play works fine with my, but i am trying to use 2 videos from youtube in the same screen, but they don’t play at the same time. one plays then stops and the other start playing and stop then the other plays and …

Is that on Android device?
It could be that your device does not support 2 (or more) concurrently playing videos, you could check that with file based videos in two regions.

1 Like

yes, its android i well see that, thanks

How do you implement a youtube video to play at specific time, i tried on the code and works but no when we tryout on xibo…

You can add ‘start’ to the playerVars in the script.

To recap, the example script with various playVars set and start at 15s of the video

html to embed

<!-- BROWSER=edge -->
<div id="player"></div>

script

<script>
      var tag = document.createElement('script');
      tag.src = "https://www.youtube.com/iframe_api";
      var firstScriptTag = document.getElementsByTagName('script')[0];
      firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
      var player;
      function onYouTubeIframeAPIReady() {
       player = new YT.Player('player', {
       height: '1080',
       width: '1920',
       videoId: 'a329D581TAw',
       playerVars: { 
         'playlist': 'a329D581TAw',
         'start': 15,
         'loop': 1,
         'controls' : 0, 
         'rel' : 0,
         'fs' : 0,
         'showinfo' : 0,
         'cc_load_policy' : 0,
         'iv_load_policy' : 3,
         'modestbranding' : 1
        },
          events: {
            'onReady': onPlayerReady
          }
        });
      }
      function onPlayerReady(event) {
        event.target.playVideo();
      }
</script>

Hello,
i have a fresh CMS 2.3.3 installation.
The xibo-player is on a fresh Win10 system

This is my Code:

<script>
      var tag = document.createElement('script');
      tag.src = "https://www.youtube.com/iframe_api";
      var firstScriptTag = document.getElementsByTagName('script')[0];
      firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
      var player;
      function onYouTubeIframeAPIReady() {
       player = new YT.Player('player', {
       height: '951',
       width: '1622',
       videoId: 'FWNtu3w1yWM',
       playerVars: { 
         'playlist': 'FWNtu3w1yWM',
         'start': 1,
         'loop': 0,
         'controls' : 0, 
         'rel' : 0,
         'fs' : 0,
         'showinfo' : 0,
         'cc_load_policy' : 0,
         'iv_load_policy' : 3,
         'modestbranding' : 1
        },
          events: {
            'onReady': onPlayerReady
          }
        });
      }
      function onPlayerReady(event) {
        event.target.playVideo();
      }
</script>

But the youtube video did not start

You need to add to the HTML section of the widget

<!-- BROWSER=edge -->
<div id="player"></div>

Thank you for the tip Alex.

Now it works :slight_smile:

Can you edit the FAQ section here.
https://xibo.org.uk/docs/setup/autoplay-embedded-youtube-videos

This is what i have found with google.

That guide is for Android devices which don’t need that hint, but yes I will update it.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.