-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New audio media player service #4208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@ezaquarii @nextcloud-android-bot Amazing! I will give it a thorough test tomorrow after work. (Tuesday) |
|
Unortunately, it is not working. I have just installed the above build and successfully logged in, but when clicking play on an mp3 file the client immediately crashes. (Been trying several times, so it's reproducible.) 😕 |
Thanks for testing. I'll try to ship another build with ACRA crash reporter later this evening, so people actually can get a chance to submit helpful bug reports.
|
|
I have logcat installed, but my phone is not rooted and the adb command is not working. I'll try your next build and upload the resulting output here. Thank you in advance! 👍 |
4157b1b to
fbec2d5
Compare
|
I will wait for the new build as well. Thanks from me, too! 👍 |
fbec2d5 to
c716468
Compare
tobiasKaminsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small questions / change ideas
|
Finite State Machine aka FSM is a well recognized abbreviation used in CS literature.
https://en.m.wikipedia.org/wiki/Finite-state_machine
I get that we don't do abbreviations to be more friendly to contributors so as this is our cultural standard I'll change it to stateMachine. Np.
|
|
Bug(?):
Old behaviour was that when pausing (as we do not have a stop) and leaving player the notification is gone away. |
|
Except this, it looks very very good and is working fine 🎉 🎉 🎉 🎉 |
Weeeeell, yes and no, aka it's complicated. Previous implementation simply turned off service foreground mode, but did not care about clearing the player state nor even releasing the binders. This had a side effect of clearing the icon, but the player was left in paused state. It was usually also bound to Relying on a background service to retain it's state guarantees to have funky edge issues caused by Android resources reclamation. Current implementation preserves the backgrounding behaviour of old player, but does not disable foreground mode, which manifests itself with the icon being still on screen (because the player is technically still up and running, just paused). Otherwise it works as the old one MINUS possible breakages on service kill. I added a STOP button to the notification, so you can stop the player if needed. I was hoping that we simply add proper media player controls to this notification, like every other media player does, allowing the user to go back, pause, resume and stop from there. If the old behavior is important to retain, we could:
This won't play nice if we want to have media controls in notification, as pausing it would close the media controls (and then you can resume it again of course). We have some complaints about the current pause/stop experience, and I think this "magical" pausing is not a good UX at all. Let me know what we want to do here. |
c29fcd1 to
2dab887
Compare
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/11019.apk |
… [skip ci] Signed-off-by: nextcloud-android-bot <android@nextcloud.com>
Codacy277Lint
SpotBugs (new)
SpotBugs (master)
|
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/11020.apk |
Codacy277Lint
SpotBugs (new)
SpotBugs (master)
|
Nice, I think this is enough.
This would indeed be very cool, but should be done in another PR 👍 |
|
Thanks again for this great PR 🎉 🎉 🎉 |
ea696c5 Merge pull request #4425 from nextcloud/autoUploadSubfolder 37c6600 Upload files into subfolder a1c28f9 Merge pull request #4470 from stephanritscher/master 9c1fedb add test cases 6184fcd add test cases 0f97564 Merge pull request #4208 from nextcloud/ezaquarii/new-media-player-service d83792e [tx-robot] updated from transifex 9a2fc28 [tx-robot] updated from transifex f10843e daily dev 20190928


This is a new media service based on state machine to address #3061. I tried to salvage the old solution but decided to do a complete re-work. I firmly believe that new architecture will allow us to fix any current and future edge cases easily.
However, the work is not complete yet and there are few issues to consider before we move forward.
Some featutres are cut out, some didn't work anyway, so we need to make Decisions(tm).
Restoring minimized player exists preview
Expected: media preview screen, maybe resume playback?
Actual: media preview fragment is closed
I discovered that this also happens on current master, so this is an existing issue, not a regression.
This is most likely caused by
FileDisplayActivity.onAccountSet(false)which re-sets displayed fragments.Total time is not displayed when streaming media
I could not confirm if this is regression, as streaming media does not work on prod and master.
It seems that
android.media.MediaPlayerreturns 0. I can imagine that media file header is not available in streaming mode, but also the media player could do something smart to work around it, so I'd like to have a 2nd opinion.Here are my results:
I'll need some help with testing it in other environments, as I'm not sure if this is expected to work (which require more work, obviously) or not (which require setting some flags to disable those controls).
Media control is a bit wonky
Play-pause is not propagated correctly as it is polling the player. This is something to be addressed with further refactoing.
Audio manager
Audio focus handling is still not implemented, as it is not required at this stage.Implemented.
Auto-stop on file deletion
Auto-stop on file deletion is currently removed (I left the placeholder to trigger it). Closing preview stops the player and it seems that background playback was not implemented anyway.
Notification is removed for now
Again, no background playback==not needed at this stage. Besides, it didn't provide controls, so more work is needed if we want to bring that into usable state.Old notification behavior is restored.
Last but not least is the StateMachine frameworkNo longer an issue - I'm a maintainer and
stateless4jis in good shape again.@tobiasKaminsky @AndyScherzinger @DPTJKKVH Please give it a go and let me know how we'd like to proceed with that.
Fixes #4515