Fix video dimensions after resizing #17

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-05-14 08:40:43 +02:00
parent 7c59cdc9e7
commit 22bd546c70
2 changed files with 6 additions and 5 deletions

View file

@ -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();

View file

@ -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;
},