Methods Summary |
---|
public static java.lang.Object | createPlaybackPositionUpdateListener(MediaSessionCompatApi14.Callback callback)
return new OnPlaybackPositionUpdateListener<MediaSessionCompatApi14.Callback>(callback);
|
public static void | registerMediaButtonEventReceiver(android.content.Context context, android.app.PendingIntent pi)
AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
am.registerMediaButtonEventReceiver(pi);
|
public static void | setOnPlaybackPositionUpdateListener(java.lang.Object rccObj, java.lang.Object onPositionUpdateObj)
((RemoteControlClient) rccObj).setPlaybackPositionUpdateListener(
(RemoteControlClient.OnPlaybackPositionUpdateListener) onPositionUpdateObj);
|
public static void | setState(java.lang.Object rccObj, int state, long position, float speed, long updateTime)
long currTime = SystemClock.elapsedRealtime();
if (state == MediaSessionCompatApi14.STATE_PLAYING && position > 0) {
long diff = 0;
if (updateTime > 0) {
diff = currTime - updateTime;
if (speed > 0 && speed != 1f) {
diff *= speed;
}
}
position += diff;
}
state = MediaSessionCompatApi14.getRccStateFromState(state);
((RemoteControlClient) rccObj).setPlaybackState(state, position, speed);
|
public static void | unregisterMediaButtonEventReceiver(android.content.Context context, android.app.PendingIntent pi)
AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
am.unregisterMediaButtonEventReceiver(pi);
|