kibio / kibio.github.io

The kibio website.
http://kib.io
0 stars 2 forks source link

Media Library / Playlist JSON scheme #8

Open bakercp opened 11 years ago

bakercp commented 11 years ago

Upon connecting to the websocket, a new client will receive the following:

{
    "message-id": INCREMENTAL_MESSAGE_ID, // generated by the server
    "command": "new-medialibrary",
    "data": {
        "assets": [
            {            
                uuid: UNIQUE_ASSET_ID,
//                title: "Title",
                file-name: "MyFile.mkv",
                duration: "Seconds",
                number-of-frames: 100 // optional
                type: "VIDEO", // VIDEO, IMAGE, SOUND,
                playcount:111,
                size: { width: 320, height:240 } // optional
                poster:base64:posterFrame,//base64 encoded poster frame
            }       

...
            {            
                uuid: UNIQUE_ASSET_ID,
                title: "Title",
                file-name: "MyFile.mkv",
                duration: "Seconds",
                number-of-frames: 100 // optional
                type: "VIDEO", // VIDEO, IMAGE, SOUND,
                playcount:111,
                size: { width: 320, height:240 } // optional
                poster:base64:posterFrame,//base64 encoded poster frame
            }            

        ]

     }
}
{
    "message-id": INCREMENTAL_MESSAGE_ID, // generated by the server
    "command": "new-playlist",
    "data": {
        "playlist-name":12345
        "playlist-uuid":12345
        "playlist-loop-mode:"LOOP",
        "playlist-repeat:"LOOP",
        "playlist-items": [  // position is implied
               {
                playlist-item-uuid:UNIQUE_ASSET_ID,
                mask-uuid:123
                ...
                }
          ]
      }
}
yyolk commented 11 years ago

will implement to receive on page load for testing