-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a stringify failure found in EXT-X-DATERANGE's END-DATE attr (#133)
- Loading branch information
Showing
4 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# This example shows two EXT-X-DATERANGE tags that describe a single | ||
# Date Range, with a SCTE-35 "out" splice_insert() command that is | ||
# subsequently updated with an SCTE-35 "in" splice_insert() command. | ||
|
||
#EXTM3U | ||
#EXT-X-VERSION:3 | ||
#EXT-X-TARGETDURATION:30 | ||
|
||
#EXT-X-PROGRAM-DATE-TIME:2014-03-05T11:14:00.000Z | ||
#EXTINF:30, | ||
http://media.example.com/01.ts | ||
#EXTINF:30, | ||
http://media.example.com/02.ts | ||
#EXT-X-DATERANGE:ID="splice-6FFFFFF0",START-DATE="2023-10-09T06:16:00.820Z",PLANNED-DURATION=59.993,SCTE35-OUT=0xFC30250001D1F7E25300FFF0140565239AA07FEFFE015C3F90FE00526362000101010000A7C1792D | ||
#EXTINF:30, | ||
http://ads.example.com/ad-01.ts | ||
#EXTINF:30, | ||
http://ads.example.com/ad-02.ts | ||
#EXT-X-DATERANGE:ID="splice-6FFFFFF0",START-DATE="2023-10-09T06:16:00.820Z",END-DATE="2023-10-09T06:17:01.514Z",DURATION=60.694 | ||
#EXTINF:30, | ||
http://media.example.com/03.ts | ||
#EXTINF:3.003, | ||
http://media.example.com/04.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
const {MediaPlaylist, Segment, DateRange} = require('../../../types'); | ||
const utils = require('../../../utils'); | ||
|
||
const playlist = new MediaPlaylist({ | ||
version: 3, | ||
targetDuration: 30, | ||
segments: createSegments() | ||
}); | ||
|
||
function createSegments() { | ||
const segments = []; | ||
segments.push(new Segment({ | ||
uri: 'http://media.example.com/01.ts', | ||
duration: 30, | ||
title: '', | ||
mediaSequenceNumber: 0, | ||
discontinuitySequence: 0, | ||
programDateTime: new Date('2014-03-05T11:14:00Z') | ||
})); | ||
segments.push(new Segment({ | ||
uri: 'http://media.example.com/02.ts', | ||
duration: 30, | ||
title: '', | ||
mediaSequenceNumber: 1, | ||
discontinuitySequence: 0 | ||
})); | ||
segments.push(new Segment({ | ||
uri: 'http://ads.example.com/ad-01.ts', | ||
duration: 30, | ||
title: '', | ||
mediaSequenceNumber: 2, | ||
discontinuitySequence: 0, | ||
dateRange: new DateRange({ | ||
id: 'splice-6FFFFFF0', | ||
start: new Date('2023-10-09T06:16:00.820Z'), | ||
plannedDuration: 59.993, | ||
attributes: { | ||
'SCTE35-OUT': utils.hexToByteSequence('0xFC30250001D1F7E25300FFF0140565239AA07FEFFE015C3F90FE00526362000101010000A7C1792D') | ||
} | ||
}) | ||
})); | ||
segments.push(new Segment({ | ||
uri: 'http://ads.example.com/ad-02.ts', | ||
duration: 30, | ||
title: '', | ||
mediaSequenceNumber: 3, | ||
discontinuitySequence: 0 | ||
})); | ||
segments.push(new Segment({ | ||
uri: 'http://media.example.com/03.ts', | ||
duration: 30, | ||
title: '', | ||
mediaSequenceNumber: 4, | ||
discontinuitySequence: 0, | ||
dateRange: new DateRange({ | ||
id: 'splice-6FFFFFF0', | ||
start: new Date('2023-10-09T06:16:00.820Z'), | ||
end: new Date('2023-10-09T06:17:01.514Z'), | ||
duration: 60.694 | ||
}) | ||
})); | ||
segments.push(new Segment({ | ||
uri: 'http://media.example.com/04.ts', | ||
duration: 3.003, | ||
title: '', | ||
mediaSequenceNumber: 5, | ||
discontinuitySequence: 0 | ||
})); | ||
return segments; | ||
} | ||
|
||
module.exports = playlist; |