mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Dash: add segment ranges only to streams that have them
This commit is contained in:
23
src/dash.js
23
src/dash.js
@@ -160,15 +160,28 @@ function _getStreamRepresentation(stream)
|
|||||||
.replace(/&/g, '/')
|
.replace(/&/g, '/')
|
||||||
.replace(/=/g, '/');
|
.replace(/=/g, '/');
|
||||||
|
|
||||||
|
repArr.push(
|
||||||
|
` <BaseURL>${encodedURL}</BaseURL>`
|
||||||
|
);
|
||||||
|
|
||||||
|
if(stream.indexRange) {
|
||||||
const segRange = `${stream.indexRange.start}-${stream.indexRange.end}`;
|
const segRange = `${stream.indexRange.start}-${stream.indexRange.end}`;
|
||||||
|
repArr.push(
|
||||||
|
` <SegmentBase indexRange="${segRange}">`
|
||||||
|
);
|
||||||
|
if(stream.initRange) {
|
||||||
const initRange = `${stream.initRange.start}-${stream.initRange.end}`;
|
const initRange = `${stream.initRange.start}-${stream.initRange.end}`;
|
||||||
|
repArr.push(
|
||||||
|
` <Initialization range="${initRange}"/>`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
repArr.push(
|
||||||
|
` </SegmentBase>`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
repArr.push(
|
repArr.push(
|
||||||
` <BaseURL>${encodedURL}</BaseURL>`,
|
` </Representation>`
|
||||||
` <SegmentBase indexRange="${segRange}">`,
|
|
||||||
` <Initialization range="${initRange}"/>`,
|
|
||||||
` </SegmentBase>`,
|
|
||||||
` </Representation>`,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return repArr.join('\n');
|
return repArr.join('\n');
|
||||||
|
Reference in New Issue
Block a user