Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #28 from bcasinclair/master
Browse files Browse the repository at this point in the history
Add encoding support for KEYFORMATVERSIONS for AES encrypted playlists
  • Loading branch information
grafov committed Oct 4, 2015
2 parents 4ad8282 + 8ee4978 commit 0c0306a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,16 @@ func (p *MediaPlaylist) Encode() *bytes.Buffer {
p.buf.WriteString(",IV=")
p.buf.WriteString(p.Key.IV)
}
if p.Key.Keyformat != "" {
p.buf.WriteString(",KEYFORMAT=\"")
p.buf.WriteString(p.Key.Keyformat)
p.buf.WriteRune('"')
}
if p.Key.Keyformatversions != "" {
p.buf.WriteString(",KEYFORMATVERSIONS=\"")
p.buf.WriteString(p.Key.Keyformatversions)
p.buf.WriteRune('"')
}
p.buf.WriteRune('\n')
}
if p.Map != nil {
Expand Down Expand Up @@ -443,6 +453,16 @@ func (p *MediaPlaylist) Encode() *bytes.Buffer {
p.buf.WriteString(",IV=")
p.buf.WriteString(seg.Key.IV)
}
if p.Key.Keyformat != "" {
p.buf.WriteString(",KEYFORMAT=\"")
p.buf.WriteString(p.Key.Keyformat)
p.buf.WriteRune('"')
}
if p.Key.Keyformatversions != "" {
p.buf.WriteString(",KEYFORMATVERSIONS=\"")
p.buf.WriteString(p.Key.Keyformatversions)
p.buf.WriteRune('"')
}
p.buf.WriteRune('\n')
}
if seg.Discontinuity {
Expand Down

0 comments on commit 0c0306a

Please sign in to comment.