I am building a web application with sound - when I run it on iOS (in a browser, mobile Safari or Chrome - I'm not using a native wrapper like PhoneGap) and lock the screen, the sound keeps playing. Is there any way to detect from a webapp whether the user has locked the screen and to turn the sound off when the screen is locked?
Related
I am working on a web page for a company which is only going to run on company internal iPad's that loads .mp4 videos. The iPad's are using the ios Safari browser in full screen mode (locked) to open a URL which contains a link to the videos. When the web page loads it displays a spinning wheel for a few seconds which the video, I assume is still being downloaded.
Is there a way I can prevent/hide that spinning wheel?
I have created a Web App which plays music playlist and it works well on desktop browsers and also in mozilla and opera of android. But When I play the songs on Chrome browser of Android and I turn off the screen, it stops after playing the current song. And as soon as I turn the screen on, it starts loading the next song in line.
From my observations, what I have understood is Google Chrome browser on android pauses the javascript code from executing if the screen is turned off till the screen is not waken up again. Is there any way I can prevent my specific library from pausing? Any approach or events?
Some related this question is what I am looking for: JavaScript halts in inactive android Chrome tab
There are so many WebApps which does not stop playing music. Does it need some permissions from Google App Store?
check what happens with youtube, at least few years ago i had an awful time dealing with that and that's what proved to my client it cant be done in the given time frame and budget. that was actually device specific, on some devices it worked fine and on others it didnt. check if it happens on other devices. the only solutions i could think of ware either to prevent screen turn off (on problematic devices or all of them at the beginning), or to build an app and handle onPause event
I don't think that you can change the behaviour of the Chrome app, if they want to save battery in the background and stop the javascript, you won't reactivate it.
There are maybe some other ways to get it working.
Tell your users that they should use Firefox or Opera on their mobile device.
All apps are allowed to play or stream music in the background, so you could make or use an app for your task.
Maybe you can use the default music player app on android. Open a playlist of streams using the app. (I don't know if this is possible, because I have no android device.)
I know that is not exactly what you want, but a maybe a way to get it working.
JPlayer does not start playing automatically after setMedia() followed by play() on mobile device (Android), but works fine on chrome for PC and even internet explorer, what should i do to get it playing.
This is normal behaviour. On mobile devices playback must be initiated by user interaction. Take a look here for more details -> link
Recently I faced a problem with Youtube videos (iframe API) in WebView of Android 4.X devices.
The problem is onShowCustomView() not fired when video starts playing on Android 4.X devices. I searched for reason, why onShowCustomView() not fired? I got answer as in Android 4.X devices WebView has a feature Embedded Video, because of this video ( in HTML5) will be played by WebView and won't display the video in other Layout.
But when user requested Full Screen mode, then onShowCustomView() will be fired.
Actually I need the Full screen mode of youtube video by default, In Youtube's iframe API no such option to enter full screen, user has to press full screen button.
So for my requirement only 2 answers are there.
Disbaling of Embedded Video for my WebView, then it will work like below Android 4.X and onShowCustomView() will be fired.
Setting the full screen mode by default with Javascript in html file supplying to WebView.
So If anybody got solution to my problem please help me otherwise suggest me to solve this.
I have a html5/JavaScript app. I would like to notify the user when a countdown timer runs out.
The problem is mobile safari. It looks like (unless I'm a native app) I.
Can't play a sound by itself (apparently mobile Safari requires sound to be played on user action (to prevent unwanted bandwidth consumption I'm guessing)
Can't vibrate phone (window.navigator.mozVibrate(pattern) does not appear to work)
Can't flash the screen with some colors because the screen will typically go off after 30 seconds (and I can't tell the screen to turn on if it's off in mobile safari either)
Can't send itself a notification
Heck, is there anything I can do without forcing the user to download a native application? Any type of cue or indication to look at the phone?