Skip to content

Commit

Permalink
add resolvedURIs to video and audio playlists
Browse files Browse the repository at this point in the history
  • Loading branch information
wseymour15 committed Aug 25, 2023
1 parent 6b6efd1 commit 5473498
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 77 deletions.
10 changes: 5 additions & 5 deletions src/toM3u8.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const formatAudioPlaylist = ({
uri: '',
endList: attributes.type === 'static',
timeline: attributes.periodStart,
resolvedUri: '',
resolvedUri: attributes.baseUrl || '',
targetDuration: attributes.duration,
discontinuitySequence,
discontinuityStarts,
Expand All @@ -129,7 +129,7 @@ export const formatAudioPlaylist = ({
}

if (attributes.serviceLocation) {
playlist.serviceLocation = attributes.serviceLocation;
playlist.attributes.serviceLocation = attributes.serviceLocation;

Check warning on line 132 in src/toM3u8.js

View check run for this annotation

Codecov / codecov/patch

src/toM3u8.js#L132

Added line #L132 was not covered by tests
}

if (sidx) {
Expand Down Expand Up @@ -189,7 +189,7 @@ export const formatVttPlaylist = ({
};

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

return vttPlaylist;
Expand Down Expand Up @@ -317,7 +317,7 @@ export const formatVideoPlaylist = ({
uri: '',
endList: attributes.type === 'static',
timeline: attributes.periodStart,
resolvedUri: '',
resolvedUri: attributes.baseUrl || '',
targetDuration: attributes.duration,
discontinuityStarts,
timelineStarts: attributes.timelineStarts,
Expand All @@ -333,7 +333,7 @@ export const formatVideoPlaylist = ({
}

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

if (sidx) {
Expand Down
2 changes: 1 addition & 1 deletion test/manifests/608-captions.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const parsedManifest = {
'SUBTITLES': 'subs'
},
endList: true,
resolvedUri: '',
resolvedUri: 'https://www.example.com/1080p.ts',
targetDuration: 6,
mediaSequence: 0,
timelineStarts: [{ start: 0, timeline: 0 }],
Expand Down
2 changes: 1 addition & 1 deletion test/manifests/708-captions.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const parsedManifest = {
'SUBTITLES': 'subs'
},
endList: true,
resolvedUri: '',
resolvedUri: 'https://www.example.com/1080p.ts',
targetDuration: 6,
mediaSequence: 0,
timelineStarts: [{ start: 0, timeline: 0 }],
Expand Down
4 changes: 2 additions & 2 deletions test/manifests/audio-only.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const parsedManifest = {
uri: '',
endList: true,
timeline: 0,
resolvedUri: '',
resolvedUri: 'http://example.com/audio_en_2c_128k_aac.mp4',
targetDuration: 60,
segments: [],
mediaSequence: 0,
Expand Down Expand Up @@ -78,7 +78,7 @@ export const parsedManifest = {
uri: '',
endList: true,
timeline: 0,
resolvedUri: '',
resolvedUri: 'http://example.com/audio_es_2c_128k_aac.mp4',
targetDuration: 60,
segments: [],
mediaSequence: 0,
Expand Down
2 changes: 1 addition & 1 deletion test/manifests/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const parsedManifest = {
'SUBTITLES': 'subs'
},
endList: true,
resolvedUri: '',
resolvedUri: 'https://www.example.com/1080p.ts',
targetDuration: 6,
mediaSequence: 0,
discontinuitySequence: 0,
Expand Down
2 changes: 1 addition & 1 deletion test/manifests/locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const parsedManifest = {
'SUBTITLES': 'subs'
},
endList: true,
resolvedUri: '',
resolvedUri: 'https://www.example.com/1080p.ts',
targetDuration: 6,
mediaSequence: 0,
discontinuitySequence: 0,
Expand Down
12 changes: 6 additions & 6 deletions test/manifests/maat_vtt_segmentTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const parsedManifest = {
timelineStarts: [{ start: 0, timeline: 0 }],
discontinuitySequence: 0,
discontinuityStarts: [],
resolvedUri: '',
resolvedUri: 'https://www.example.com/base',
targetDuration: 1.984,
segments: [
{
Expand Down Expand Up @@ -100,7 +100,7 @@ export const parsedManifest = {
timelineStarts: [{ start: 0, timeline: 0 }],
discontinuitySequence: 0,
discontinuityStarts: [],
resolvedUri: '',
resolvedUri: 'https://www.example.com/base',
targetDuration: 1.984,
segments: [
{
Expand Down Expand Up @@ -183,7 +183,7 @@ export const parsedManifest = {
timelineStarts: [{ start: 0, timeline: 0 }],
discontinuitySequence: 0,
discontinuityStarts: [],
resolvedUri: '',
resolvedUri: 'https://www.example.com/base',
targetDuration: 1.984,
segments: [
{
Expand Down Expand Up @@ -258,7 +258,7 @@ export const parsedManifest = {
timelineStarts: [{ start: 0, timeline: 0 }],
discontinuitySequence: 0,
discontinuityStarts: [],
resolvedUri: '',
resolvedUri: 'https://www.example.com/base',
targetDuration: 1.984,
segments: [
{
Expand Down Expand Up @@ -421,7 +421,7 @@ export const parsedManifest = {
timelineStarts: [{ start: 0, timeline: 0 }],
discontinuitySequence: 0,
discontinuityStarts: [],
resolvedUri: '',
resolvedUri: 'https://www.example.com/base',
targetDuration: 1.9185833333333333,
segments: [
{
Expand Down Expand Up @@ -503,7 +503,7 @@ export const parsedManifest = {
timelineStarts: [{ start: 0, timeline: 0 }],
discontinuitySequence: 0,
discontinuityStarts: [],
resolvedUri: '',
resolvedUri: 'https://www.example.com/base',
targetDuration: 1.9185833333333333,
segments: [
{
Expand Down
2 changes: 1 addition & 1 deletion test/manifests/multiperiod-segment-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const parsedManifest = {
timeline: 6
}],
targetDuration: 3,
resolvedUri: '',
resolvedUri: 'https://www.example.com/base',
segments: [
{
duration: 3,
Expand Down
4 changes: 2 additions & 2 deletions test/manifests/multiperiod-segment-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const parsedManifest = {
uri: '',
endList: true,
timeline: 0,
resolvedUri: '',
resolvedUri: 'https://www.example.com/base',
targetDuration: 5,
segments: [
{
Expand Down Expand Up @@ -145,7 +145,7 @@ export const parsedManifest = {
uri: '',
endList: true,
timeline: 0,
resolvedUri: '',
resolvedUri: 'https://www.example.com/base',
targetDuration: 5,
segments: [
{
Expand Down
14 changes: 7 additions & 7 deletions test/manifests/multiperiod-startnumber-removed-periods.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const parsedManifest = {
timelineStarts: [
{ start: 111, timeline: 111}
],
resolvedUri: '',
resolvedUri: 'http://example.com/audio/v0/',
segments: [
{
discontinuity: true,
Expand Down Expand Up @@ -107,7 +107,7 @@ export const parsedManifest = {
timelineStarts: [
{ start: 111, timeline: 111}
],
resolvedUri: '',
resolvedUri: 'http://example.com/video/D/',
segments: [
{
discontinuity: true,
Expand Down Expand Up @@ -172,7 +172,7 @@ export const parsedManifest = {
{ start: 111, timeline: 111}
],
discontinuityStarts: [0],
resolvedUri: '',
resolvedUri: 'http://example.com/video/E/',
segments: [
{
discontinuity: true,
Expand Down Expand Up @@ -237,7 +237,7 @@ export const parsedManifest = {
{ start: 111, timeline: 111}
],
discontinuityStarts: [0],
resolvedUri: '',
resolvedUri: 'http://example.com/video/F/',
segments: [
{
discontinuity: true,
Expand Down Expand Up @@ -302,7 +302,7 @@ export const parsedManifest = {
{ start: 111, timeline: 111}
],
discontinuityStarts: [0],
resolvedUri: '',
resolvedUri: 'http://example.com/video/A/',
segments: [
{
discontinuity: true,
Expand Down Expand Up @@ -367,7 +367,7 @@ export const parsedManifest = {
{ start: 111, timeline: 111}
],
discontinuityStarts: [0],
resolvedUri: '',
resolvedUri: 'http://example.com/video/B/',
segments: [
{
discontinuity: true,
Expand Down Expand Up @@ -432,7 +432,7 @@ export const parsedManifest = {
{ start: 111, timeline: 111}
],
discontinuityStarts: [0],
resolvedUri: '',
resolvedUri: 'http://example.com/video/C/',
segments: [
{
discontinuity: true,
Expand Down
20 changes: 10 additions & 10 deletions test/manifests/multiperiod-startnumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const parsedManifest = {
mediaSequence: 0,
discontinuitySequence: 0,
discontinuityStarts: [],
resolvedUri: '',
resolvedUri: 'http://example.com/audio/1',
segments: [
{
duration: 1,
Expand Down Expand Up @@ -85,7 +85,7 @@ export const parsedManifest = {
discontinuityStarts: [2, 4],
endList: false,
mediaSequence: 0,
resolvedUri: '',
resolvedUri: 'http://example.com/audio/v0/',
segments: [
{
duration: 2,
Expand Down Expand Up @@ -212,7 +212,7 @@ export const parsedManifest = {
discontinuityStarts: [3, 5, 7],
endList: false,
mediaSequence: 0,
resolvedUri: '',
resolvedUri: 'http://example.com/video/D/',
segments: [
{
duration: 1,
Expand Down Expand Up @@ -366,7 +366,7 @@ export const parsedManifest = {
discontinuityStarts: [3, 5, 7],
endList: false,
mediaSequence: 0,
resolvedUri: '',
resolvedUri: 'http://example.com/video/E/',
segments: [
{
duration: 1,
Expand Down Expand Up @@ -520,7 +520,7 @@ export const parsedManifest = {
discontinuityStarts: [],
endList: false,
mediaSequence: 0,
resolvedUri: '',
resolvedUri: 'http://example.com/video/E/',
segments: [
{
duration: 1,
Expand Down Expand Up @@ -584,7 +584,7 @@ export const parsedManifest = {
discontinuityStarts: [],
endList: false,
mediaSequence: 0,
resolvedUri: '',
resolvedUri: 'http://example.com/video/E/',
segments: [
{
duration: 1,
Expand Down Expand Up @@ -648,7 +648,7 @@ export const parsedManifest = {
discontinuityStarts: [3, 5, 7],
endList: false,
mediaSequence: 0,
resolvedUri: '',
resolvedUri: 'http://example.com/video/A/',
segments: [
{
duration: 1,
Expand Down Expand Up @@ -802,7 +802,7 @@ export const parsedManifest = {
discontinuityStarts: [3, 5, 7],
endList: false,
mediaSequence: 0,
resolvedUri: '',
resolvedUri: 'http://example.com/video/B/',
segments: [
{
duration: 1,
Expand Down Expand Up @@ -956,7 +956,7 @@ export const parsedManifest = {
discontinuityStarts: [2, 4],
endList: false,
mediaSequence: 0,
resolvedUri: '',
resolvedUri: 'http://example.com/video/F/',
segments: [
{
duration: 2,
Expand Down Expand Up @@ -1072,7 +1072,7 @@ export const parsedManifest = {
discontinuityStarts: [2, 4],
endList: false,
mediaSequence: 0,
resolvedUri: '',
resolvedUri: 'http://example.com/video/C/',
segments: [
{
duration: 2,
Expand Down
2 changes: 1 addition & 1 deletion test/manifests/segmentBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const parsedManifest = {
'SUBTITLES': 'subs'
},
endList: true,
resolvedUri: '',
resolvedUri: 'https://www.example.com/1080p.ts',
targetDuration: 6,
mediaSequence: 0,
segments: [
Expand Down
4 changes: 2 additions & 2 deletions test/manifests/segmentList.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const parsedManifest = {
endList: true,
mediaSequence: 0,
targetDuration: 1,
resolvedUri: '',
resolvedUri: 'https://www.example.com/base',
segments: [
{
duration: 1,
Expand Down Expand Up @@ -123,7 +123,7 @@ export const parsedManifest = {
'SUBTITLES': 'subs'
},
endList: true,
resolvedUri: '',
resolvedUri: 'https://www.example.com/base',
mediaSequence: 0,
targetDuration: 60,
segments: [
Expand Down
Loading

0 comments on commit 5473498

Please sign in to comment.