Skip to content

New feature media to simplify handling of media in Openhab #4710

Open
@lo92fr

Description

@lo92fr

Hello,

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

What is not working / will need to be done:
A lot of thing, this is very preliminar version.
So I will not do the list tonight.
The idea is just to open the discussion to see if it's a good idea or not.

The Pull-request involved:
#4709
openhab/openhab-addons#18501
openhab/openhab-webui#3140

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAn enhancement or new feature of the Core

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions