Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
videojs-contrib-hls
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
514e9c6e
authored
2015-03-17 13:39:40 +0100
by
Rajko Stojadinovic
Committed by
David LaPalomento
2015-04-02 17:02:41 -0400
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Have key.iv be undefined if IV not present
1 parent
09c57621
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
15 deletions
src/m3u8/m3u8-parser.js
src/videojs-hls.js
test/manifest/encrypted.json
src/m3u8/m3u8-parser.js
View file @
514e9c6
...
...
@@ -440,9 +440,12 @@
// setup an encryption key for upcoming segments
key
=
{
method
:
entry
.
attributes
.
METHOD
||
'AES-128'
,
uri
:
entry
.
attributes
.
URI
,
iv
:
entry
.
attributes
.
IV
||
null
uri
:
entry
.
attributes
.
URI
};
if
(
entry
.
attributes
.
IV
!==
undefined
)
{
key
.
iv
=
entry
.
attributes
.
IV
}
},
'media-sequence'
:
function
()
{
if
(
!
isFinite
(
entry
.
number
))
{
...
...
src/videojs-hls.js
View file @
514e9c6
...
...
@@ -704,13 +704,10 @@ videojs.Hls.prototype.drainBuffer = function(event) {
}
else
{
// if the media sequence is greater than 2^32, the IV will be incorrect
// assuming 10s segments, that would be about 1300 years
var
theIv
=
segment
.
key
.
iv
;
if
(
theIv
===
null
)
{
theIv
=
new
Uint32Array
([
0
,
0
,
0
,
mediaIndex
+
playlist
.
mediaSequence
]);
}
var
segIv
=
segment
.
key
.
iv
||
new
Uint32Array
([
0
,
0
,
0
,
mediaIndex
+
playlist
.
mediaSequence
]);
bytes
=
videojs
.
Hls
.
decrypt
(
bytes
,
segment
.
key
.
bytes
,
the
Iv
);
seg
Iv
);
}
}
...
...
test/manifest/encrypted.json
View file @
514e9c6
...
...
@@ -6,8 +6,7 @@
"duration"
:
2.833
,
"key"
:
{
"method"
:
"AES-128"
,
"uri"
:
"https://priv.example.com/key.php?r=52"
,
"iv"
:
null
"uri"
:
"https://priv.example.com/key.php?r=52"
},
"uri"
:
"http://media.example.com/fileSequence52-A.ts"
},
...
...
@@ -15,8 +14,7 @@
"duration"
:
15
,
"key"
:
{
"method"
:
"AES-128"
,
"uri"
:
"https://priv.example.com/key.php?r=52"
,
"iv"
:
null
"uri"
:
"https://priv.example.com/key.php?r=52"
},
"uri"
:
"http://media.example.com/fileSequence52-B.ts"
},
...
...
@@ -24,8 +22,7 @@
"duration"
:
13.333
,
"key"
:
{
"method"
:
"AES-128"
,
"uri"
:
"https://priv.example.com/key.php?r=52"
,
"iv"
:
null
"uri"
:
"https://priv.example.com/key.php?r=52"
},
"uri"
:
"http://media.example.com/fileSequence52-C.ts"
},
...
...
@@ -33,8 +30,7 @@
"duration"
:
15
,
"key"
:
{
"method"
:
"AES-128"
,
"uri"
:
"https://priv.example.com/key.php?r=53"
,
"iv"
:
null
"uri"
:
"https://priv.example.com/key.php?r=53"
},
"uri"
:
"http://media.example.com/fileSequence53-A.ts"
},
...
...
Please
register
or
sign in
to post a comment