Firefox OS/Vaani/Music

From MozillaWiki
< Firefox OS
Revision as of 03:59, 5 August 2015 by GuanWen (talk | contribs) (update commands & protocols 0805)
Jump to navigation Jump to search

Music

Design:

Proposal 1

Vaani-music-iac-proposal1.png

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 property

PlayAction

Property Expected Type Description
Direction Text Play direction. (Previous/Next)

Schema

1. Play music

     "custom_commands": [{
       "@context": "http://schema.org",
       "@type": "ListenAction",
       "target": {
         "@type": "IAC",
         "name": "music-controller",
       }
     }]


2. Stop

     "custom_commands": [{
       "@context": "http://url-to-extended-schema",
       "@type": "StopAction",
       "target": {
         "@type": "IAC",
         "name": "music-controller",
       }
     }]


3. Pause

     "custom_commands": [{
       "@context": "http://schema.org",
       "@type": "SuspendAction",
       "target": {
         "@type": "IAC",
         "name": "music-controller",
       }
     }]

4. Previous / Next

     "custom_commands": [{
       "@context": "http://url-to-extended-schema",
       "@type": "SkipForwardAction",
       "direction": @direction
       "target": {
         "@type": "IAC",
         "name": "music-controller",
       }
     }]
     "custom_commands": [{
       "@context": "http://url-to-extended-schema",
       "@type": "SkipBackwardAction",
       "direction": @direction
       "target": {
         "@type": "IAC",
         "name": "music-controller",
       }
     }]

5. Who is the artist / What album is this

     "custom_commands": [{
       "@context": "http://schema.org/AskAction",
       "@type": "AskAction",
       "object": "Question",
       "target": {
         "@type": "IAC",
         "name": "music-controller",
         "data": {
           "type": "@queryItem"
         }
       }
     }]

Lacking:

Discussion

1. with kelly, reza
2. with media team
3. confirm syntax schema.org
4. new IAC connection (will become Vaani API)