Add premiere date to watch page

This commit is contained in:
Omar Roth 2019-06-08 10:18:45 -05:00
parent 801dffd571
commit ef8c9f093c
No known key found for this signature in database
GPG key ID: B8254FB7EC3D37F2
17 changed files with 53 additions and 26 deletions

View file

@ -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');
bpb.hide();
if (bpb) {
bpb.hide();
player.ready(function () {
new Promise(function (resolve, reject) {
setTimeout(() => resolve(1), 1);
}).then(function (result) {
var promise = player.play();
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 (promise !== undefined) {
promise.then(_ => {
}).catch(error => {
bpb.show();
});
}
});
}
});
}
if (!video_data.params.listen && video_data.params.quality === 'dash') {