I am developing a website and I am using a video as my hero container in my main page. The video is set to autoplay as soon as the page loads. On IOS low battery mode, I found out that it stops video autoplay in order to save battery life. What are my possible solutions to fix this problem.
The play button is shown on the video. Is it possible to force the video to play or even hide the playbutton of the video?
Is there any event listeners that work aside from suspend because that did not work for me.
Related
Safari and Chrome is not allowing video to autoplay if sound is on by default (unmuted). If you mute the video, it will autoplay, and the user is forced to enable sound. Fine and well, I can live with this.
However, in researching this, I found that YouTube (Safari 11, MacOS High Sierra), is allowing subsequent videos to be played with sound ON if the user turns sound on for a given video. Likewise, if user mutes the video, clicks onto a different video, this video will autoplay muted until user toggles the sound on. I would love to replicate this on a site in which I have created a video gallery of sorts. Each video does live on it's own page, and navigating the gallery will take user to a new page in the browser. This needs to stay the same, for multiple reasons (as opposed to creating a single media element and dynamically changing video source).
Alternatively, is there a way to convince Safari that a user has intentionally clicked a button in order to watch a video, thus allowing autoplay with sound on, when the user is simply clicking a link (in the form of a "Play Video Now" button) to a page with the video embedded?
I am using JWPlayer for my videos on my site. What I want to achieve is to autostart videos unmuted. I have autostart feature on but the videos start muted.
The thing is I have playlists which directly refreshes the page instead of changing the video (i have to work this way). Whenever the page changes, the video starts automatically but muted just as before.
Is there any trick that I can autoplay videos unmuted on mobile browsers?
Thank you in advance!
The limitation is related to HTML5 videos, not just the JWPlayer - for various reasons video autoplay on mobile devices has historically been limited or restricted.
This was typically to avoid excessive bandwidth charges for users and also to avoid annoying users by having a video or audio suddenly play unexpectedly for them.
The restrictions are different for different platforms but it is fair to say that most platforms have eased the restrictions in recent years and autoplay of muted video is often supported now. Autoplay of united videos on mobile devices is still generally not allowed.
You can see the summary of Webkits policies for iOS as an example here: https://webkit.org/blog/6784/new-video-policies-for-ios/
There is a specific focus on the audio track - e.g.:
video elements will be allowed to autoplay without a user gesture if their source media contains no audio tracks.
video muted elements will also be allowed to autoplay without a user gesture.
If a video element gains an audio track or becomes un-muted without a user gesture, playback will pause.
I have an mp4 video on my site that I play with $("#movie").get(0).play(). That works fine.
However, if I do alert("anything"); and then try playing the movie, the movie only advances a few frames (I get sound too). Then it freezes. The video controls still show "pause" being an option, so the player still thinks it's playing. I have to refresh the screen, and avoid alert()ing anything in order to play the whole video. How can I get around this problem?
I'm on the newest version of Chrome on a Macbook Pro with the newest Yosemite.
I'm trying to get it understand but after 2 days of digging the code I thought that I will post my issue here...
According to Apple's documentation, autoplaying videos on iOS devices cannot be done without user interaction first (e.g. tap on video). Despite that, mobile YouTube (m.youtube.com) is able to autoplay its videos just after loading a page with video.
Does anyone know how they are doing it?
PS. I've checked all available JS/HTML techniques of autoplaying videos on website on iOS (e.g. iframe, fake click, triggering touch event on video, fetching video with XHR).
I believe that youtube.com is a single page app. So when the user clicks on the video from the list view the page is not loading and their javascript uses that initial click, that leads to the video page, as the click that starts the video. It's not actually autoplaying, it's just a trick.
Often when browsing in Firefox, I'll right click on a link, and open it in a separate tab to view later, and go on reading the current page. When the link is a Youtube script, however, playback starts immediately even though the tab isn't active. Other video players (like fora.tv and TED.com) don't start playback until you activate that tab.
Is there a greasemonkey script that I can use to make sure that videos (and especially Youtube videos) are paused unless their tab is active?
I found two options:
"Youtube Alternate Video Player" (greasemonkey script)
http://userscripts.org/scripts/show/13955
Script Summary:
Replaces the youtube flash video player with FlowPlayer flash video player.
replaces the youtube player
no hd
no 16:9
Firefox Add-On "TubeStop"
http://www.chrisfinke.com/addons/tubestop/
disables the autoplay on YouTube videos
does it every time (even if the tab is active)
I will keep the TubeStop addon for now.
I think Youtube now does this by default (only playing a video when the tab the video is in is activated)