Fix comment event listener

pull/836/head
Omar Roth 5 years ago
parent 2a4b252a9d
commit 23ccaea2ff
No known key found for this signature in database
GPG Key ID: B8254FB7EC3D37F2

@ -69,6 +69,7 @@ function get_playlist(plid, retries) {
xhr.send(); xhr.send();
} }
window.addEventListener('load', function (e) {
if (video_data.plid) { if (video_data.plid) {
get_playlist(video_data.plid); get_playlist(video_data.plid);
} else if (video_data.video_series) { } else if (video_data.video_series) {
@ -98,3 +99,4 @@ if (video_data.plid) {
location.assign(url.pathname + url.search); location.assign(url.pathname + url.search);
}); });
} }
});

@ -151,6 +151,7 @@ player.vttThumbnails({
// Enable annotations // Enable annotations
if (!video_data.params.listen && video_data.params.annotations) { if (!video_data.params.listen && video_data.params.annotations) {
window.addEventListener('load', function (e) {
var video_container = document.getElementById('player'); var video_container = document.getElementById('player');
let xhr = new XMLHttpRequest(); let xhr = new XMLHttpRequest();
xhr.responseType = 'text'; xhr.responseType = 'text';
@ -190,6 +191,7 @@ if (!video_data.params.listen && video_data.params.annotations) {
}); });
xhr.send(); xhr.send();
});
} }
function increase_volume(delta) { function increase_volume(delta) {

@ -439,6 +439,7 @@ if (video_data.play_next) {
}); });
} }
window.addEventListener('load', function (e) {
if (video_data.plid) { if (video_data.plid) {
get_playlist(video_data.plid); get_playlist(video_data.plid);
} }
@ -455,3 +456,4 @@ if (video_data.params.comments[0] === 'youtube') {
comments = document.getElementById('comments'); comments = document.getElementById('comments');
comments.innerHTML = ''; comments.innerHTML = '';
} }
});

Loading…
Cancel
Save