110
edits
No edit summary |
|||
| Line 38: | Line 38: | ||
== Proposal 1: JSON-LD in manifest == | == Proposal 1: JSON-LD in manifest == | ||
=== ListenAction === | |||
"custom_commands": [{ | "custom_commands": [{ | ||
| Line 51: | Line 52: | ||
} | } | ||
}] | }] | ||
=== StopAction === | |||
== | "custom_commands": [{ | ||
"@context": "http://url-to-extended-schema", | |||
"@type": "StopAction", | |||
"target": { | |||
"@type": "EntryPoint", | |||
"urlTemplate": “iac://music-controller", | |||
"actionApplication": { | |||
"@type": "SoftwareApplication", | |||
"operatingSystem": “Firefox OS" | |||
} | |||
} | |||
}] | |||
=== SuspendAction === | |||
"custom_commands": [{ | |||
"@context": "http://schema.org", | |||
"@type": "SuspendAction", | |||
"target": { | |||
"@type": "EntryPoint", | |||
"urlTemplate": “iac://music-controller", | |||
"actionApplication": { | |||
"@type": "SoftwareApplication", | |||
"operatingSystem": “Firefox OS" | |||
} | |||
} | |||
}] | |||
=== SkipBackwardAction === | |||
"custom_commands": [{ | |||
" | "@context": "http://url-to-extended-schema", | ||
" | "@type": "SkipBackwardAction", | ||
" | "target": { | ||
"@type": "EntryPoint", | |||
"urlTemplate": “iac://music-controller", | |||
"actionApplication": { | |||
"@type": "SoftwareApplication", | |||
"operatingSystem": “Firefox OS" | |||
} | |||
} | |||
}] | }] | ||
= | === SkipForwardAction === | ||
"custom_commands": [{ | |||
"@context": "http://url-to-extended-schema", | |||
"@type": "SkipForwardAction", | |||
"target": { | |||
"@type": "EntryPoint", | |||
"urlTemplate": “iac://music-controller", | |||
"actionApplication": { | |||
"@type": "SoftwareApplication", | |||
"operatingSystem": “Firefox OS" | |||
} | |||
} | |||
}] | |||
== | === SearchAction === | ||
"custom_commands": [{ | "custom_commands": [{ | ||
"@context": "http://schema.org", | "@context": "http://schema.org/", | ||
"@type": " | "@type": "SearchAction", | ||
"object": ["MusicGroup", "MusicAlbum"], | |||
"target": { | "target": { | ||
"@type": "EntryPoint", | "@type": "EntryPoint", | ||
| Line 82: | Line 128: | ||
}] | }] | ||
== 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 handle the '''ListenAction'''. Music app will receive a '''ListenAction''' through IAC. The message may look like: | |||
{ | { | ||
| Line 93: | Line 154: | ||
{ | { | ||
"@context": "http://schema.org", | "@context": "http://schema.org", | ||
"@type": "ListenAction" | "@type": "ListenAction", | ||
"actionStatus": "CompletedActionStatus" | "FailedActionStatus" | "actionStatus": "CompletedActionStatus" | "FailedActionStatus" | ||
} | } | ||
== Stop == | == Stop == | ||
For an app who wants to support '''Stop''' | For an app who wants to support '''Stop''', it should handle the '''StopAction'''. Music app will receive a '''StopAction''' through IAC. The message may look like: | ||
{ | { | ||
| Line 130: | Line 176: | ||
== Pause == | == Pause == | ||
For an app who wants to support '''Pause''' | For an app who wants to support '''Pause''', it should handle the '''SuspendAction'''. Music app will receive a '''SuspendAction''' through IAC. The message may look like: | ||
{ | { | ||
| Line 162: | Line 193: | ||
== Previous == | == Previous == | ||
For an app who wants to support '''Previous''' command, it should | For an app who wants to support '''Previous''' command, it should handle the '''SkipBackwardAction'''. Music app will receive a '''SkipBackwardAction''' through IAC. The message may look like: | ||
{ | { | ||
| Line 195: | Line 210: | ||
== Next == | == Next == | ||
For an app who wants to support '''Next''' command, it should | For an app who wants to support '''Next''' command, it should handle the '''SkipForwardAction'''. Music app will receive a '''SkipForwardAction''' through IAC. The message may look like: | ||
{ | { | ||
| Line 223: | Line 222: | ||
{ | { | ||
"@context": "http://schema.org", | "@context": "http://schema.org", | ||
"@type": "SkipForwardAction" | "@type": "SkipForwardAction", | ||
"actionStatus": "CompletedActionStatus" | "FailedActionStatus" | "actionStatus": "CompletedActionStatus" | "FailedActionStatus" | ||
} | } | ||
| Line 230: | Line 229: | ||
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. | ||
While handling it, music app will receive a SearchAction through IAC. The message may look like: | While handling it, music app will receive a SearchAction through IAC. The message may look like: | ||
| Line 259: | Line 243: | ||
"@context": "http://schema.org", | "@context": "http://schema.org", | ||
"@type": "SearchAction" | "@type": "SearchAction" | ||
"actionStatus": CompletedActionStatus | FailedActionStatus | "actionStatus": "CompletedActionStatus" | "FailedActionStatus", | ||
"result": [{ | "result": [{ | ||
@type: "MusicGroup", | @type: "MusicGroup", | ||
edits