How do I set the endpoint of video playback in the YouTube Player API?

  • 0
    In the settings of the constructor of the created player object, there is an END property in which the end time of video playback is specified in seconds.

    player = new YT.Player('ID_плеера', {
                height: '360',
                width: '640',
                videoId: 'M7lc1UVf-VE',  
                playerVars: 
                    {
                    start: 60,
                    end: 120
                    },
                events: 
                    {
                    'onReady': onPlayerReady,
                    'onStateChange': onPlayerStateChange
                    }
            })


    How can I change this value after creating the player object?
    JavaScript Alexander Haynes, Sep 12, 2019

  • 0 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!