New feature media to simplify handling of media in Openhab

Hello All,

I’ve open this parallel threads to simplify discussions around new media feature already discussed in New feature media to simplify handling of media in Openhab · Issue #4710 · openhab/openhab-core · GitHub.

As the feature is crossed repos as we have modifications in openhab-core, openhab-addons as well as modification is several addons, the idea is two have a central point to discuss your thinking about the last updates on this features.

As state a few days in the issue, this new feature will not be ready for 5.0, as their still a lot of work, fixes, and test to be done. My plan is to try to make it available for 5.1, or at worst 5.2.

Laurent.

2 Likes

====== Copy back from issue #4710

The idea behing this is to try to unify and simplify media handling in Openhab between differents addons.
We already have in openhab today:

  • A PlayerItem that enable to controls a player expose by an addons.
  • An audio package that give some level of abstraction on Audio Input and Output source, enable recording and playback to different device.

That would be great is to have a new media package that will abstract the Media calalog, enable to browse this catalog in unify way, and handle the playback through the differents addons.

Notes that there is already some support for this today, but handle separatly in each addons:

  • UPNPControl addon is able to browse media collection using a text input that is populated with song from the media library : this work, but very hard to use because of poor UI.

  • Spotify addon is able to show playlist, and start playback of them. It use like UPNP a text box populated with playlist.

What is done today:

  • Add a core package org.openhab.core.media that implements base interface, and enable each addon to register to expose it media collections to a central mediaRegistry.

  • Same package expose a Servlet that enable browsing of this mediaRegistry.

  • Add a package org.openhab.core.io.rest.media that expose the results on the reset layer.

  • Add some pages in UI : pages/media.vue and pages/media-popup.vue that enables browsing of the mediaRegistry.

  • Modify Spotify and UPNPControl addons to handle this new media Stuff.

  • Some modification on PlayerItem control to launch the media-popup to enable the browsing, and send back the result on the PlayerItem channel, that will enable to start playback through the respective addons.

How it currently locks:

On the mediaPlayer, a new Icons allow to launch the popup.

Image

Popup will display the different MediaSource, so you can browse down your media collection:

Image

Image

Image

When you go down to Track levels, it will show you a screen displaying the parent Album / Playlist, and all the tracks inside, with A global Play button, and the possibility to click on each track to play them individually.

Image

========== Copy back from #4710 ======================

Hello,

This is a quick list (not complete) of what I see need to be done before reviewing this new features for inclusion in 5.1 or 5.2 :

  • [Upnp] : service handling is broken (Emby).
  • [Upnp] : sometimes seems to mix entries (if slow response from UPNP server).
  • [Heos] : support (in progress)
  • [Heos] : output device not initialized correctly every time.
  • [Heos] : support selecting output device.
  • [Squeezebox] : Implements Lyrion/Squeezebox media browsing and playback.
  • [Spotify] : Implements the paging functionnality.
  • Verify that paging request are implements in all binding to be sure to have all entries in media-browser.
  • Verify that play / enque is working ok with all implemented bindings.
  • Verify that all commands working ok with new MediaType command.
  • Review the proxy feature to enable specifics setup configurations.
  • Filter Browse source when coming from specific player attach to a specific binding.
  • Add a default media control player to /media menu page (enable quick access to playing a media).
  • Enhance UI and fixed bugs.
  • Implements the searchbar functionnality.
  • Implements the global player functionnality.
  • Verify that all entries are correclty populated on all bindings, today some are empties !
  • Verify that imageArt are correctly handled everywhere, today missing at some places.
  • Review icons for media-browser, some have to be fixed.
  • See if we add video support, currently only test with Music source, but should work also with Video as weel.
  • Divide MediaType class to 2 separates class to differentiates between ACCEPTED_DATA & ACCEPTED_COMMAND and make things more clear.
  • Do we need to show deviceSelector if we are bind to specific control player ?
  • Some way to see the media queue directly from openhab, and perhaps have some action on it ?
  • Fix unit test in openhab.core to handle more possible case.
  • Have some people test this new feature to have some feedback and fix bugs.
  • Add support for other bindings.
  • Make sure of backward compatibility for binding not implementing the new feature.
  • Code cleanup and static analysis review.
  • Other ?

Done:

  • Backport proxy feature in media Servlet to openhab UI so we can see cover art ever if we are not on inside network.
  • See if we can find a better way to display some path in navigator, today some technical path like “spotify:playlist:7icTs90EG8GG6tGEDnATdi”, not very great.

================== Copy back from #4710 =================

A few screenshoot of latest changes:

  • Add a media menu in Main menu to have a quick access to the media-browser.
  • Support new binding types like Heos and Squeezebox.

Image

  • New rest endpoint to browse available output Devices :
    Image

  • Heos support will enable to handle external services like Tidal, Soundcloud, Tunein

Image

  • Sample Heos / Tidal browsing

Image

  • New Device Selector feature directly on MediaControl item

Image

============ Copy back from #4710 ====================

Have some new features this last days

  • Most binding will now support paged browsing : test with Spotify, Upnp, and Heos.
  • UI implements infinite scrooling so page results are automatically load when you scroll down in the browser.
  • Add a searchbar function on top of media browser : today only test with spotify plugins.
  • Start added a global media menu and a global player capabilities.
  • Review the icons.

Image

Image

1 Like

I’ve deploy the last version on my test server for demo purpose : https://openhab-dev.clae.net/
Fill free to have a look, but just don’t hit the play command as it is links to my real device at home !
Will post the jar a little later.

1 Like

Hello,

Some news.
I’ve implemented today the global player logic.
Still have some things to fix in the logic, but it now start working correctly.

If you go directly from Main menu to new Media page, you will see the following screen

  • On top the mediaBrowser that enable to select music.
  • On bottom, a mediaPlayer with currentTrack/Artist/Art, a slider for track Progress, and a slider for volume.

You should be able to select your player output from the device selector in the media player.
The popup will show you device that was detect, and that have a corresponding PlayerControl associated to them.

After this, you can select your music, play/enqueu, and from the player control you will be able to change song / change volume and see track progression.

Currently implements / test on Spotify / Upnp binding.

Laurent.