fix video state sync, fixes #250.
This commit is contained in:
parent
ea99ce7753
commit
76fc892823
@ -22,10 +22,10 @@
|
|||||||
@mouseenter.stop.prevent="onMouseEnter"
|
@mouseenter.stop.prevent="onMouseEnter"
|
||||||
@mouseleave.stop.prevent="onMouseLeave"
|
@mouseleave.stop.prevent="onMouseLeave"
|
||||||
/>
|
/>
|
||||||
<div v-if="!playing && playable" class="player-overlay" @click.stop.prevent="toggle">
|
<div v-if="!playing && playable" class="player-overlay" @click.stop.prevent="playAndUnmute">
|
||||||
<i class="fas fa-play-circle" />
|
<i class="fas fa-play-circle" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="mutedOverlay && muted" class="player-overlay" @click.stop.prevent="unmute">
|
<div v-else-if="mutedOverlay && muted" class="player-overlay" @click.stop.prevent="unmute">
|
||||||
<i class="fas fa-volume-up" />
|
<i class="fas fa-volume-up" />
|
||||||
</div>
|
</div>
|
||||||
<div ref="aspect" class="player-aspect" />
|
<div ref="aspect" class="player-aspect" />
|
||||||
@ -384,9 +384,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Watch('playing')
|
@Watch('playing')
|
||||||
onPlayingChanged(playing: boolean) {
|
async onPlayingChanged(playing: boolean) {
|
||||||
if (this._video && this._video.paused && playing) {
|
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) {
|
if (this._video && !this._video.paused && !playing) {
|
||||||
@ -560,6 +567,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
playAndUnmute() {
|
||||||
|
this.$accessor.video.play()
|
||||||
|
this.$accessor.video.setMuted(false)
|
||||||
|
}
|
||||||
|
|
||||||
unmute() {
|
unmute() {
|
||||||
this.$accessor.video.setMuted(false)
|
this.$accessor.video.setMuted(false)
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
- Fixed keysym mapping for unknown keycodes, which was causing some key combinations to not work on some keyboards.
|
- 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 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 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
|
### Misc
|
||||||
- Updated to go 1.19 and Node 18, removed go-events as dependency (by @mbattista).
|
- Updated to go 1.19 and Node 18, removed go-events as dependency (by @mbattista).
|
||||||
|
Reference in New Issue
Block a user