RcuDev / SimpleMediaPlayer

Simple Android media3 service
Apache License 2.0
111 stars 13 forks source link

Rotation #4

Closed emilewakim96 closed 1 year ago

emilewakim96 commented 1 year ago

Thank you for your app code. However, Device rotation while player is running is not handled

RcuDev commented 1 year ago

I @emilewakim96. Thanks for the feedback. I go to review the issue now.

pattersonjack commented 1 year ago

@RcuDev Thanks for this excellent resource!

Removing the stopService call in the activity's onDestroy method appears to work well, although this means we need to stop the service someplace else. Adding stopWithTask="true" to the manifest or overriding onTaskRemoved in the service are two possibilities that come to mind. However, I'd like to hear if you have any other ideas for cleanly stopping the service.

maxrave-dev commented 1 year ago

Thank you for your app code. However, Device rotation while player is running is not handled

Add this to your 'activity' tag in AndroidManifest

android:configChanges="keyboardHidden|orientation|screenSize"

RcuDev commented 1 year ago

Thank you all for the feedback. I haven't had much time to update and review it. I try to do it during these days :).

RcuDev commented 1 year ago

Thanks a lot @maxrave-dev , this fix de rotation issue :).

I go to close this issue.