mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2024-11-26 09:27:30 +00:00
Synchronise video/audio playback rate
This commit is contained in:
parent
431767437d
commit
cbedc46c9b
@ -135,7 +135,7 @@ function playbackIntervention(event) {
|
|||||||
other.currentTime = target.currentTime;
|
other.currentTime = target.currentTime;
|
||||||
break;
|
break;
|
||||||
case "ratechange":
|
case "ratechange":
|
||||||
other.rate = target.rate;
|
other.playbackRate = target.playbackRate;
|
||||||
break;
|
break;
|
||||||
// case "stalled":
|
// case "stalled":
|
||||||
// case "waiting":
|
// case "waiting":
|
||||||
@ -151,7 +151,7 @@ function playbackIntervention(event) {
|
|||||||
for (let eventName of ["pause", "play", "seeked"]) {
|
for (let eventName of ["pause", "play", "seeked"]) {
|
||||||
video.addEventListener(eventName, playbackIntervention)
|
video.addEventListener(eventName, playbackIntervention)
|
||||||
}
|
}
|
||||||
for (let eventName of ["canplaythrough", "waiting", "stalled"]) {
|
for (let eventName of ["canplaythrough", "waiting", "stalled", "ratechange"]) {
|
||||||
video.addEventListener(eventName, playbackIntervention)
|
video.addEventListener(eventName, playbackIntervention)
|
||||||
audio.addEventListener(eventName, playbackIntervention)
|
audio.addEventListener(eventName, playbackIntervention)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user