diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-01-02 17:24:33 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-01-10 06:02:37 +0300 |
commit | d204b09fe04c834fc4997dcf49c40c8b85d151ee (patch) | |
tree | 3633381df4fea00a20452331c4c74bd0d621d307 /src/FilesSidebarCallViewApp.vue | |
parent | 0cb55195888c2a7f34870d2faa0141e3c8fb3763 (diff) |
Fix frozen video after closing and opening the sidebar during a call
When a video element is removed from the DOM and then added again it
will be frozen in its last frame until its "srcObject" is set again
(even overwriting itself with
"videoElement.srcObject = videoElement.srcObject" would be enough).
Closing and opening the sidebar removes it from and adds it back to the
DOM, but as "srcObject" is only set when the stream changes the video
element was frozen after opening the sidebar again.
Instead of notifying the child views that they were shown again (as it
does not seem to be possible to detect it from the child views
themselves) so they can refresh the "srcObjects", for simplicity now the
CallView is fully rendered again when the sidebar is opened after being
closed.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'src/FilesSidebarCallViewApp.vue')
-rw-r--r-- | src/FilesSidebarCallViewApp.vue | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/FilesSidebarCallViewApp.vue b/src/FilesSidebarCallViewApp.vue index 8fdac4ba4..99f188d47 100644 --- a/src/FilesSidebarCallViewApp.vue +++ b/src/FilesSidebarCallViewApp.vue @@ -19,7 +19,10 @@ --> <template> - <CallView v-show="isInCall" :token="token" :use-constrained-layout="true" /> + <CallView v-if="isInFile" + v-show="isInCall" + :token="token" + :use-constrained-layout="true" /> </template> <script> @@ -62,10 +65,28 @@ export default { return this.$store.getters.getFileIdForToken() }, + /** + * Returns whether the sidebar is opened in the file of the current + * conversation or not. + * + * Note that false is returned too when the sidebar is closed, even if + * the conversation is active in the current file. + * + * @returns {Boolean} true if the sidebar is opened in the file, false + * otherwise. + */ + isInFile() { + if (this.fileId !== this.fileIdForToken) { + return false + } + + return true + }, + isInCall() { // FIXME Remove participants as soon as the file changes so this // condition is not needed. - if (this.fileId !== this.fileIdForToken) { + if (!this.isInFile) { return false } |