diff options
| author | Omar Roth <omarroth@protonmail.com> | 2019-06-08 10:18:45 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@protonmail.com> | 2019-06-08 10:18:45 -0500 |
| commit | ef8c9f093c0b6ea4b68b116d683e8d7f045ccd66 (patch) | |
| tree | e910439f3584febb1c45bcd17e9c7cd651d4a84d /assets | |
| parent | 801dffd571ea9b0789da00fd0cfb2aae70e4e352 (diff) | |
| download | invidious-ef8c9f093c0b6ea4b68b116d683e8d7f045ccd66.tar.gz invidious-ef8c9f093c0b6ea4b68b116d683e8d7f045ccd66.tar.bz2 invidious-ef8c9f093c0b6ea4b68b116d683e8d7f045ccd66.zip | |
Add premiere date to watch page
Diffstat (limited to 'assets')
| -rw-r--r-- | assets/js/player.js | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/assets/js/player.js b/assets/js/player.js index 2b546ff4..8854d859 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -163,27 +163,28 @@ player.on('waiting', function () { } }); +if (video_data.premiere_timestamp && Math.round(new Date() / 1000) < video_data.premiere_timestamp) { + player.getChild('bigPlayButton').hide(); +} + if (video_data.params.autoplay) { var bpb = player.getChild('bigPlayButton'); - - if (bpb) { - bpb.hide(); - - player.ready(function () { - new Promise(function (resolve, reject) { - setTimeout(() => resolve(1), 1); - }).then(function (result) { - var promise = player.play(); - - if (promise !== undefined) { - promise.then(_ => { - }).catch(error => { - bpb.show(); - }); - } - }); + bpb.hide(); + + player.ready(function () { + new Promise(function (resolve, reject) { + setTimeout(() => resolve(1), 1); + }).then(function (result) { + var promise = player.play(); + + if (promise !== undefined) { + promise.then(_ => { + }).catch(error => { + bpb.show(); + }); + } }); - } + }); } if (!video_data.params.listen && video_data.params.quality === 'dash') { |
