Firefox OS/Vaani/Music: Difference between revisions

Jump to navigation Jump to search
no edit summary
(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 / Next ====
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": "SkipForwardAction",
         "@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": "SkipBackwardAction",
         "@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 PlayAction or ListenAction for "Play Music" command ? ==
== Use ListenAction for "Play Music" command ? ==
When we say "Play Music" to Vaani, what is the meaning ? Does it mean "we" want to "listen" a song or want "Vaani" to "play" a song ? The problem is how do we define this command ? "Who" should do the action for "play music".
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 ?


= Lacking: =
== Discussion ==
1. with kelly, reza<br>
2. with media team<br>
3. confirm syntax schema.org<br>
4. new IAC connection (will become Vaani API)<br>


= 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
110

edits

Navigation menu