Add title overlay to embedded videos

This commit is contained in:
Omar Roth 2019-06-08 10:52:47 -05:00
parent ef8c9f093c
commit 9122f8acee
No known key found for this signature in database
GPG key ID: B8254FB7EC3D37F2
6 changed files with 41 additions and 0 deletions

View file

@ -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) {