From b6219f2628a8c8396c52e3ff75f1e31359232605 Mon Sep 17 00:00:00 2001 From: Klein Petr Date: Sat, 14 Dec 2024 10:00:00 +0100 Subject: [PATCH] feat: extend VideoPlayer by object-position --- src/components/VideoPlayer.vue | 3 ++- src/core/playerProps.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/VideoPlayer.vue b/src/components/VideoPlayer.vue index 3251c43..9903cfb 100644 --- a/src/components/VideoPlayer.vue +++ b/src/components/VideoPlayer.vue @@ -35,11 +35,12 @@ export default { }, computed: { styleObject() { - if (!this.objectFit) { + if (!this.objectFit && !this.objectPosition) { return {}; } return { objectFit: this.objectFit, + objectPosition: this.objectPosition, }; }, }, diff --git a/src/core/playerProps.js b/src/core/playerProps.js index 57f5e43..973f99a 100644 --- a/src/core/playerProps.js +++ b/src/core/playerProps.js @@ -19,6 +19,10 @@ export default { type: String, default: 'cover', }, + objectPosition: { + type: String, + default: 'center', + }, playsWhen: { type: String, default: 'canplay',