videojs / m3u8-parser

An m3u8 parser.
Other
471 stars 98 forks source link

Give init segments their own encryption key/IV #136

Closed iroha7941 closed 3 years ago

iroha7941 commented 3 years ago

Give init segments their own encryption key/IV Generate IVs during parsing

fMP4 HLS allows init segments to be encrypted with a different key/IV than the media segments, so these need to be recorded when parsing the m3u8. This patch will be needed to address https://github.com/videojs/video.js/issues/6893 .

gkatsev commented 3 years ago

hey, looking over this, I think we'd prefer if the default IV value be kept in VHS like it was previously. Not needing to increment another variable in here reduces complexity a bit. Consumers of this project can do a check for the iv presence, which we already do in VHS, and we already have the media sequence number associated with segments there. I think it would end up making this PR really small at the end.