mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
fix playback modes
This commit is contained in:
parent
3a57b1b5fb
commit
7a3d11eba7
@ -65,7 +65,7 @@ export default class Player extends Core {
|
|||||||
|
|
||||||
track_manifest: null,
|
track_manifest: null,
|
||||||
|
|
||||||
playback_mode: AudioPlayerStorage.get("mode") ?? "repeat",
|
playback_mode: AudioPlayerStorage.get("mode") ?? "normal",
|
||||||
playback_status: "stopped",
|
playback_status: "stopped",
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -509,6 +509,7 @@ export default class Player extends Core {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.track_instance.media.muted = this.state.muted
|
this.track_instance.media.muted = this.state.muted
|
||||||
|
this.track_instance.media.loop = this.state.playback_mode === "repeat"
|
||||||
|
|
||||||
// try to preload next audio
|
// try to preload next audio
|
||||||
if (this.track_next_instances.length > 0) {
|
if (this.track_next_instances.length > 0) {
|
||||||
@ -778,6 +779,14 @@ export default class Player extends Core {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.state.playback_mode = mode
|
this.state.playback_mode = mode
|
||||||
|
|
||||||
|
if (this.track_instance) {
|
||||||
|
this.track_instance.media.loop = this.state.playback_mode === "repeat"
|
||||||
|
}
|
||||||
|
|
||||||
|
AudioPlayerStorage.set("mode", mode)
|
||||||
|
|
||||||
|
return mode
|
||||||
}
|
}
|
||||||
|
|
||||||
duration() {
|
duration() {
|
||||||
@ -850,7 +859,7 @@ export default class Player extends Core {
|
|||||||
|
|
||||||
toggleMute(to) {
|
toggleMute(to) {
|
||||||
if (typeof to !== "boolean") {
|
if (typeof to !== "boolean") {
|
||||||
to = !this.state.muted
|
to = !this.state.muted
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.mute(to)
|
return this.mute(to)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user