incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Maj <>
Subject Change to Plugins introduced in Android
Date Thu, 10 Nov 2011 17:30:25 GMT
Hey all,

A while ago an issue came up on IRC regarding Media: if a phone received a phone call while
a PhoneGap - er – Callback app was playing media, it wouldn't stop the media so you had
music or whatever playing in the background during your phone call. Not ideal :)

I filed a bug for this on Android and Bryce slayed it, of course, but also came up with a
pretty elegant solution to it. I would recommend the whole team check it out:

Plugins now can handle an onMessage event and can also broadcast a message to all other plugins.
For example, on Android, a "telephony receiver" is registered on the app and when a phone
call comes in or is hung up, a message is broadcast to all other plugins. The audio handler
plugin will pause and resume all streams as phone calls come in / get hung up. Pretty nice!

A side effect for this latest commit is that the network plugin uses this approach to broadcast
going online/offline to other plugins. Currently not used by other plugins but may be useful
down the road.

The reason I'm posting this is because we want to keep our plugin interfaces aligned across
platforms. It would be great if the other platforms implemented this as well. Also would love
to hear what the rest of the team thinks of this change.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message