B
B
BanterFace2017-11-13 19:50:27
YouTube
BanterFace, 2017-11-13 19:50:27

Is there something wrong with the youtube API?

Some video connection options don't work : fs (0 - hide button to switch to full screen), rel (0 - don't show related videos at the end of playback), modestbranding (1 - hide "YouTube" at the bottom), showinfo (0 - don't show title and buttons at the top before playback starts).
I connect via the iframe API, like this:

//Hymn adding
    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: document.querySelector('.hymn').clientHeight,
        width: document.querySelector('.hymn').clientWidth*0.5,
        modestbranding: 1,
        showinfo: 0,
        iv_load_policy: 3,
        rel: 0,
        autohide: 1,
        fs: 0,
        origin: 'https://ussr.ga',
        videoId: 'cNNMlwzJ6qU'
      });
    };

you can see the result here .
At the same time, on this page they connect via a link in an iframe and everything works (3 out of 4 properties, the work of the fourth is not shown).
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tyzberd, 2017-11-13
@BanterFace

try using playerVars: { 'autoplay': 1, 'controls': 0 },
https://developers.google.com/youtube/iframe_api_r...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question