Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Android Media Video Player Control TI.Android.ACTION_MEDIA_BUTTON

$
0
0

Hello,

I'm working on a video player, works very well. the only detail, i want detect the external buttons, for example via bluetooth, as does native. this codse does not work in my app. help my please!!

SDK: 3.2.3 GA platform android 4.2.2 Device: XPERIA M

manifest:

<android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest>            
            <application>
               <receiver android:name=".RemoteControlReceiver">
                    <intent-filter>
                        <action android:name="android.intent.action.MEDIA_BUTTON" />
                    </intent-filter>
                </receiver>                         
            </application>  
            <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
            <uses-permission android:name="android.permission.BLUETOOTH"/>
            <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>        
        </manifest>              
    </android>
code:
var RemoteControlReceiver = Ti.Android.createBroadcastReceiver({
        onReceived: function(e) {               
           alert("hello, ACTION_MEDIA_BUTTON");               
        }
    });  
    Ti.Android.registerBroadcastReceiver(RemoteControlReceiver, [Ti.Android.ACTION_MEDIA_BUTTON]);

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>