android-mediasession

MediaSession finishBroadcast() exception

a 夏天 提交于 2019-12-08 06:23:25
any idea about the cause of this exception? 01-10 15:33:43.111 21717-21717/com.music.ofek.iplay E/AndroidRuntime: FATAL EXCEPTION: main Process: com.music.ofek.iplay, PID: 21717 java.lang.IllegalStateException: finishBroadcast() called outside of a broadcast at android.os.RemoteCallbackList.finishBroadcast(RemoteCallbackList.java:292) at android.support.v4.media.session.MediaSessionCompat$MediaSessionImplApi21.setPlaybackState(MediaSessionCompat.java:3226) at android.support.v4.media.session.MediaSessionCompat.setPlaybackState(MediaSessionCompat.java:608) at com.google.android.exoplayer2.ext

MediaSession finishBroadcast() exception

﹥>﹥吖頭↗ 提交于 2019-12-08 04:01:40
问题 any idea about the cause of this exception? 01-10 15:33:43.111 21717-21717/com.music.ofek.iplay E/AndroidRuntime: FATAL EXCEPTION: main Process: com.music.ofek.iplay, PID: 21717 java.lang.IllegalStateException: finishBroadcast() called outside of a broadcast at android.os.RemoteCallbackList.finishBroadcast(RemoteCallbackList.java:292) at android.support.v4.media.session.MediaSessionCompat$MediaSessionImplApi21.setPlaybackState(MediaSessionCompat.java:3226) at android.support.v4.media.session

Connecting exoplayer with MediaSessionCompat

喜你入骨 提交于 2019-12-06 11:05:12
I want to connect my implementation of exoplayer with the media session object. I set up a SimpleExoPlayerView to show a video. Every time a button is clicked, I want the media session callbacks to fire. I can only get the callbacks to fire when something like a pair of headphones is used. The code used in the app is written below @OnLifecycleEvent(Lifecycle.Event.ON_CREATE) public void setUp(LifecycleOwner lifecycleOwner){ // Create a MediaSessionCompat Log.i("Hoe8", "lco setup called"); mMediaSession = new MediaSessionCompat(activity, "this"); // Enable callbacks from MediaButtons and