mirror of
https://github.com/iv-org/invidious.git
synced 2025-07-22 06:29:22 -04:00
Add title overlay to embedded videos
This commit is contained in:
parent
ef8c9f093c
commit
9122f8acee
6 changed files with 41 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue