+
@@ -384,9 +384,16 @@
}
@Watch('playing')
- onPlayingChanged(playing: boolean) {
+ async onPlayingChanged(playing: boolean) {
if (this._video && this._video.paused && playing) {
- this.play()
+ // if autoplay is disabled, play() will throw an error
+ // and we need to properly save the state otherwise we
+ // would be thinking we're playing when we're not
+ try {
+ await this._video.play()
+ } catch (err: any) {
+ this.$accessor.video.pause()
+ }
}
if (this._video && !this._video.paused && !playing) {
@@ -560,6 +567,11 @@
}
}
+ playAndUnmute() {
+ this.$accessor.video.play()
+ this.$accessor.video.setMuted(false)
+ }
+
unmute() {
this.$accessor.video.setMuted(false)
}
diff --git a/docs/changelog.md b/docs/changelog.md
index 49ffecb2..796148a1 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -13,6 +13,7 @@
- Fixed keysym mapping for unknown keycodes, which was causing some key combinations to not work on some keyboards.
- Fixed a bug where `max_fps=0` would lead to an invalid pipeline.
- Fixed client side webrtc ICE gathering, so that neko can be used without exposed ports, only with STUN and TURN servers.
+- Fixed play state synchronization, when autoplay is disabled.
### Misc
- Updated to go 1.19 and Node 18, removed go-events as dependency (by @mbattista).