From 22bd546c70557c6bb3fd9f7a0b9fea7053540801 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Thu, 14 May 2020 08:40:43 +0200 Subject: [PATCH] Fix video dimensions after resizing #17 Signed-off-by: Michael Mayer --- frontend/src/component/p-video-player.vue | 8 ++++++-- frontend/src/dialog/p-video-dialog.vue | 3 --- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/component/p-video-player.vue b/frontend/src/component/p-video-player.vue index cf243d342..d6e121ba2 100644 --- a/frontend/src/component/p-video-player.vue +++ b/frontend/src/component/p-video-player.vue @@ -71,8 +71,9 @@ shimScriptAccess: 'always', forceLive: false, loop: false, - stretching: false, + stretching: true, autoplay: true, + setDimensions: true, success: (mediaElement, originalNode, instance) => { instance.setSrc(self.source); this.success(mediaElement, originalNode, instance); @@ -86,8 +87,9 @@ }, remove() { if (this.player) { + this.player.pause(); this.player.remove(); - this.player = ""; + this.player = null; } }, setSource(src) { @@ -104,6 +106,8 @@ this.player.width = this.width; this.player.videoHeight = this.height; this.player.videoWidth = this.width; + this.$el.style.cssText = "width: " + this.width + "px; height: " + this.height + "px;" + this.player.setSrc(src); this.player.setPoster(""); this.player.load(); diff --git a/frontend/src/dialog/p-video-dialog.vue b/frontend/src/dialog/p-video-dialog.vue index e510fe775..9aff53673 100644 --- a/frontend/src/dialog/p-video-dialog.vue +++ b/frontend/src/dialog/p-video-dialog.vue @@ -73,9 +73,6 @@ this.height = newHeight; } - this.$el.style.height = this.height; - this.$el.style.width = this.width; - this.source = uri; this.show = true; },