aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/static/js/speedyplay.js
blob: 58b5d33843e1864ad9907bdbf82aa1a02e944f7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
(function main() {
    'use strict';
    const video = document.getElementById('js-video-player');
    const speedInput = document.getElementById('speed-control');
    speedInput.addEventListener('keyup', (event) => {
        if (event.key === 'Enter') {
            let speed = parseFloat(speedInput.value);
            if(!isNaN(speed)){
                video.playbackRate = speed;
            }
        }
    });
}());