-
Notifications
You must be signed in to change notification settings - Fork 8
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
MediaPlayer Capability Schema #34
Comments
IIRC ocf has a model for player, playlist and such: |
The Kodi project has a very long list of values and actions which can be called via HTTP and WebSocket using JSON-RPC. I think it’s another good source of inspiration. |
A MediaPlayer should feature the basic interactions of:
Possibly optional(?):
Furthermore, MediaPlayers are usually devices which you wouldn’t leave on while they are not in use. Will IoT MediaPlayer have to manage this themselves as a spec could except them to be available at all times? |
From #32 (now closed): MediaPlayerA device that displays media. Properties
Actions
VolumeProperty
PlayingProperty
ShuffleProperty
RepeatProperty
ProgressProperty
TrackProperty
ArtistProperty
AlbumProperty
PreviewProperty
Note: The primitive MutedProperty
StopActionStops current playback on the thing. inputNone. PreviousActionPlays the previous item in the playback queue. inputNone. NextActionPlays the next item in the playback queue. inputNone. |
Can we merge this PR? |
I'm happy enough with the PR (given that I worked on it, #32), but this one really should have a proper UI design. @benfrancis any thoughts? |
For reference, I'm pasting screen shots from my use of the Sonos add-on. I normally leave it configured to stream from an Internet source (Radio Swiss Jazz), so the only two properties I actuate are "Playing" and "Volume". The biggest disadvantage of the Sonos add-on is the lack of a media player capability that let's me set "Playing" (or not) from the main icon. (As a workaround I created a virtual dimmable switch and tied it to this one using rules.) When this MediaPlayer Capability is available, will it be applied to add-ons like the Sonos one, and if so, would I be able to click the main icon to switch between playing/not playing? That would make me happy. :) Another useful configuration option that @tim-hellhake added was to by default not show some of the properties so that the more important ones would fit (otherwise on smaller screens they'd overlap and you simply couldn't use them, whether normal size or zooming in or out). |
@benfrancis Any news on this? 😬 |
The UI design for this has been on my queue for a while and I would like to get it done, perhaps we could even target the 1.1 release at the end of March? The reason it has taken me so long is that this is the most complex schema we've added. Trying to design the UI has raised some questions for me about this schema:
I have posted a rough first UI design in WebThingsIO/gateway#1628 which demonstrates the problem of having so many properties an actions in one schema, with a possible solution. There are some issues with this approach though, which should be discussed until we're sure which issues should be solved in the schema/API implementation and which issues should be solved in the UI. Thoughts? |
You mentioned this capability might be used for bi-directional communication, such as through a video doorbell? I don't really see any audio recording abilities though? More on topic: for playing radio it might be nice to have a |
@flatsiedatsie wrote:
This is kind of related to my comment about "How do you tell a media player device what to play?". I wonder if it could be possible to tell the media player to play a video/audio stream from a URL, which might be one way of approaching that, but is a bit clunky. Or maybe there should be a separate tanoy/speaker capabilty specifically for streaming audio to a device like a bluetooth speaker (or doorbell/camera talkback feature). Note that this would be streaming, not recording (i.e. saving to disk).
This has always been the problem with this capability, there are just so many variations on what could be considered a media player. Where do you stop? FM/AM radio? DAB radio? MP3 player? Streaming stick? DVD/BluRay player? Cable/satellite/terestrial/IPTV set-top box? DVR? Smart TV? and so on. Maybe what we need to do is pick the lowest common denominator features among all of these different types of media player and make that the For example, maybe There could be a What is a reasonable lowest common denominator for a media player (bearing in mind that some affordances can be optional)? |
It seems to me all those things are covered pretty well by the existing spec. Save for the radio needing to say something about which stream/station is being played. So I'd stop after adding a property that denotes the string name of the stream/station/file that is playing. Alternatively, why have artist and album as properties at all, and not just a generic 'info string'? That can show all kinds of information about what it being played (e.g. artist & album, film title, CCTV footage camera name), by all kinds of hardware? I agree that using a mediaplayer capability for bi-directional communication of baby monitors, intercoms or smart doorbells is very clunky. It might make more sense to add that to videoCamera, or add it as a separate capability all together. |
Looking at that Sonoff screenshot, and this thermostat screenshot, I'd also say it's high time to move away from the octopus design for the UI. But that's another story. |
I agree the basics are there, though there are obviously missing features for some devices (like how to change the radio station/TV channel and all the other kinds of features you typically find on a TV/Hi-Fi remote control), and features which don't apply to all devices (like shuffle and repeat). Regarding media metadata, Chromecast's MediaMetadata object provides some prior art here which attempts to cover various metadata for music, TV, movies and eBooks. Also schema.org has a whole collection of MediaObject schemas which address this area including
That is certainly one solution to the problem, but could be quite limiting. What do other people think? Is it better to have a single generic string, or keep media metadata out of the schema altogether? My instinct here is to remove This would answer my question 4, but probably at least questions 1-3 still need an answer before we can land this schema. If there's no generic answer to question 2 (How do you tell a media player device what to play?) that's fine, but the schema will only be useful for controlling a media player which is already playing back some media, having initiated playback from some other physical control interface or software application. This is similar to how you can use a TV remote to control playback on a TV streaming stick like a Chromecast via CEC over HDMI, but have to use a separate app to select what to play. |
My favorite way to select what to stream is how the Internet Radio add-on does it. It has example free media streams and you can configure more of your own, delete what is there, etc. The biggest hurdle for users will be figuring out the exact URLs to add. But I suppose a wiki page could be maintained, or an add-on could hyperlink to a list of known and popular audio streams. Or those aspects could be configured via a "Faceplate" UI as described in some other thread by madbilly. The Sonos play URI action is better than nothing, but I don't have the URLs handy that I need to insert if I want to change the stream, so I use the Sonos app for changing the input stream instead. I wonder if a rule could be created to feed input streams into that play URI action... and if so, what that input thing would be. |
A "search input" property might make sense? But then you get people like me who would like to select a file to play. Some people may want to play a URL. So perhaps the bigger question is: is this stuff intended to be a UI, or an API for a real UI? If it's supposed to describe all possible UI components, where does it stop (a sentiment Ben expressed earlier). Add a playlist property? If it should just describe the current state of a separate device that is playing music, then you get closer to the current spec. So in my view a UI extension addon would be the media player, and this addon may have a thing representing it which can be used to hook things into. E.g. create rules, do voice queries, or allow a remote control device to control the player. For example, I've been meaning to add a real UI to the internet radio addon, where users can search for radio stations, and keep their favourites.
Make it an enum and add |
I like the idea that I would be able to do more with my entertainment things. Right now I play or not, and change the volume. But if I could set the source easily, via rules, voice, buttons, etc., that would be cool. |
I know it's hard not to conflate the two, but this issue is just about the schema design at the API level which could theoretically be used by any Web of Things implementation. It should not be specific to WebThings or WebThings Gateway (like the schemas at schema.org and iotschema.org). WebThingsIO/gateway#1628 is about an implementation of this schema in WebThings Gateway and what the default user interface should be for a web thing which uses the I've drafted a tweaked proposal below which I've tried to cut down to the lowest common denominator for all media players, and answer the questions I asked above. This continues to be tricky and I'm still not completely happy with this. MediaPlayerA device that plays audio or video. Propertiesnull
Note: Actions
VolumePropertyThe current volume of audio being played.
PlayingPropertyWhether or not audio or video media is currently being played.
Note: If no media title is currently loaded, ProgressPropertyThe progress towards completion of a long-running task.
PlayingMediaTitlePropertyThe title of a piece of media currently being played by a media player. (e.g. the title and artist of a song or the title of a movie).
PlayingMediaLengthPropertyThe total length of a piece of media currently being played by a media player.
MutedProperty
StopActionStops playback of media. inputNone. PreviousActionPlays the previous item in the playback queue. inputNone. NextActionPlays the next item in the playback queue. inputNone. I've made the following changes:
There is currently no solution to question 2 (how to tell a device what to play), which is currently left to an external physical or virtual user interface as there's no obvious common solution for all types of media player. Note that none of this prevents the authors of web things from adding properties for any of those that I've removed above, they're just not part of the generic schema. Footnotes:
|
Looks good. Some small thoughts:
|
Perhaps a practical case: right now I'd love to be able to let the user select which device in their home network should play a "ding dong" sound then someone is at their door. Similarly, it could be nice to let users select which device in their home should play a radio stream. Or which devices should play an alarm sound when there's a fire. I do also realise that sending a file to a device to play may not always work. It assumed that endpoints can handle these requests. E.g. to play an MP3 file or radio stream, a device must be able to play mp3 files. |
@flatsiedatsie wrote:
This is intentional, the
I agree it would be cool.
This is the problem - most existing devices probably wouldn't support this feature. I'm going to take a look at existing APIs in the HTML and Remote Playback specifications to see whether there are any useful patterns that could be followed. |
No description provided.
The text was updated successfully, but these errors were encountered: