Firefox OS/Vaani/Music: Difference between revisions

Line 21: Line 21:


= Commands & Protocols =
= Commands & Protocols =
= Supported commands =
* Play
* Pause
...
== Extended schemata ==
== Extended schemata ==


Line 29: Line 36:
# Thing > Action > ControlAction > SkipBackwardAction
# Thing > Action > ControlAction > SkipBackwardAction


== Schema ==
 
=== Play music ===
== Proposal 1: JSON-LD in manifest ==
 
    "custom_commands": [{
        "@context": "http://schema.org",
        "@type": "ListenAction",
        "target": {
          "@type": "EntryPoint",
          "urlTemplate": “iac://music-controller",
          "actionApplication": {
            "@type": "SoftwareApplication",
            "operatingSystem": “Firefox OS"
          }
        }
      }]
 
== Proposal 2: not JSON-LD ==
 
An app who supports custom command should put the following section in manifest.webapp
 
    "custom_commands": [{
        "channel": "media-controller",
        "(optional)name": "Music Player",
        "(optional)description": "Control your music playing with voice",
        "launch-path": "index.html",
        "supported-action": ["PlayAction", "StopAction"]
      }]
 
= Protocols for each command =
 
== 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 61: Line 97:
       }
       }


=== Stop ===
== Stop ==
For an app who wants to support '''Stop''' command, it should declare the following action at its JSON-LD data :
For an app who wants to support '''Stop''' command, it should declare the following action at its JSON-LD data :


Line 93: Line 129:
       }
       }


=== Pause ===
== Pause ==
For an app who wants to support '''Pause''' command, it should declare the following action at its JSON-LD data :
For an app who wants to support '''Pause''' command, it should declare the following action at its JSON-LD data :


Line 125: Line 161:
       }
       }


=== Previous ===
== Previous ==
For an app who wants to support '''Previous''' command, it should declare the following action at its JSON-LD data :
For an app who wants to support '''Previous''' command, it should declare the following action at its JSON-LD data :


Line 158: Line 194:
       }
       }


=== Next ===
== Next ==
For an app who wants to support '''Next''' command, it should declare the following action at its JSON-LD data :
For an app who wants to support '''Next''' command, it should declare the following action at its JSON-LD data :


Line 191: Line 227:
       }
       }


=== Who is the artist / What album is this ===
== 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.
Confirmed users
209

edits