sampotts / plyr

A simple HTML5, YouTube and Vimeo player
https://plyr.io
MIT License
26.56k stars 2.93k forks source link

Background video #414

Open nam-co opened 7 years ago

nam-co commented 7 years ago

Hi Thanks for your work, is great, I was wondering if it's possible to use this script for background video, where:

tooltips = false, autoplay = true, clickToPlay = false, hide controls = true Where I think is more important to resize using the height, and on mobile just display the poster image (since they don't autoplay videos)

All this in to a backgroundVideo = true would be great, please consider if it's possible

Regards

sampotts commented 7 years ago

I could at it to the to-do but I'm not really convinced using Plyr is of benefit here, given you're best off using HTML5 video natively without controls and interacting with it's API as needed.

I believe iOS will now autoplay videos without audio (which background videos shouldn't have anyway).

nam-co commented 7 years ago

Hi Sam, true but it would be great to have it here, I think its easier

I tried the iOS BG video but still no luck :) hope some day

alejandroiglesias commented 7 years ago

@nam-co you should be able to autoplay HTML5 videos on all major mobile browsers if they're also muted (ie, have the muted attribute).

https://webkit.org/blog/6784/new-video-policies-for-ios/ https://www.chromestatus.com/features/4864052794753024

friday commented 6 years ago

This should be possible in Plyr using something like the settings {controls: [], clickToPlay: false, autoplay: true, muted: true} or vanilla html5 video with the muted and autoplay properties.