I want to make Radio Web App Android-browser-based.
The key function for my Web App is continuously playing music-list
(mp3 files) ...
JavaScript Code is simple ...
And it works well in PC Browser, iOS safari, and Android Dolphin
Browser (3rd party browser)...
-------------------------------------------------------------------------------------
...
var audioPlayer = new Audio();
...
audioPlayer.addEventListener('ended', nextSong, false);
...
function nextSong() {
audioPlayer.src = nextMusic_src
....
}
-------------------------------------------------------------------------------------
But. in Android Default Browser,
when android is in background mode (Home Screen mode & LCD-off Sleep
mode),
Android Browser's onPause() prevent "ended" event & execution of
nextSong().
So, my web app can play only one music.... and does not work any
more.....
Android Browser's onPause() source code is like this ...
-------------------------------------------------------------------------------------
BrowserActivity.java
-------------------------------------------------------------------------------------
public class BrowserActivity extends Activity {
private Controller mController;
// ...
@Override
protected void onPause() {
if (mController != null) {
mController.onPause(); // <<==== here
}
super.onPause();
}
// ....
}
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
Controller.java
-------------------------------------------------------------------------------------
public class Controller implements WebViewController, UiController {
protected void onPause() {
// ...
mActivityPaused = true;
// ...
mUi.onPause();
mNetworkHandler.onPause(); // <<==== here
WebView.disablePlatformNotifications(); // <<====
here
}
// ...
}
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
NetworkStateHandler.java
-------------------------------------------------------------------------------------
public class NetworkStateHandler {
// ...
void onPause() {
// unregister network state listener
mActivity.unregisterReceiver(mNetworkStateIntentReceiver); //
<<==== here
}
// ....
}
-------------------------------------------------------------------------------------
Is there any browser policy for preventing event in background
mode....?
If not, how can I notice this report to the Google developer for
requesting background music play with web app...?
I consider not WebView based web-app (Hybrid) but only browser-based
web-app...
thank you...
Nohyun Kwak
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en