110
edits
(Update FAQ) |
No edit summary |
||
Line 53: | Line 53: | ||
"@type": "ListenAction" | "@type": "ListenAction" | ||
} | } | ||
And the app have to send back a message like: | |||
{ | |||
"@context": "http://schema.org", | |||
"@type": "ListenAction" | |||
actionStatus: CompletedActionStatus | FailedActionStatus | |||
object: { | |||
@type: "MusicRecording", | |||
name: "Song name", | |||
inAlbum: { | |||
@type: "MusicAlbum" | |||
image: "Album cover" | |||
} | |||
} | |||
} | |||
==== Stop ==== | ==== Stop ==== | ||
For an app who wants to support '''Stop''' command, it should declare the following action at its JSON-LD data : | |||
"custom_commands": [{ | "custom_commands": [{ | ||
Line 68: | Line 86: | ||
} | } | ||
}] | }] | ||
While handling it, music app will receive a StopAction through IAC. The message may look like: | |||
{ | |||
"@context": "http://schema.org", | |||
"@type": "StopAction" | |||
} | |||
And the app have to send back a message like: | |||
{ | |||
"@context": "http://schema.org", | |||
"@type": "StopAction" | |||
actionStatus: CompletedActionStatus | FailedActionStatus | |||
} | |||
==== Pause ==== | ==== Pause ==== | ||
For an app who wants to support '''Pause''' command, it should declare the following action at its JSON-LD data : | |||
"custom_commands": [{ | "custom_commands": [{ | ||
Line 85: | Line 120: | ||
}] | }] | ||
==== Previous | While handling it, music app will receive a SuspendAction through IAC. The message may look like: | ||
{ | |||
"@context": "http://schema.org", | |||
"@type": "SuspendAction" | |||
} | |||
And the app have to send back a message like: | |||
{ | |||
"@context": "http://schema.org", | |||
"@type": "SuspendAction" | |||
actionStatus: CompletedActionStatus | FailedActionStatus | |||
} | |||
==== Previous ==== | |||
For an app who wants to support '''Previous''' command, it should declare the following action at its JSON-LD data : | |||
"custom_commands": [{ | "custom_commands": [{ | ||
"@context": "http://url-to-extended-schema", | "@context": "http://url-to-extended-schema", | ||
"@type": " | "@type": "SkipBackwardAction", | ||
"direction": @direction | "direction": @direction | ||
"target": { | "target": { | ||
Line 100: | Line 153: | ||
} | } | ||
}] | }] | ||
While handling it, music app will receive a SkipBackwardAction through IAC. The message may look like: | |||
{ | |||
"@context": "http://schema.org", | |||
"@type": "SkipBackwardAction" | |||
} | |||
And the app have to send back a message like: | |||
{ | |||
"@context": "http://schema.org", | |||
"@type": "SkipBackwardAction" | |||
actionStatus: CompletedActionStatus | FailedActionStatus | |||
} | |||
==== Next ==== | |||
For an app who wants to support '''Next''' command, it should declare the following action at its JSON-LD data : | |||
"custom_commands": [{ | "custom_commands": [{ | ||
"@context": "http://url-to-extended-schema", | "@context": "http://url-to-extended-schema", | ||
"@type": " | "@type": "SkipForwardAction", | ||
"direction": @direction | "direction": @direction | ||
"target": { | "target": { | ||
Line 114: | Line 188: | ||
} | } | ||
}] | }] | ||
While handling it, music app will receive a SkipForwardAction through IAC. The message may look like: | |||
{ | |||
"@context": "http://schema.org", | |||
"@type": "SkipForwardAction" | |||
} | |||
And the app have to send back a message like: | |||
{ | |||
"@context": "http://schema.org", | |||
"@type": "SkipForwardAction" | |||
actionStatus: CompletedActionStatus | FailedActionStatus | |||
object: { | |||
@type: "MusicRecording", | |||
name: "Song name", | |||
inAlbum: { | |||
@type: "MusicAlbum" | |||
image: "Album cover" | |||
} | |||
} | |||
} | |||
==== Who is the artist / What album is this ==== | ==== Who is the artist / What album is this ==== | ||
Line 132: | Line 232: | ||
} | } | ||
}] | }] | ||
While handling it, music app will receive a SearchAction through IAC. The message may look like: | |||
{ | |||
"@context": "http://schema.org", | |||
"@type": "SearchAction" | |||
"object": ["MusicGroup", "MusicAlbum"], | |||
} | |||
And the app have to send back a message like: | |||
{ | |||
"@context": "http://schema.org", | |||
"@type": "ListenAction" | |||
actionStatus: CompletedActionStatus | FailedActionStatus | |||
object: { | |||
@type: "MusicGroup" | "MusicAlbum", | |||
name: "Group name" | "Album name", | |||
} | |||
} | |||
= FAQ = | = FAQ = | ||
Line 138: | Line 260: | ||
There is a bug[2] about JSON-LD and "pin the web" feature is also use JSON-LD, we should discuss with them. | There is a bug[2] about JSON-LD and "pin the web" feature is also use JSON-LD, we should discuss with them. | ||
== Use | == Use ListenAction for "Play Music" command ? == | ||
For the control actions like pause for SuspendAction, Stop for StopAction we have our all actions under ControlAction. Should we make the action of "Play Music" under ControlAction too ? | |||
= Reference = | = Reference = | ||
[1] https://developers.google.com/schemas/tutorials/embedding-schemas-in-emails | [1] https://developers.google.com/schemas/tutorials/embedding-schemas-in-emails | ||
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1178491 | [2] https://bugzilla.mozilla.org/show_bug.cgi?id=1178491 |
edits