mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-01 18:57:24 +00:00
Adds the playback manifest endpoint
This commit is contained in:
1 parent
7dc5953e1d
commit
d7c1ae60c2
17 files changed
+993
-10
No files matched your search
@@ -11,6 +11,9 @@
|
||||
- [Stream Track](#stream-track)
|
||||
- [Stream Track Request](#stream-track-request)
|
||||
- [Stream Track Response](#stream-track-response)
|
||||
- [Get Playback Manifest](#get-playback-manifest)
|
||||
- [Get Playback Manifest Request](#get-playback-manifest-request)
|
||||
- [Get Playback Manifest Response](#get-playback-manifest-response)
|
||||
- [Update Track](#update-track)
|
||||
- [Update Track Request](#update-track-request)
|
||||
- [Update Track Response](#update-track-response)
|
||||
@@ -344,6 +347,49 @@ Accept-Ranges: bytes
|
||||
The response is the raw bytes of the audio file, served with the media type of the file when it is an audio type, or `application/octet-stream` otherwise. Every response carries `X-Content-Type-Options: nosniff`, `Cache-Control: private` and `Vary: Authorization`, together with a `Last-Modified` and an `ETag` derived from the size and the modification time of the file.
|
||||
|
||||
|
||||
### Get Playback Manifest
|
||||
|
||||
#### Get Playback Manifest Request
|
||||
|
||||
```js
|
||||
GET api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/tracks/9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f/playback-manifest?capabilities=mp3/mp3,flac/flac,ogg/opus,ogg/vorbis,wav/pcm,mp4/aac
|
||||
Authorization: Bearer <token>
|
||||
```
|
||||
|
||||
Returns the playback manifest of the track identified by the route: the format of its stored audio, the delivery the server decided on for the requesting player, and the path of its stream, so that a player is told what to fetch and how before it fetches any audio. The `capabilities` query parameter is optional, and its value is a comma separated list of the `container/codec` pairs the player advertises it can demux and decode directly, matched case insensitively, with at most 32 pairs read from one request. When the parameter is absent, empty, or lists no valid pair, the default capabilities of the bundled player apply. The manifest is returned to an Admin, who can build the manifest of the tracks of all libraries, or to the owner of the library of the track.
|
||||
|
||||
#### Get Playback Manifest Response
|
||||
|
||||
```js
|
||||
200 Ok
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"trackId": "9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f",
|
||||
"durationInSeconds": 354,
|
||||
"sourceContainer": "FLAC",
|
||||
"sourceCodec": "FLAC",
|
||||
"sampleRate": 44100,
|
||||
"channels": 2,
|
||||
"bitDepth": 16,
|
||||
"replayGainTrackGain": -7.5,
|
||||
"replayGainTrackPeak": 0.9877,
|
||||
"replayGainAlbumGain": -6.8,
|
||||
"replayGainAlbumPeak": 0.9999,
|
||||
"directPlay": true,
|
||||
"deliveryContainer": null,
|
||||
"deliveryCodec": null,
|
||||
"deliveryShape": null,
|
||||
"segmentDurationSeconds": null,
|
||||
"seekable": true,
|
||||
"streamPath": "/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/tracks/9f0e1d2c-3b4a-4c6d-8e7f-9a0b1c2d3e4f/stream"
|
||||
}
|
||||
```
|
||||
|
||||
When the player can play the stored audio as it is, `directPlay` is `true`, and `deliveryContainer`, `deliveryCodec`, `deliveryShape` and `segmentDurationSeconds` are `null`, because the delivery is the stored file itself. When it cannot, `directPlay` is `false`, and those fields name the container, the codec, the addressing the server produces instead, and the length in seconds of each of its time addressed segments. A normalized delivery is always addressed as `TimeAddressedSegments`, and `segmentDurationSeconds` is the length of each of its segments, so that the server that produces the segments and the player that consumes them agree on it without duplicating the value on both sides. `seekable` reports whether the delivered audio can be seeked by the player. `streamPath` is relative to the API, without a host or a scheme, so that a client reaches the stream through its own application rather than the API server directly.
|
||||
|
||||
|
||||
### Update Track
|
||||
|
||||
#### Update Track Request
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
GET {{host}}/api/v1/libraries/3b3a19f3-1f5a-4d5a-9a3a-5c5a4a3a2a1a/artists/d7c41e6a-9f2b-4b1c-9a3e-7f6e5d4c3b2a/albums/e8d52f7b-0a3c-4c2d-ab4f-8a7b6c5d4e3f/tracks/{{$guid}}/playback-manifest?capabilities=mp3/mp3,flac/flac,ogg/opus,ogg/vorbis,wav/pcm,mp4/aac
|
||||
Authorization: Bearer {{ACCESS_TOKEN}}
|
||||
Reference in new issue
Block a user