Removing black background in q-video #18181
Unanswered
AdagioG
asked this question in
General - Components / Directives / etc
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
On my page I have a YouTube video playing, but I can't seem to be able to hide the black background. From what I can tell, this is some YouTube iframe that defines the background, making it impossible to override
I have tried whatever I could find, in hopes something would magically work, but so far no luck
I have this method
toYouTubeEmbedUrl(idOrUrl: string, opts?: { autoplay?: 0 | 1; mute?: 0 | 1; controls?: 0 | 1; rel?: 0 | 1 }) { const id = this.extractYouTubeId(idOrUrl) ?? idOrUrl const params = new URLSearchParams({ autoplay: String(opts?.autoplay ?? 0), mute: String(opts?.mute ?? 0), controls: String(opts?.controls ?? 1), rel: String(opts?.rel ?? 0), //wmode:'transparent', // Also tried this, but sounds like this is some old code? modestbranding: '1', playsinline: '1' }) returnhttps://www.youtube-nocookie.com/embed/${id}?${params}&enablejsapi=1&origin=${encodeURIComponent(window.location.origin)}&wmode=transparent`},`
And this computed
`mediaThumbs(): Array<{ id: string; type: 'image' | 'youtube'; src: string }>
{
const list = (this.localElement.mediaItems ?? []) as MediaItem[]
},`
The source is then used here
<q-video v-if="currentMedia && currentMedia.type === 'youtube'" :key="yt-${currentMedia.id}" :src="currentMedia.src" class="media-element" />The only way so far I have found that removes the black borders, is by setting the aspect ratio, but unfortunately this has the side effect of making the video take more space in height than what I want it to
<q-video :ratio="16/9" :src="currentMedia.src" class="media-element" />Is there a way to remove this black border or is my mission doomed?
Beta Was this translation helpful? Give feedback.
All reactions