Chrome for Mobile stops my video if switched to background - android

I provide a mobile site on which users are able to watch videos (embedded via HTML5 video). My users request that the video should continue to play if they switch to another app or lock the screen to save battery. It would be okay, if they have to "Phone-OS-level-ACK" this background play behavior before switching to another app.
Is there something I can do on my mobile page to support this kind of behavior? I've read that Chrome >= 54 should have support to do this, but my videos still stop immediately after switching to another app. What kind of sorcery is required to support that feature for my users?

It will pop in your notification bar and you can play from there. Just make sure your Google Chome has permission to post notifications

Related

How to prevent automatic screen lock for a mobile website on android and iphone

I've build a mobile web app with PHP, HTML and JS. (The app is not native and not in the Apple iPhone App Store or Google Android Play Store).
In my mobile app I use jPlayer (https://jplayer.org/) for users to listen to sound meditations. The duration is around 20 minutes for each meditation. The problem is that the screen goes automatic in lock or sleep mode.
On some Android devices is 10 minutes the maximum for the automatic lock. So they can not relex and listen to the full sound without reactivating the screen.
I tried to use the javascript lib NoSleep.js (https://richtr.github.io/NoSleep.js/) and tested it on my iPhone 12. It is not working, the screen locks anyway.
Is there some way to keep the screen active?
Update: I found out that the sound keeps playing when I use the mobile website application in the browser Chrome or Safari. But when I save the app as a desktop icon and then use the jPlayer it stops after screenlock. Probably there is no solution for this.

Prevent Android from closing a Progressive Web App playing audio in the background

I've written a progressive web app which plays music using the Web Audio API. A common user journey is to start the music playing, then change to other apps whilst still listening to the music. This works fine for a while, until android decides that it needs more resources for the other apps and closes down my PWA without warning.
Is there a way to hint to the browser and OS that despite not being in the foreground, the user is still using a particular web app?
I'm fine for it to be tidied up in the background when the music is paused, but not whilst the user is still listening to something.
The main browser I'm interested in is Chrome for Android (though something platform agnostic would be ideal).
You can't, today. This is somewhat related to MediaSessions (https://wicg.github.io/mediasession/), but you really need a background app, which is not a concept that's yet supported by the web. (It's related, also, to ServiceWorkers and Web Workers, but again, not precisely. It's really a difficult scenario, as such an app has a definite ability to drain batteries.)
I have created a bug for this Chrome bug
If you have steps to reproduce, please comment on the bug

Can video autoplay on mobile devices

I had always heard this was a disabled feature on all mobile devices but I was corrected earlier today when I went to youtube.com from my android phone and lo and behold, it played on its own. Is this possible with jwplayer? Is it possible on any other player other than youtube?I've tried this in the past using all the built in features as well as some javascript workarounds such as clicking the play button when the page has loaded.
I understand bandwidth usage but what about streaming media sites that users KNOW they are about to watch a video.. after-all that's why they went to that site.
I never have seen that a video is opened automatically in mobiles or tablets.
I just tried myselft with youtube, and it does not play automatically if you use the web browser. However It does play automatically if you open the video with the youtube app.
Can you provide a link where this is happening? and the details of where are you testing this (browser, device,...) ?
Some Android devices may allow it to autostart. iPad may allow it. iPad does allow inline videos to play one at a time.

Android App - Turn on "Screen Cast" from ChromeCast App

This is a tricky one and I am guessing it won't be answered as I am not sure its possible. I am working on an application that the customer would like screen cast on to a large TV, with effectively "one click" in a menu on an android device (to a ChromeCast).
Scenario is
ChromeCast in TV and on wifi (but not connected to android device).
Android application is run by user.
User hits "one click" button (which is more like two click), one to start cast device lookup, second selects device.
Mirroring occurs
That's pretty much it. Its the same feature as the ChromeCast App "Screen Cast" functionality...to be honest we just want to turn this on from our app, instead of having to load the ChromeCast App.
Thanks.
There is currently no API to turn mirroring on from within an app. Note that on devices such as N5, the mirroring option is also offered from the notification shade so no need to bring up the chromecast app.
I have the same problem. The only way I have been able to acheive this is by starting the chromecast app and starting screen mirroring from there, and have my app implement a Presentation class. Even though I have been able to fully implement the ChromeCast UIButton, it doesn't work for starting screen mirroring from within the app. Probably an undocumented API or something they might add in the future, but currently I have found no way of doing it only in-app.
-edit-
Just thought I'd mention it, but a while back (after I/O 15) Google updated the available ChromeCast API's. Using a CastPresentation and the latest callbacks, it's possible to do this.

Is it possible to have a second screen device launch an application on Google TV?

I've been reading the AnyMot protocol and the fling is mentioned wherein a second screen app can launch the YouTube app. Could a tablet application launch say the Flixter, Pandora or the Goolge Music app without it being a remote control emulator. If so would the AnyMot protocol be what's used?
Thanks
Anymote is a very much adequate for that. If, you want to do an app like "Able Remote", you'll need to put a small app on the TV which will tell you what apps are present. But for what your asking, it's doable w/ just Anymote.

Categories

Resources