How to allow system sleep on non-fullscreen html5 video? - html

We created a little chat client in our office that runs in the browser. It handles people posting pictures and gifs and embeds them. Recently we added support for imgur and gfycat's html 5 video (it auto converts gifs to mp4/webm). An unintented side effect of this is now anyone using chrome or firefox will find that their monitor will never turn off.
You can see in powercfg the culprit is these videos:
C:\WINDOWS\system32>powercfg /requests
DISPLAY:
[PROCESS] \Device\HarddiskVolume2\Program Files (x86)\Google\Chrome\Application\chrome.exe
Playing video
[PROCESS] \Device\HarddiskVolume2\Program Files (x86)\Mozilla Firefox\firefox.exe
If you pause the videos, the entries in powercfg disappear. Switching to another tab, minimizing chrome, even locking the screen don't allow the system to turn the monitor off. Internet Explorer seems to be the only browser that behaves like you'd expect and only prevents sleep when a video is fullscreen.
Is there some way to mark a video tag as 'unimportant' and basically tell the browser that it's OK to let the computer sleep while this video is playing?

It seems there is a bug in Google Chrome 38 (current release as of this writing) that causes the screen saver to be suppressed when playing HTML5 video. Normally, screensaver suppression should only occur when the video is playing in full-screen mode.
This issue appears to be resolved in the beta release of Google Chrome version 39 as it looks like a temporary fix was made.

Related

HTML5 Video Autoplay in Chrome for Digital Signage

https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
A while back, Chrome changed their autoplay policy so that you can't autoplay a video unless it is muted, or the user has interacted with the web page.
I use HTML5 video as part of a digital signage application, but it's common that the page is never clicked - for example when launched automatically in Kiosk mode.
If I mute the video it can autoplay, then if I bind to the play event and try and unmute it causes the video to stop playing (I guess they thought of that). I've had no other luck with similar trickery.
I understand the reasoning behind this behavior and on a website it makes sense - but mine is not a website, it's an application.
Is there a way around this? For example, if I moved to being a Chrome Application/Extension would the policy no longer be enforced? I'm somewhat stumped and would appreciate any insight.
(Asking people to go to chrome://flags/#autoplay-policy is not really an option)
If you are able to control the launch of Chrome, then you should be able to launch chrome from the command line, or via a script, with a flag to ask it to ignore the requirement for a gesture - e.g.:
$ chrome --autoplay-policy=no-user-gesture-required
This flag changed recently which may cause some confusion or be relevant if using older versions - see this discussion for some background: https://groups.google.com/a/chromium.org/forum/#!topic/headless-dev/zxPyN5f8MAQ

How to stop Google Chrome from thinking my flash is an Ad?

So,
A few days ago, Google Chrome started to block Flash advertisement from auto-playing, by default.
The problem is that I'm using videojs media player to play an HLS live stream on my page.
And, since Chrome does not support HLS protocol natively, the player falls back to a small Flash file to play the video.
But Chrome thinks this Flash file is an AD - thus not allowing it to auto-play as it should.
Is there any way to tell Chrome that this file is actually an important part of my page, and not an AD?
Add an empty Flash file larger than 398x298 to the bottom of your page. I found once you have at least one Flash file above their minimum Chrome will not pause any of your Flash. You cannot hide this extra Flash file with CSS. Optionally use a javascript timeout (3 seconds) to hide the empty Flash file in case it messes with your page layout. I'm using swfObject for embedding.
I am dealing with the same issue, but I think the size of the video and location on the page are factors. Try making the video player bigger. When I went up to 410x308 the problem went away.

Stunted Functionality of html5 <audio> tag in mobile browsers

While testing the HTML audio tag, I came across two problems with mobile browsers. First, the "autoplay" attribute does not always function, so that the user needs to touch the "start" button on the screen. Second, a 1:09 recording, cuts off at about one minute with some browsers, but plays to completion with others. An example of the first problem is that autoplay works as it should using the Google Chrome browser on my desktop, but not on my Android (HTC EVO) mobile phone. An example of the second problem is that the mobile Chrome browser plays the audio file to completion on my phone, but the default browser that came with my phone cuts off about 8 seconds prematurely. The autoplay feature, however, works as it should on the "default" browser.
Are these problems caused by reduced functionality and memory when going from a desk or laptop environment to a smartphone environment?
Don't know about Android, but iOS has well-known limitations on HTML5 audio and video. Apple claims they are designed to save data charges, even though they apply even when you are on WiFi, or the assets are local as in an e-book.
The limitations include no preloading until some user interaction occurs, no looping, no inline replay on iPhone, no change of playback rate, no playing backwards, no volume control, etc. etc. See http://blog.millermedeiros.com/unsolved-html5-video-issues-on-ios/ for a good summary.

Loading large videos locally, specifically in chrome

I have an h264 mp4 video that is 960x540, 1000kbps and 30 minutes long. This will be playing off of a disc. I noticed only in chrome that when I open the web page it is embedded in, my computer slows way down and the video gets all choppy for a solid 5 seconds every time...almost like it is loading the entire resource.
I tested playing the file in IE9 and Firefox and these seem to play ok when I first open it. I really wish chrome would ditch their version of flash and just use the plugin version that all the other browsers use. I love chrome, but this is unacceptable.
I am looking for a solution to this resource loading problem. Things to note, I am using the OSMF framework and using a simple MediaPlayerSprite to show the video. Not a heavyweight element whatsoever. Thanks.

Keeping Chrome from freezing when playing HTML5 video

I have a website with HTML5 video. When viewing the page with Google Chrome, Chrome freezes the tab with an "Aw, Snap!" error intermittently. The page stops rendering and then times out about 15 seconds later. This happens about once every five times the page is loaded. It happens much more often when there are multiple videos on the page (about once out of every two times), so it seems like the problem is perhaps occurring on a per-video basis. How can I start debugging this problem? Chrome doesn't give any obvious JavaScript errors. I am using the Video For Everybody video playing code.
Thanks.
This may be related. http://code.google.com/p/chromium/issues/detail?id=72985
Although the bug is for a page with many videos, I've found the same behavior with Chrome 9 on a page with one video. Chrome 10 beta does not exhibit the behavior and removing the preload attribute seems to fix the issue as well.