You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Ruediger Jungbeck (JIRA)" <ji...@apache.org> on 2016/05/26 08:09:12 UTC

[jira] [Commented] (CB-11301) Android Media Buttons only signalled after release

    [ https://issues.apache.org/jira/browse/CB-11301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15301729#comment-15301729 ] 

Ruediger Jungbeck commented on CB-11301:
----------------------------------------

That is where I came from. I tried to use a standard plugin, then implemented a custom plugin only to find out, that the events reach my plugin (MediaButtonEventReceiver) after the fact (ie when the button has already been released). The only simple way, that I see, would be to change the the KeyEventHandler (which sees the event at the right point in time (if the the app is in the foreground).  I have tested this with debug messages. 

I understand your concerns of course. Maybe we can implement a generic mechanism, that passes all key events either as Cordova events (like the volumeup/volumedown) into Javascript (with the native event in the call parameters), or (a bit more complicated to implement) into the plugins (that can choose to handle them).  This would enable others to use the extended infrastructure for their needs and at the same time move the testing / complexity out of the basic Android platform support.

I could implement this changes. But I need them accepted upstream, so that we can easily upgrade to future Cordova versions.

> Android Media Buttons only signalled after release
> --------------------------------------------------
>
>                 Key: CB-11301
>                 URL: https://issues.apache.org/jira/browse/CB-11301
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Android
>            Reporter: Ruediger Jungbeck
>            Priority: Minor
>              Labels: features
>
> The media button (on  Android headsets) issue events when pressed or released. There is a Cordova plugin that installs a BroadcastReceiver for Media Button intents. But this intents occur after the physical button has already been released (to distinguish short and long presses). This prevenets the use of the media button as a PTT (push to talk) kery. So there should be a handling for the media button that is similar to the handling of the volumeup/volumedown In onDispatchKeyEvent



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org