Store preferred playback rate (#493)

This commit is contained in:
Danial Haddadi 2021-10-03 21:18:04 +02:00 committed by GitHub
parent 6b00fe8b8e
commit 930395f74e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -192,6 +192,10 @@ export default {
this.setPreference("volume", videoEl.volume);
});
videoEl.addEventListener("ratechange", () => {
this.setPreference("rate", videoEl.playbackRate);
})
videoEl.addEventListener("ended", () => {
if (!this.selectedAutoLoop && this.selectedAutoPlay && this.video.relatedStreams.length > 0) {
const params = this.$route.query;
@ -278,6 +282,7 @@ export default {
);
});
videoEl.volume = this.getPreferenceNumber("volume", 1);
videoEl.playbackRate = this.getPreferenceNumber("rate", 1);
});
},
destroy() {