mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +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, '/');
|
||||
|
||||
repArr.push(
|
||||
` <BaseURL>${encodedURL}</BaseURL>`
|
||||
);
|
||||
|
||||
if(stream.indexRange) {
|
||||
const segRange = `${stream.indexRange.start}-${stream.indexRange.end}`;
|
||||
repArr.push(
|
||||
` <SegmentBase indexRange="${segRange}">`
|
||||
);
|
||||
if(stream.initRange) {
|
||||
const initRange = `${stream.initRange.start}-${stream.initRange.end}`;
|
||||
repArr.push(
|
||||
` <Initialization range="${initRange}"/>`
|
||||
);
|
||||
}
|
||||
repArr.push(
|
||||
` </SegmentBase>`
|
||||
);
|
||||
}
|
||||
|
||||
repArr.push(
|
||||
` <BaseURL>${encodedURL}</BaseURL>`,
|
||||
` <SegmentBase indexRange="${segRange}">`,
|
||||
` <Initialization range="${initRange}"/>`,
|
||||
` </SegmentBase>`,
|
||||
` </Representation>`,
|
||||
` </Representation>`
|
||||
);
|
||||
|
||||
return repArr.join('\n');
|
||||
|
Reference in New Issue
Block a user