1
0
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:
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; 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)
} }