Hi,
I have spent some time with media-hub. I wanted to solve three problems:
1 The default image for album art is not shown on the Sound indicator panel.
(https://github.com/ubports/media-hub/issues/6)
2 Embedded album art of audio streams do not show up on the Sound indicator panel.
(See https://github.com/ubports/media-hub/issues/9)
3 Using media-hub playlist still results in choppy audio after a track change.
(See https://github.com/ubports/ubuntu-touch/issues/1415)
-
For the default image I have a PR (https://github.com/ubports/media-hub/pull/7).
It removes the use of some sort of 'dash' server which does not exist anymore and . -
For the embedded album art I have a PR (https://github.com/ubports/media-hub/pull/10). It saves the image to a temporary file and let Thumbnailer handle it.
-
For the choppy audio problem I have a PR (https://github.com/ubports/media-hub/pull/8). Media-hub acquires a new wackelock for every track and releases it when the track is done. If the app is suspended when the track is done it will not signal media-hub to continue playing. But media-hub will keep on playing this time without acquiring a new wakelock and thus the audio becomes choppy.
This PR makes sure media-hub will acquire a new wakelock when playing the next track even when the app is suspended. It seems to work.
Part of the media-hub code is used in qtubuntu-media (libmedia-hub-client). There is still some code in there to detach/reattach the app when suspending/activating. I tried all sorts of things but it does not work anymore (unless the Player object is not renewed). Video playing becomes completely broken since event registration/notification is
messy. Besides that detaching does not seem to do a lot (only sets the lifetime state in mediahub) so I gave up on it.
There was a proposal to add reference counting and keep the wakelock based on that. I think that won't be needed and would also result in a wakelock being kept when there is no need for it (not playing).