Adding additional parameters to the yt.player object from youtube

前端 未结 1 1560
夕颜
夕颜 2021-02-15 18:19

I\'m initiating a youtube video using yt.player like this:

function onYouTubeIframeAPIReady() {
    player = new YT.Player(\'player\', {
        height: \'720\',         


        
相关标签:
1条回答
  • 2021-02-15 19:07
    function onYouTubeIframeAPIReady() {
        player = new YT.Player('player', {
            height: '720',
            width: '1280',
    
            videoId: 'i8IXMGHpGBk',
            playerVars: { 'autoplay': 1, 'controls': 1,'autohide':1,'wmode':'opaque' },
            events: {
                'onStateChange': function(e) {
                    if (e.data == 0) {
                        //skrolla här
                    }
                }
            }
        })
    

    try this code and reply me on this...

    0 讨论(0)
提交回复
热议问题