Open Sun3 opened 4 years ago
Working on figuring out iOS Seek bar, hopefully have it by this weekend. Android only has seek bar for Android 10, have made a pull request for that. Waiting on @gaucidaniel to accept the pull.
That is great news, thank you.
Just accepted the pull request and will be releasing an update to the library tomorrow (eventually I'll hook this up to a CI flow). Once again, thanks for all of your work on this @YaarPatandarAA.
I did a quick look at the iOS swift code and to update the seek bar I looks like it needs the following code:
MPNowPlayingInfoCenter.default().nowPlayingInfo?[MPNowPlayingInfoPropertyElapsedPlaybackTime] = self.player.currentItem?.currentTime().seconds
Hmm, I tried something similar to this and it didn't work for me. I can give this another go and see if it makes any difference.
@gaucidaniel Please check if you might need to clean up the code.
Forgot to make the duration update based on Seek will submit it another pull request in morning.
I will test it once you get the new pull request. Thank you.
@Sun3 sorry for the delay, thought I would have time this morning to get it done and pushed. Pull request #16 should have the updated code with seek bar elapsed time update and the other seek bar code to have a working iOS Seek Bar. @gaucidaniel you can go ahead and check the code and then merge.
Android Media Notification has a problem where it will not show the seek bar on the initial played media and for the next played media it will show the total duration from the previous played media. This is due to the notification being shown before the total duration is loaded. Thus making MediaMetadata.METADATA_KEY_DURATION
contain a 0 value.
Tested and Working. @gaucidaniel you can go ahead and check the code and then merge.
@YaarPatandarAA I manually tested the iOS changes and they work great. I look forward to the Android Seek Bar.
Thank you so much.
@Sun3 Android seekbar should be working and already pulled by @gaucidaniel. There was a issues with it not showing the seek bar for the initial media played which I made a pull request for fixing. Please check out pull request #17 for a fully working Android Seek Bar.
Please do note that Android Seek bar is only available on Android 10.
@YaarPatandarAA Got it. I tested with Android 10 and works great (with #17) . I would love to see support for the Android Seek Bar with earlier version of Android. For example Android 8.1 only has a little over 1% of the users.
Thank you.
@Sun3 Android does NOT have seek bar on any android version other than Android 10. SeekBar in MediaStyle notifications was introduced in Android 10. Please refer too the following: https://developer.android.com/about/versions/10/features#media-notifications
Thanks for clarifying. Coming from the iOS platform I am a bit spoiled :)
This can be closed now @gaucidaniel
It looks like the seek bar on the lock screen does not update for both iOS and Android.
Thank you.