[plyr]: update
This commit is contained in:
parent
0e9c12b3a6
commit
af1df31161
37
youtube/static/js/plyr-start.js
Normal file
37
youtube/static/js/plyr-start.js
Normal file
@ -0,0 +1,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}
|
||||||
|
});
|
23
youtube/static/modules/plyr/build-instructions.md
Normal file
23
youtube/static/modules/plyr/build-instructions.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Build steps for Plyr (3.6.8)
|
||||||
|
|
||||||
|
Tested on Hyperbola GNU with Linux-libre.
|
||||||
|
|
||||||
|
First install npm (node package manager).
|
||||||
|
|
||||||
|
Clone the repo to a location of your choosing:
|
||||||
|
```
|
||||||
|
git clone https://git.sr.ht/~heckyel/plyr
|
||||||
|
cd plyr
|
||||||
|
```
|
||||||
|
|
||||||
|
Install Plyr's dependencies:
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
Build with npm:
|
||||||
|
```
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
plyr.js and other files will be in the `dist` directory.
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
2
youtube/static/modules/plyr/plyr.min.js
vendored
Normal file
2
youtube/static/modules/plyr/plyr.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -407,45 +407,9 @@
|
|||||||
{% if settings.use_video_player == 2 %}
|
{% if settings.use_video_player == 2 %}
|
||||||
<!-- plyr -->
|
<!-- plyr -->
|
||||||
<script src="/youtube.com/static/modules/plyr/plyr.min.js"
|
<script src="/youtube.com/static/modules/plyr/plyr.min.js"
|
||||||
integrity="sha512-l6ZzdXpfMHRfifqaR79wbYCEWjLDMI9DnROvb+oLkKq6d7MGroGpMbI7HFpicvmAH/2aQO+vJhewq8rhysrImw=="
|
integrity="sha512-LxSGuB4I2iAln3VLWi8t3RYhEks4/2rtcCw6kqiBghbqBJHXg5ikpeRxEOm0luiIuKDiqwNI3rsCXI/d+MPPAA=="
|
||||||
crossorigin="anonymous"></script>
|
crossorigin="anonymous"></script>
|
||||||
<script>
|
<script src="/youtube.com/static/js/plyr-start.js"></script>
|
||||||
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
|
|
||||||
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',
|
|
||||||
'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},
|
|
||||||
});
|
|
||||||
// @license-end
|
|
||||||
</script>
|
|
||||||
<!-- /plyr -->
|
<!-- /plyr -->
|
||||||
{% elif settings.use_video_player == 1 %}
|
{% elif settings.use_video_player == 1 %}
|
||||||
<script src="/youtube.com/static/js/hotkeys.js"></script>
|
<script src="/youtube.com/static/js/hotkeys.js"></script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user