Releases: stamat/youtube-background
v1.0.11
v1.0.10
- Added events on play/pause and mute/unmute actions
- video-background-play - video starts playing
- video-background-pause - video is paused
- video-background-mute - video sound is muted
- video-background-unmute - video sound is unmuted
Events bubble. If you go vanilla, you can get the video object via event.detail
.
- Source element, the one with attribute
data-youtube
is no longer being replaced by a new element wrapping the iframe, but it becomes the wrapper instead. This way we can correctly listen to events. - Fixed pause/play bug caused by carelessly introducing the
start-at
feature...
v1.0.9
v1.0.8
v1.0.7
v1.0.6
#8 Due to Youtube API event.target property naming changes the video was no longer resizing because the target iFrame could no longer be found.
This problem indicated a much larger problem in maintainability of the code, so the code was heavily refactored in vanilla JS to support future expansions and upgrades.
The script now injects the embed iFrame instead of YT Player API doing it, which solves the noted issue
Another problem arose due injecting the iFrame, the unMute ability is lost due https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
Which will be solved in the next few days.
v1.0.4
v1.0.3
Multiple plugin triggers enabled, fixed late triggers after the Youtube iFrame API loaded event
Option to hide video on mobile
Option to pull default video image as a background from youtube
Option to pause the background video cause of motion sickness #3 suggested by @djmtype
Options as html attributes