mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
use $('video') srcChanged event instead of loadeddata/metadata
This commit is contained in:
@ -35,13 +35,13 @@ function setup() {
|
||||
setOptions("video-toggle", options);
|
||||
})
|
||||
|
||||
$('video').addEventListener('loadedmetadata', videoStarted);
|
||||
$('video').addEventListener('srcChanged', videoStarted);
|
||||
}
|
||||
|
||||
function changeDisplay(showVideo) {
|
||||
if (!showVideo && $('ytmusic-player').getAttribute('playback-mode') !== "ATV_PREFERRED") {
|
||||
if (!showVideo) {
|
||||
$('video').style.top = "0";
|
||||
$('ytmusic-player').style.margin = "auto 21.5px";
|
||||
$('ytmusic-player').style.margin = "auto 0px";
|
||||
$('ytmusic-player').setAttribute('playback-mode', "ATV_PREFERRED");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user