From e3cd5c9172c1fd468df9f05561ed43fc77954b6d Mon Sep 17 00:00:00 2001 From: Brandon Davis Date: Wed, 11 Nov 2020 09:11:11 -0500 Subject: [PATCH 1/2] Mute video prop --- client/src/components/annotators/VideoAnnotator.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/src/components/annotators/VideoAnnotator.vue b/client/src/components/annotators/VideoAnnotator.vue index a2fa8189d..5927c928a 100644 --- a/client/src/components/annotators/VideoAnnotator.vue +++ b/client/src/components/annotators/VideoAnnotator.vue @@ -12,6 +12,10 @@ export default Vue.extend({ type: String, required: true, }, + muted: { + type: Boolean, + default: false, + }, }, computed: { @@ -25,6 +29,7 @@ export default Vue.extend({ this.video = video; video.preload = 'auto'; video.src = this.videoUrl; + video.muted = this.muted; video.onloadedmetadata = () => { video.onloadedmetadata = null; this.width = video.videoWidth; From e46a74ce0fa1f7adce19a59eab300440eaff3745 Mon Sep 17 00:00:00 2001 From: Brandon Davis Date: Wed, 11 Nov 2020 09:28:32 -0500 Subject: [PATCH 2/2] Allow setting arbitrary attributes --- client/src/components/annotators/VideoAnnotator.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/src/components/annotators/VideoAnnotator.vue b/client/src/components/annotators/VideoAnnotator.vue index 5927c928a..71451b010 100644 --- a/client/src/components/annotators/VideoAnnotator.vue +++ b/client/src/components/annotators/VideoAnnotator.vue @@ -12,9 +12,9 @@ export default Vue.extend({ type: String, required: true, }, - muted: { - type: Boolean, - default: false, + videoPlayerAttributes: { + type: Object, + default: () => ({}), }, }, @@ -29,7 +29,9 @@ export default Vue.extend({ this.video = video; video.preload = 'auto'; video.src = this.videoUrl; - video.muted = this.muted; + Object.entries(this.videoPlayerAttributes).forEach(([key, val]) => { + this.video[key] = val; + }); video.onloadedmetadata = () => { video.onloadedmetadata = null; this.width = video.videoWidth;