Resolve "Fallback image caching problem"

This commit is contained in:
Miroslav Šedivý 2022-02-07 13:31:11 +00:00
parent f4c0fe7e87
commit c5e845c025
2 changed files with 18 additions and 3 deletions

View File

@ -1,8 +1,13 @@
<template>
<div ref="component" class="neko-component">
<div ref="container" class="neko-container">
<video v-show="!screencast" ref="video" :autoplay="autoplay" :muted="autoplay" playsinline />
<neko-screencast v-show="screencast" :enabled="screencast" :api="api.room" />
<video v-show="!screencast || !screencastReady" ref="video" :autoplay="autoplay" :muted="autoplay" playsinline />
<neko-screencast
v-show="screencast && screencastReady"
:enabled="screencast"
:api="api.room"
@imageReady="screencastReady = $event"
/>
<neko-cursors
v-if="state.cursors.enabled && state.sessions[state.session_id].profile.can_see_inactive_cursors"
:sessions="state.sessions"
@ -197,6 +202,7 @@
return this.state.session_id != null ? this.state.sessions[this.state.session_id].profile.is_admin : false
}
screencastReady = false
public get screencast() {
return (
this.state.authenticated &&

View File

@ -1,5 +1,5 @@
<template>
<img ref="image" />
<img ref="image" @load="onImageLoad" />
</template>
<script lang="ts">
@ -50,6 +50,11 @@
}
this.running = false
this.$emit('imageReady', false)
if (this._image) {
this._image.src = ''
}
}
mounted() {
@ -81,5 +86,9 @@
this.stop()
}
}
onImageLoad() {
this.$emit('imageReady', this.running)
}
}
</script>