Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions images/chromium-headful/client/src/components/video.vue
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@
private focused = false
private fullscreen = false
private mutedOverlay = true
private isVideoSyncing = false

get admin() {
return this.$accessor.user.admin
Expand Down Expand Up @@ -431,6 +432,10 @@

@Watch('playing')
async onPlayingChanged(playing: boolean) {
// In Safari, native events can fire slightly before the `video.paused` property flips.
// This anti-echo guard prevents the watcher from fighting the video element's own state changes.
if (this.isVideoSyncing) return;

if (this._video && this._video.paused && playing) {
// if autoplay is disabled, play() will throw an error
// and we need to properly save the state otherwise we
Expand Down Expand Up @@ -511,11 +516,15 @@
})

this._video.addEventListener('playing', () => {
this.isVideoSyncing = true
this.$accessor.video.play()
this.$nextTick(() => { this.isVideoSyncing = false })
})

this._video.addEventListener('pause', () => {
this.isVideoSyncing = true
this.$accessor.video.pause()
this.$nextTick(() => { this.isVideoSyncing = false })
})

/* Initialize Guacamole Keyboard */
Expand Down
Loading