by Dr. Patrick Bartsch 2013-2016
version: v1.5.3-W3C
This repo holds all media related resources
Table of contents
General information
version: 1.5.3-W3C
Repository:
Author
Dr. Patrick Bartsch <patrick.bartsch@volkswagen.de>
Resources
/media/collections/
The media collections can also be understood as media queues of the renderer. Media collections can only contain playable media like tracks, videos or pictures.
mediaCollectionObject
Properties
name | description | type | format | unit(s) | value(s) |
---|---|---|---|---|---|
id | collection id | string | uuid | - | |
name | collection name | string | - | ||
uri | object uri | string | uri | - | |
items | media collection items | array | /media/items/itemObject |
Resource level access (/media/collections/)
POST
Note: Use a http POST request on /media/collections/ to create a new element of type mediaCollectionObject
Subscribe to /media/collections/ to receive updates for element creations or removals from the collection.
Request parameters
The following parameters can be used with the request and subscriptions:
name | type | format | mandatory |
---|---|---|---|
name | string | no | |
items | array | yes |
Request/response example
POST /media/collections/ HTTP/1.1
Host: 127.0.0.1:9000
Connection: keep-alive
Accept: application/json
User-Agent: Chrome/34.0.1847.137 Safari/537.36
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8,de;q=0.6
{
"viwi": "rockz.."
}
=>
HTTP/1.1 201 Created
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
ETag: "-32550834"
Content-Encoding: gzip
Date: Tue, 07 Apr 1980 00:00:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked
Location: /media/collections/3901a278-ba17-44d6-9aef-f7ca67c04840
{
"status": "ok"
}
GET
Note: Use a http GET request on /media/collections/ to retrieve a list of available elements of type mediaCollectionObject
Subscribe to /media/collections/ to receive updates for element creations or removals from the collection.
Request/response example
GET /media/collections/ HTTP/1.1
Host: 127.0.0.1:9000
Connection: keep-alive
Accept: application/json
User-Agent: Chrome/34.0.1847.137 Safari/537.36
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8,de;q=0.6
=>
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
ETag: "-32550834"
Content-Encoding: gzip
Date: Tue, 07 Apr 1980 00:00:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked
{
"status": "ok",
"data": [
{
"id": "3901a278-ba17-44d6-9aef-f7ca67c04840",
"name": "lorem ipsum",
"uri": "/media/collections/3901a278-ba17-44d6-9aef-f7ca67c04840"
},
{
"id": "8901870-b526-11e3-a5e2-0800200c9a66",
"name": "dolor sit",
"uri": "/media/collections/8901870-b526-11e3-a5e2-0800200c9a66"
}
]
}
Element level access (/media/collections/:uuid)
POST
Note:
Use a http POST request on /media/collections/:uuid to update a particular mediaCollectionObject
Subscribe to /media/collections/:uuid to receive updates on element level changes.
Request parameters
The following parameters can be used with the request and subscriptions:
name | type | mandatory |
---|---|---|
name | string | no |
items | array | no |
Request/response example
POST /media/collections/3901a278-ba17-44d6-9aef-f7ca67c04840 HTTP/1.1
Host: 127.0.0.1:9000
Connection: keep-alive
Accept: application/json
User-Agent: Chrome/34.0.1847.137 Safari/537.36
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8,de;q=0.6
{
"viwi": "rockz.."
}
HTTP/1.1 201 Created
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
ETag: "-32550834"
Content-Encoding: gzip
Date: Tue, 07 Apr 1980 00:00:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked
{
"status": "ok"
}
GET
Note:
Use a http GET request on /media/collections/:uuid to retrieve a particular mediaCollectionObject
Subscribe to /media/collections/:uuid to receive updates on element level changes.
Request/response example
GET /media/collections/3901a278-ba17-44d6-9aef-f7ca67c04840 HTTP/1.1
Host: 127.0.0.1:9000
Connection: keep-alive
Accept: application/json
User-Agent: Chrome/34.0.1847.137 Safari/537.36
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8,de;q=0.6
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
ETag: "-32550834"
Content-Encoding: gzip
Date: Tue, 07 Apr 1980 00:00:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked
{
"status": "ok",
"data": [
{
"id": "3901a278-ba17-44d6-9aef-f7ca67c04840",
"name": "lorem ipsum",
"uri": "/media/collections/3901a278-ba17-44d6-9aef-f7ca67c04840"
}
]
}
DELETE
Note:
Use a http DELETE request on /media/collections/:uuid to update a particular mediaCollectionObject
Subscribe to /media/collections/:uuid to receive updates on element level changes.
Request/response example
DELETE /media/collections/3901a278-ba17-44d6-9aef-f7ca67c04840 HTTP/1.1
Host: 127.0.0.1:9000
Connection: keep-alive
Accept: application/json
User-Agent: Chrome/34.0.1847.137 Safari/537.36
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8,de;q=0.6
HTTP/1.1 201 Created
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
ETag: "-32550834"
Content-Encoding: gzip
Date: Tue, 07 Apr 1980 00:00:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked
{
"status": "ok"
}
Events
The following events may be fired by client interaction or system side:
- /media/collections/ (resource level)
- /media/collections/:uuid (element level)
/media/renderers/
The media player renderer can be understood as the actual media player. It accepts media objects and applies actions like play, pause etc. to them.
rendererObject
Properties
name | description | type | format | unit(s) | value(s) |
---|---|---|---|---|---|
id | renderer id | string | uuid | - | |
name | renderer name | string | - | ||
uri | object uri | string | uri | - | |
media | current media collection | object | /media/collections/mediaCollectionObject | ||
currentMediaItem | the media item currently being renderered. | object | /media/items/itemObject | ||
scan | shuffle mode | string | off up down |
||
offset | current offset | integer | ms | [-inf..inf] | |
state | media renderers playback state | string | idle play pause stop ff fr |
||
repeat | repeat mode | string | off repeatall repeatone |
||
shuffle | shuffle mode | string | on off |
||
type | type of medium | string | track video image |
Resource level access (/media/renderers/)
GET
Note: Use a http GET request on /media/renderers/ to retrieve a list of available elements of type rendererObject
Subscribe to /media/renderers/ to receive updates for element creations or removals from the collection.
Request/response example
GET /media/renderers/ HTTP/1.1
Host: 127.0.0.1:9000
Connection: keep-alive
Accept: application/json
User-Agent: Chrome/34.0.1847.137 Safari/537.36
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8,de;q=0.6
=>
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
ETag: "-32550834"
Content-Encoding: gzip
Date: Tue, 07 Apr 1980 00:00:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked
{
"status": "ok",
"data": [
{
"id": "3901a278-ba17-44d6-9aef-f7ca67c04840",
"name": "lorem ipsum",
"uri": "/media/renderers/3901a278-ba17-44d6-9aef-f7ca67c04840"
},
{
"id": "8901870-b526-11e3-a5e2-0800200c9a66",
"name": "dolor sit",
"uri": "/media/renderers/8901870-b526-11e3-a5e2-0800200c9a66"
}
]
}
Element level access (/media/renderers/:uuid)
POST
Note:
Use a http POST request on /media/renderers/:uuid to update a particular rendererObject
Subscribe to /media/renderers/:uuid to receive updates on element level changes.
Request parameters
The following parameters can be used with the request and subscriptions:
name | type | mandatory |
---|---|---|
media | string | no |
currentMediaItem | string | no |
offset | integer | no |
state | string | no |
repeat | string | no |
shuffle | string | no |
scan | string | no |
Request/response example
POST /media/renderers/3901a278-ba17-44d6-9aef-f7ca67c04840 HTTP/1.1
Host: 127.0.0.1:9000
Connection: keep-alive
Accept: application/json
User-Agent: Chrome/34.0.1847.137 Safari/537.36
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8,de;q=0.6
{
"viwi": "rockz.."
}
HTTP/1.1 201 Created
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
ETag: "-32550834"
Content-Encoding: gzip
Date: Tue, 07 Apr 1980 00:00:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked
{
"status": "ok"
}
GET
Note:
Use a http GET request on /media/renderers/:uuid to retrieve a particular rendererObject
Subscribe to /media/renderers/:uuid to receive updates on element level changes.
Request/response example
GET /media/renderers/3901a278-ba17-44d6-9aef-f7ca67c04840 HTTP/1.1
Host: 127.0.0.1:9000
Connection: keep-alive
Accept: application/json
User-Agent: Chrome/34.0.1847.137 Safari/537.36
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8,de;q=0.6
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
ETag: "-32550834"
Content-Encoding: gzip
Date: Tue, 07 Apr 1980 00:00:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked
{
"status": "ok",
"data": [
{
"id": "3901a278-ba17-44d6-9aef-f7ca67c04840",
"name": "lorem ipsum",
"uri": "/media/renderers/3901a278-ba17-44d6-9aef-f7ca67c04840"
}
]
}
Events
The following events may be fired by client interaction or system side:
- /media/renderers/:uuid (element level)
- /media/renderers/ (resource level)
/media/items/
Items are an indirection to allow adding multiple simliar media items to collections. The indirection allows deletion addition from/ro collections on a per item basis. The order of items within a collection is expressed through the collections endpoint.
itemObject
Properties
name | description | type | format | unit(s) | value(s) |
---|---|---|---|---|---|
id | identifier | string | uuid | - | |
name | shown name | string | - | ||
uri | object uri | string | uri | - | |
collection | the collection the element is associated with | object | /media/collections/collectionObject | ||
renderable | the referenced renderable item | object | /medialibrary/videos/videoObject |
Resource level access (/media/items/)
GET
Note: Use a http GET request on /media/items/ to retrieve a list of available elements of type itemObject
Subscribe to /media/items/ to receive updates for element creations or removals from the collection.
Request/response example
GET /media/items/ HTTP/1.1
Host: 127.0.0.1:9000
Connection: keep-alive
Accept: application/json
User-Agent: Chrome/34.0.1847.137 Safari/537.36
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8,de;q=0.6
=>
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
ETag: "-32550834"
Content-Encoding: gzip
Date: Tue, 07 Apr 1980 00:00:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked
{
"status": "ok",
"data": [
{
"id": "3901a278-ba17-44d6-9aef-f7ca67c04840",
"name": "lorem ipsum",
"uri": "/media/items/3901a278-ba17-44d6-9aef-f7ca67c04840"
},
{
"id": "8901870-b526-11e3-a5e2-0800200c9a66",
"name": "dolor sit",
"uri": "/media/items/8901870-b526-11e3-a5e2-0800200c9a66"
}
]
}
POST
Note: Use a http POST request on /media/items/ to create a new element of type itemObject
Subscribe to /media/items/ to receive updates for element creations or removals from the collection.
Request parameters
The following parameters can be used with the request and subscriptions:
name | type | format | mandatory |
---|---|---|---|
collection | string | uri | yes |
renderable | string | uri | yes |
Request/response example
POST /media/items/ HTTP/1.1
Host: 127.0.0.1:9000
Connection: keep-alive
Accept: application/json
User-Agent: Chrome/34.0.1847.137 Safari/537.36
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8,de;q=0.6
{
"viwi": "rockz.."
}
=>
HTTP/1.1 201 Created
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
ETag: "-32550834"
Content-Encoding: gzip
Date: Tue, 07 Apr 1980 00:00:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked
Location: /media/items/3901a278-ba17-44d6-9aef-f7ca67c04840
{
"status": "ok"
}
Element level access (/media/items/:uuid)
GET
Note:
Use a http GET request on /media/items/:uuid to retrieve a particular itemObject
Subscribe to /media/items/:uuid to receive updates on element level changes.
Request/response example
GET /media/items/3901a278-ba17-44d6-9aef-f7ca67c04840 HTTP/1.1
Host: 127.0.0.1:9000
Connection: keep-alive
Accept: application/json
User-Agent: Chrome/34.0.1847.137 Safari/537.36
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8,de;q=0.6
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
ETag: "-32550834"
Content-Encoding: gzip
Date: Tue, 07 Apr 1980 00:00:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked
{
"status": "ok",
"data": [
{
"id": "3901a278-ba17-44d6-9aef-f7ca67c04840",
"name": "lorem ipsum",
"uri": "/media/items/3901a278-ba17-44d6-9aef-f7ca67c04840"
}
]
}
POST
Note:
Use a http POST request on /media/items/:uuid to update a particular itemObject
Subscribe to /media/items/:uuid to receive updates on element level changes.
Request parameters
The following parameters can be used with the request and subscriptions:
name | type | mandatory |
---|---|---|
renderable | string | no |
collection | string | no |
Request/response example
POST /media/items/3901a278-ba17-44d6-9aef-f7ca67c04840 HTTP/1.1
Host: 127.0.0.1:9000
Connection: keep-alive
Accept: application/json
User-Agent: Chrome/34.0.1847.137 Safari/537.36
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8,de;q=0.6
{
"viwi": "rockz.."
}
HTTP/1.1 201 Created
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
ETag: "-32550834"
Content-Encoding: gzip
Date: Tue, 07 Apr 1980 00:00:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked
{
"status": "ok"
}
Events
The following events may be fired by client interaction or system side:
- /media/items/ (resource level)