Skip to content

Commit

Permalink
feat: extend VideoPlayer by object-position
Browse files Browse the repository at this point in the history
  • Loading branch information
kleinpetr committed Dec 14, 2024
1 parent 9d6d3b1 commit b6219f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/VideoPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ export default {
},
computed: {
styleObject() {
if (!this.objectFit) {
if (!this.objectFit && !this.objectPosition) {
return {};
}
return {
objectFit: this.objectFit,
objectPosition: this.objectPosition,
};
},
},
Expand Down
4 changes: 4 additions & 0 deletions src/core/playerProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export default {
type: String,
default: 'cover',
},
objectPosition: {
type: String,
default: 'center',
},
playsWhen: {
type: String,
default: 'canplay',
Expand Down

0 comments on commit b6219f2

Please sign in to comment.