aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/static/js/plyr-start.js
blob: aff925f0bfa88f35a7dc504717e0940feedc49ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
let captionsActive;

switch(true) {

case data.settings.subtitles_mode == 2:
  captionsActive = true;
  break;
case data.settings.subtitles_mode == 1 && data.has_manual_captions:
  captionsActive = true;
  break;
default:
  captionsActive = false;
}

const player = new Plyr(document.getElementById('js-video-player'), {
  disableContextMenu: false,
  captions: {
    active: captionsActive,
    language: data.settings.subtitles_language,
  },
  controls: [
    'play-large',
    'play',
    'progress',
    'current-time',
    'duration',
    'mute',
    'volume',
    'captions',
    'settings',
    'fullscreen'
  ],
  iconUrl: "/youtube.com/static/modules/plyr/plyr.svg",
  blankVideo: "/youtube.com/static/modules/plyr/blank.webm",
  debug: false,
  storage: {enabled: false}
});