T
T
tundramani2020-10-20 16:15:15
YouTube
tundramani, 2020-10-20 16:15:15

How to set video playback endpoint in YouTube Player API?

In the settings of the constructor of the created player object, there is the END property, which specifies the end time of video playback 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?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question