Implement #767 for custom media only

This commit is contained in:
Calvin Montgomery 2018-11-15 22:52:04 -08:00
parent 027b27c1b0
commit 8456b6a125
3 changed files with 8 additions and 6 deletions

View file

@ -71,8 +71,11 @@ The following MIME types are accepted for the `contentType` field:
* `video/webm`
* `video/ogg`
* `application/x-mpegURL` (HLS streams)
- HLS is only supported for livestreams. Metadata with HLS sources
- HLS is only tested with livestreams. VODs are accepted, but I do not test
this functionality.
but without `live: true` will be rejected.
* `application/dash+xml` (DASH streams)
- Support for DASH is experimental
* ~~`rtmp/flv`~~
- In light of Adobe phasing out support for Flash, and many browsers
already dropping support, RTMP is not supported by this feature.

View file

@ -30,8 +30,7 @@ const SOURCE_CONTENT_TYPES = new Set([
]);
const LIVE_ONLY_CONTENT_TYPES = new Set([
'application/dash+xml',
'application/x-mpegURL'
'application/dash+xml'
]);
export function lookup(url, opts) {

View file

@ -90,13 +90,13 @@ describe('custom-media', () => {
assert.throws(() => validate(invalid), /URL protocol must be HTTPS/);
});
it('rejects non-live HLS', () => {
it('rejects non-live DASH', () => {
invalid.live = false;
invalid.sources[0].contentType = 'application/x-mpegURL';
invalid.sources[0].contentType = 'application/dash+xml';
assert.throws(
() => validate(invalid),
/contentType "application\/x-mpegURL" requires live: true/
/contentType "application\/dash\+xml" requires live: true/
);
});
});