Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/runtime/components/ScriptYouTubePlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const props = withDefaults(defineProps<{
playerVars?: YT.PlayerVars
width?: number
height?: number
ratio?: string
/**
* Whether to use youtube-nocookie.com for embedding.
*
Expand All @@ -53,6 +54,7 @@ const props = withDefaults(defineProps<{
playerVars: { autoplay: 0, playsinline: 1 },
width: 640,
height: 360,
ratio: '16/9',
})

const emits = defineEmits<{
Expand Down Expand Up @@ -147,7 +149,7 @@ const rootAttrs = computed(() => {
position: 'relative',
backgroundColor: 'black',
width: '100%',
aspectRatio: `${props.width}/${props.height}`,
aspectRatio: props.ratio,
},
...(trigger instanceof Promise ? trigger.ssrAttrs || {} : {}),
}) as HTMLAttributes
Expand Down Expand Up @@ -186,7 +188,7 @@ const placeholderAttrs = computed(() => {
loading: props.aboveTheFold ? 'eager' : 'lazy',
style: {
width: '100%',
objectFit: 'contain',
objectFit: 'cover',
height: '100%',
},
onLoad(payload) {
Expand Down
Loading