Skip to content

Commit

Permalink
remove serviceLocation from segments
Browse files Browse the repository at this point in the history
  • Loading branch information
wseymour15 committed Aug 25, 2023
1 parent e7c7563 commit 6b6efd1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
7 changes: 1 addition & 6 deletions src/segment/segmentTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ export const segmentsFromTemplate = (attributes, segmentTimeline) => {
const mapSegment = urlTypeToSegment({
baseUrl: attributes.baseUrl,
source: constructTemplateUrl(initialization.sourceURL, templateValues),
range: initialization.range,
serviceLocation: attributes.serviceLocation
range: initialization.range
});

const segments = parseTemplateInfo(attributes, segmentTimeline);
Expand Down Expand Up @@ -178,10 +177,6 @@ export const segmentsFromTemplate = (attributes, segmentTimeline) => {
presentationTime
};

if (attributes.serviceLocation) {
map.serviceLocation = attributes.serviceLocation;
}

return map;
});
};
8 changes: 1 addition & 7 deletions src/segment/urlType.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,15 @@ import window from 'global/window';
* @param {string} source - source url for segment
* @param {string} range - optional range used for range calls,
* follows RFC 2616, Clause 14.35.1
* @param {string} serviceLocation - optional serviceLocation provided by <BaseUrl> nodes
* used for content steering
* @return {SingleUri} full segment information transformed into a format similar
* to m3u8-parser
*/
export const urlTypeToSegment = ({ baseUrl = '', source = '', range = '', serviceLocation = null, indexRange = '' }) => {
export const urlTypeToSegment = ({ baseUrl = '', source = '', range = '', indexRange = '' }) => {
const segment = {
uri: source,
resolvedUri: resolveUrl(baseUrl || '', source)
};

if (serviceLocation) {
segment.serviceLocation = serviceLocation;
}

if (range || indexRange) {
const rangeStr = range ? range : indexRange;
const ranges = rangeStr.split('-');
Expand Down
12 changes: 1 addition & 11 deletions test/toPlaylists.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,11 @@ QUnit.test('playlist with content steering BaseURLs', function(assert) {
duration: 0,
map: {
resolvedUri: 'https://cdn1.example.com/',
serviceLocation: 'alpha',
uri: ''
},
number: 1,
presentationTime: 0,
resolvedUri: 'https://cdn1.example.com/',
serviceLocation: 'alpha',
timeline: 0,
uri: ''
}
Expand Down Expand Up @@ -222,13 +220,11 @@ QUnit.test('playlist with content steering BaseURLs', function(assert) {
duration: 0,
map: {
resolvedUri: 'https://cdn2.example.com/',
serviceLocation: 'beta',
uri: ''
},
number: 1,
presentationTime: 0,
resolvedUri: 'https://cdn2.example.com/',
serviceLocation: 'beta',
timeline: 0,
uri: ''
}
Expand Down Expand Up @@ -522,13 +518,11 @@ QUnit.test('playlist with content steering and resolvable BaseURLs', function(as
duration: 0,
map: {
resolvedUri: 'https://cdn1.example.com/video',
uri: '',
serviceLocation: 'alpha'
uri: ''
},
number: 1,
presentationTime: 0,
resolvedUri: 'https://cdn1.example.com/video',
serviceLocation: 'alpha',
timeline: 0,
uri: ''
}
Expand Down Expand Up @@ -558,13 +552,11 @@ QUnit.test('playlist with content steering and resolvable BaseURLs', function(as
duration: 0,
map: {
resolvedUri: 'https://cdn2.example.com/video',
serviceLocation: 'beta',
uri: ''
},
number: 1,
presentationTime: 0,
resolvedUri: 'https://cdn2.example.com/video',
serviceLocation: 'beta',
timeline: 0,
uri: ''
}
Expand All @@ -590,13 +582,11 @@ QUnit.test('playlist with content steering and resolvable BaseURLs', function(as
duration: 0,
map: {
resolvedUri: 'https://cdn1.example.com/vtt',
serviceLocation: 'alpha',
uri: ''
},
number: 1,
presentationTime: 0,
resolvedUri: 'https://cdn1.example.com/vtt',
serviceLocation: 'alpha',
timeline: 0,
uri: ''
}
Expand Down

0 comments on commit 6b6efd1

Please sign in to comment.