stamat/youtube-background

hide related video when the video ends.

aasutossh opened this issue · 4 comments

This is also a problem when pausing the video, due to a recent YouTube change.

@aasutossh @jcackowskidiagram hey, there is unfortunately nothing we can do here... This script now supports Vimeo and HTML 5 video - so these can be alternatives.

@stamat In my case, I needed to disable tab navigation accessibility on the YT iframe. The YT logo is keyboard accessible. Since this is a BG video, there is no need for the iframe to be accessible, so you could hardcode an attribute tab-index="-1" on the embed. That would solve the iframe shifting and making related videos visible.

You could also change the CSS positioning so that a YT iframe is 300% tall, and shifted up 100%. This will effectively hide the controls within the container.

other possibility, ending the video 1second before the end. @stamat already gave us data-vbg-end param.
We could automate this by getting the video duration, any thoughts ?