summaryrefslogtreecommitdiffstats
path: root/assets/js/player.js
diff options
context:
space:
mode:
authorOmar Roth <omarroth@protonmail.com>2019-06-08 10:52:47 -0500
committerOmar Roth <omarroth@protonmail.com>2019-06-08 10:52:47 -0500
commit9122f8acee758794f168989c9da5234bd4c6e688 (patch)
tree6d2338c114146a42a1596de25e9270ec8b43ec81 /assets/js/player.js
parentef8c9f093c0b6ea4b68b116d683e8d7f045ccd66 (diff)
downloadinvidious-9122f8acee758794f168989c9da5234bd4c6e688.tar.gz
invidious-9122f8acee758794f168989c9da5234bd4c6e688.tar.bz2
invidious-9122f8acee758794f168989c9da5234bd4c6e688.zip
Add title overlay to embedded videos
Diffstat (limited to 'assets/js/player.js')
-rw-r--r--assets/js/player.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/assets/js/player.js b/assets/js/player.js
index 8854d859..ae9a8b25 100644
--- a/assets/js/player.js
+++ b/assets/js/player.js
@@ -102,6 +102,22 @@ var player = videojs('player', options, function () {
});
});
+if (location.pathname.startsWith('/embed/')) {
+ player.overlay({
+ overlays: [{
+ start: 'loadstart',
+ content: '<h1>' + player_data.title + '</h1>',
+ end: 'playing',
+ align: 'top'
+ }, {
+ start: 'pause',
+ content: '<h1>' + player_data.title + '</h1>',
+ end: 'playing',
+ align: 'top'
+ }]
+ });
+}
+
player.on('error', function (event) {
if (player.error().code === 2 || player.error().code === 4) {
setInterval(setTimeout(function (event) {