1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-11-22 07:37:29 +00:00

Synchronise video/audio playback rate

This commit is contained in:
Cadence Ember 2021-04-10 00:25:06 +12:00
parent 431767437d
commit cbedc46c9b
No known key found for this signature in database
GPG Key ID: BC1C2C61CF521B17

View File

@ -135,7 +135,7 @@ function playbackIntervention(event) {
other.currentTime = target.currentTime;
break;
case "ratechange":
other.rate = target.rate;
other.playbackRate = target.playbackRate;
break;
// case "stalled":
// case "waiting":
@ -151,7 +151,7 @@ function playbackIntervention(event) {
for (let eventName of ["pause", "play", "seeked"]) {
video.addEventListener(eventName, playbackIntervention)
}
for (let eventName of ["canplaythrough", "waiting", "stalled"]) {
for (let eventName of ["canplaythrough", "waiting", "stalled", "ratechange"]) {
video.addEventListener(eventName, playbackIntervention)
audio.addEventListener(eventName, playbackIntervention)
}