Firefox OS/Vaani/Music: Difference between revisions
(→Schema) |
(→Schema) |
||
Line 28: | Line 28: | ||
=== Schema === | === Schema === | ||
==== Play music ==== | |||
For an app who wants to support '''Play music''', it should declare the following action at its JSON-LD data: | For an app who wants to support '''Play music''', it should declare the following action at its JSON-LD data: | ||
Line 51: | Line 51: | ||
} | } | ||
==== Stop ==== | |||
"custom_commands": [{ | "custom_commands": [{ | ||
Line 67: | Line 67: | ||
==== Pause ==== | |||
"custom_commands": [{ | "custom_commands": [{ | ||
Line 82: | Line 82: | ||
}] | }] | ||
==== Previous / Next ==== | |||
"custom_commands": [{ | "custom_commands": [{ | ||
Line 112: | Line 112: | ||
}] | }] | ||
==== Who is the artist / What album is this ==== | |||
If we want to query "Who is the artist", we may send a '''SearchAction''' with object equal to '''MusicGroup''' and without query to query the artist of current playing. If we want to query "What album is this", we may send a '''SearchAction''' with object equal to '''MusicAlbum''' and without query to query the album of current playing. | If we want to query "Who is the artist", we may send a '''SearchAction''' with object equal to '''MusicGroup''' and without query to query the artist of current playing. If we want to query "What album is this", we may send a '''SearchAction''' with object equal to '''MusicAlbum''' and without query to query the album of current playing. |
Revision as of 09:42, 5 August 2015
Design:
Proposal 1
Vaani will connect to music-controller IAC while Vaani receives a control commands, play, stop, pause, resume, previous, or next. No matter music app is opened or not, Vaani will open or connect to it at background and sends command to music app. Unlike mediacomms at system app, system app waits for playing state change to activate media widget at utility tray or lockscreen. Vaani uses music-controller in active mode.
In our UX spec, Vaani will send the following messages to music:
- if music is playing
- to play next song
- to play previous song
- to play all
- to stop/pause playing
- to resume playing
- who is artist (out of scope)
- what album is this (out of scope)
Music widget at Vaani
We will write a UI at Vaani to have music control widget. The state and information on top of it are updated with the change event through IAC.
Commands & Protocols
Extended schemata
1. Thing > Action > ControlAction > StopAction
2. Thing > Action > ControlAction > SkipForwardAction
3. Thing > Action > ControlAction > SkipBackwardAction
Schema
Play music
For an app who wants to support Play music, it should declare the following action at its JSON-LD data:
"custom_commands": [{ "@context": "http://schema.org", "@type": "ListenAction", "target": { "@type": "EntryPoint", "urlTemplate": “iac://music-controller", "actionApplication": { "@type": "SoftwareApplication", "operatingSystem": “Firefox OS" } } }]
While handling it, music app will receive a ListenAction through IAC. The message may look like:
{ "@context": "http://schema.org", "@type": "ListenAction" }
Stop
"custom_commands": [{ "@context": "http://url-to-extended-schema", "@type": "StopAction", "target": { "@type": "EntryPoint", "urlTemplate": “iac://music-controller", "actionApplication": { "@type": "SoftwareApplication", "operatingSystem": “Firefox OS" } } }]
Pause
"custom_commands": [{ "@context": "http://schema.org", "@type": "SuspendAction", "target": { "@type": "EntryPoint", "urlTemplate": “iac://music-controller", "actionApplication": { "@type": "SoftwareApplication", "operatingSystem": “Firefox OS" } } }]
Previous / Next
"custom_commands": [{ "@context": "http://url-to-extended-schema", "@type": "SkipForwardAction", "direction": @direction "target": { "@type": "EntryPoint", "urlTemplate": “iac://music-controller", "actionApplication": { "@type": "SoftwareApplication", "operatingSystem": “Firefox OS" } } }]
"custom_commands": [{ "@context": "http://url-to-extended-schema", "@type": "SkipBackwardAction", "direction": @direction "target": { "@type": "EntryPoint", "urlTemplate": “iac://music-controller", "actionApplication": { "@type": "SoftwareApplication", "operatingSystem": “Firefox OS" } } }]
Who is the artist / What album is this
If we want to query "Who is the artist", we may send a SearchAction with object equal to MusicGroup and without query to query the artist of current playing. If we want to query "What album is this", we may send a SearchAction with object equal to MusicAlbum and without query to query the album of current playing.
"custom_commands": [{ "@context": "http://schema.org/", "@type": "SearchAction", "object": ["MusicGroup", "MusicAlbum"], "target": { "@type": "EntryPoint", "urlTemplate": “iac://music-controller", "actionApplication": { "@type": "SoftwareApplication", "operatingSystem": “Firefox OS" } } }]
FAQ
Where to have the apps expose its actions ?
TBD
Lacking:
Discussion
1. with kelly, reza
2. with media team
3. confirm syntax schema.org
4. new IAC connection (will become Vaani API)