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
73420aa6
authored
2014-05-19 17:39:56 -0400
by
Gary Katsevman
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Rename videojs.hls to videojs.Hls to use the tech
1 parent
d2a7225b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
35 deletions
test/exp-golomb_test.js
test/flv-tag_test.js
test/h264-stream_test.js
test/muxer/index.html
test/playlist-loader_test.js
test/segment-parser.js
test/videojs-hls.html
test/exp-golomb_test.js
View file @
73420aa
...
...
@@ -21,7 +21,7 @@
*/
var
buffer
,
ExpGolomb
=
window
.
videojs
.
h
ls
.
ExpGolomb
,
ExpGolomb
=
window
.
videojs
.
H
ls
.
ExpGolomb
,
expGolomb
;
module
(
'Exponential Golomb coding'
);
...
...
test/flv-tag_test.js
View file @
73420aa
...
...
@@ -19,7 +19,7 @@
notStrictEqual(actual, expected, [message])
throws(block, [expected], [message])
*/
var
FlvTag
=
window
.
videojs
.
h
ls
.
FlvTag
;
var
FlvTag
=
window
.
videojs
.
H
ls
.
FlvTag
;
module
(
'FLV tag'
);
...
...
test/h264-stream_test.js
View file @
73420aa
...
...
@@ -2,12 +2,12 @@
module
(
'H264 Stream'
);
var
nalUnitTypes
=
window
.
videojs
.
h
ls
.
NALUnitType
,
FlvTag
=
window
.
videojs
.
h
ls
.
FlvTag
;
nalUnitTypes
=
window
.
videojs
.
H
ls
.
NALUnitType
,
FlvTag
=
window
.
videojs
.
H
ls
.
FlvTag
;
test
(
'metadata is generated for IDRs after a full NAL unit is written'
,
function
()
{
var
h264Stream
=
new
videojs
.
h
ls
.
H264Stream
(),
h264Stream
=
new
videojs
.
H
ls
.
H264Stream
(),
accessUnitDelimiter
=
new
Uint8Array
([
0x00
,
0x00
,
...
...
@@ -62,7 +62,7 @@ test('metadata is generated for IDRs after a full NAL unit is written', function
test
(
'starting PTS values can be negative'
,
function
()
{
var
h264Stream
=
new
videojs
.
h
ls
.
H264Stream
(),
h264Stream
=
new
videojs
.
H
ls
.
H264Stream
(),
accessUnitDelimiter
=
new
Uint8Array
([
0x00
,
0x00
,
...
...
test/muxer/index.html
View file @
73420aa
...
...
@@ -127,7 +127,7 @@
original
.
addEventListener
(
'change'
,
function
()
{
var
reader
=
new
FileReader
();
reader
.
addEventListener
(
'loadend'
,
function
()
{
var
parser
=
new
videojs
.
h
ls
.
SegmentParser
(),
var
parser
=
new
videojs
.
H
ls
.
SegmentParser
(),
tags
=
[
parser
.
getFlvHeader
()],
tag
,
hex
,
...
...
@@ -164,7 +164,7 @@
}
hex
=
'<pre>'
hex
+=
videojs
.
h
ls
.
utils
.
hexDump
(
data
);
hex
+=
videojs
.
H
ls
.
utils
.
hexDump
(
data
);
hex
+=
'</pre>'
vjsOutput
.
innerHTML
=
hex
;
...
...
@@ -201,7 +201,7 @@
}
// output the hex dump
hex
+=
videojs
.
h
ls
.
utils
.
hexDump
(
bytes
);
hex
+=
videojs
.
H
ls
.
utils
.
hexDump
(
bytes
);
hex
+=
'</pre>'
;
workingOutput
.
innerHTML
=
hex
;
});
...
...
test/playlist-loader_test.js
View file @
73420aa
...
...
@@ -36,26 +36,26 @@
test
(
'throws if the playlist url is empty or undefined'
,
function
()
{
throws
(
function
()
{
videojs
.
h
ls
.
PlaylistLoader
();
videojs
.
H
ls
.
PlaylistLoader
();
},
'requires an argument'
);
throws
(
function
()
{
videojs
.
h
ls
.
PlaylistLoader
(
''
);
videojs
.
H
ls
.
PlaylistLoader
(
''
);
},
'does not accept the empty string'
);
});
test
(
'starts without any metadata'
,
function
()
{
var
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'master.m3u8'
);
var
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'master.m3u8'
);
strictEqual
(
loader
.
state
,
'HAVE_NOTHING'
,
'no metadata has loaded yet'
);
});
test
(
'requests the initial playlist immediately'
,
function
()
{
new
videojs
.
h
ls
.
PlaylistLoader
(
'master.m3u8'
);
new
videojs
.
H
ls
.
PlaylistLoader
(
'master.m3u8'
);
strictEqual
(
requests
.
length
,
1
,
'made a request'
);
strictEqual
(
requests
[
0
].
url
,
'master.m3u8'
,
'requested the initial playlist'
);
});
test
(
'moves to HAVE_MASTER after loading a master playlist'
,
function
()
{
var
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'master.m3u8'
);
var
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'master.m3u8'
);
requests
.
pop
().
respond
(
200
,
null
,
'#EXTM3U\n'
+
'#EXT-X-STREAM-INF:\n'
+
...
...
@@ -67,7 +67,7 @@
test
(
'jumps to HAVE_METADATA when initialized with a media playlist'
,
function
()
{
var
loadedmetadatas
=
0
,
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'media.m3u8'
);
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'media.m3u8'
);
loader
.
on
(
'loadedmetadata'
,
function
()
{
loadedmetadatas
++
;
});
...
...
@@ -85,7 +85,7 @@
});
test
(
'jumps to HAVE_METADATA when initialized with a live media playlist'
,
function
()
{
var
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'media.m3u8'
);
var
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'media.m3u8'
);
requests
.
pop
().
respond
(
200
,
null
,
'#EXTM3U\n'
+
'#EXTINF:10,\n'
+
...
...
@@ -99,7 +99,7 @@
var
loadedPlaylist
=
0
,
loadedMetadata
=
0
,
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'master.m3u8'
);
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'master.m3u8'
);
loader
.
on
(
'loadedplaylist'
,
function
()
{
loadedPlaylist
++
;
});
...
...
@@ -131,7 +131,7 @@
});
test
(
'moves to HAVE_CURRENT_METADATA when refreshing the playlist'
,
function
()
{
var
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'live.m3u8'
);
var
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'live.m3u8'
);
requests
.
pop
().
respond
(
200
,
null
,
'#EXTM3U\n'
+
'#EXTINF:10,\n'
+
...
...
@@ -145,7 +145,7 @@
});
test
(
'returns to HAVE_METADATA after refreshing the playlist'
,
function
()
{
var
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'live.m3u8'
);
var
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'live.m3u8'
);
requests
.
pop
().
respond
(
200
,
null
,
'#EXTM3U\n'
+
'#EXTINF:10,\n'
+
...
...
@@ -161,7 +161,7 @@
test
(
'emits an error when an initial playlist request fails'
,
function
()
{
var
errors
=
[],
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'master.m3u8'
);
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'master.m3u8'
);
loader
.
on
(
'error'
,
function
()
{
errors
.
push
(
loader
.
error
);
...
...
@@ -175,7 +175,7 @@
test
(
'errors when an initial media playlist request fails'
,
function
()
{
var
errors
=
[],
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'master.m3u8'
);
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'master.m3u8'
);
loader
.
on
(
'error'
,
function
()
{
errors
.
push
(
loader
.
error
);
...
...
@@ -197,7 +197,7 @@
// http://tools.ietf.org/html/draft-pantos-http-live-streaming-12#section-6.3.4
test
(
'halves the refresh timeout if a playlist is unchanged'
+
'since the last reload'
,
function
()
{
new
videojs
.
h
ls
.
PlaylistLoader
(
'live.m3u8'
);
new
videojs
.
H
ls
.
PlaylistLoader
(
'live.m3u8'
);
requests
.
pop
().
respond
(
200
,
null
,
'#EXTM3U\n'
+
'#EXT-X-MEDIA-SEQUENCE:0\n'
+
...
...
@@ -218,7 +218,7 @@
});
test
(
'media-sequence updates are considered a playlist change'
,
function
()
{
new
videojs
.
h
ls
.
PlaylistLoader
(
'live.m3u8'
);
new
videojs
.
H
ls
.
PlaylistLoader
(
'live.m3u8'
);
requests
.
pop
().
respond
(
200
,
null
,
'#EXTM3U\n'
+
'#EXT-X-MEDIA-SEQUENCE:0\n'
+
...
...
@@ -238,7 +238,7 @@
test
(
'emits an error if a media refresh fails'
,
function
()
{
var
errors
=
0
,
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'live.m3u8'
);
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'live.m3u8'
);
loader
.
on
(
'error'
,
function
()
{
errors
++
;
...
...
@@ -256,7 +256,7 @@
});
test
(
'switches media playlists when requested'
,
function
()
{
var
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'master.m3u8'
);
var
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'master.m3u8'
);
requests
.
pop
().
respond
(
200
,
null
,
'#EXTM3U\n'
+
'#EXT-X-STREAM-INF:BANDWIDTH=1\n'
+
...
...
@@ -284,7 +284,7 @@
});
test
(
'can switch media playlists based on URI'
,
function
()
{
var
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'master.m3u8'
);
var
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'master.m3u8'
);
requests
.
pop
().
respond
(
200
,
null
,
'#EXTM3U\n'
+
'#EXT-X-STREAM-INF:BANDWIDTH=1\n'
+
...
...
@@ -312,7 +312,7 @@
});
test
(
'aborts in-flight playlist refreshes when switching'
,
function
()
{
var
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'master.m3u8'
);
var
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'master.m3u8'
);
requests
.
pop
().
respond
(
200
,
null
,
'#EXTM3U\n'
+
'#EXT-X-STREAM-INF:BANDWIDTH=1\n'
+
...
...
@@ -331,7 +331,7 @@
});
test
(
'switching to the active playlist is a no-op'
,
function
()
{
var
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'master.m3u8'
);
var
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'master.m3u8'
);
requests
.
pop
().
respond
(
200
,
null
,
'#EXTM3U\n'
+
'#EXT-X-STREAM-INF:BANDWIDTH=1\n'
+
...
...
@@ -350,7 +350,7 @@
});
test
(
'throws an error if a media switch is initiated too early'
,
function
()
{
var
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'master.m3u8'
);
var
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'master.m3u8'
);
throws
(
function
()
{
loader
.
media
(
'high.m3u8'
);
...
...
@@ -368,7 +368,7 @@
});
test
(
'throws an error if a switch to an unrecognized playlist is requested'
,
function
()
{
var
loader
=
new
videojs
.
h
ls
.
PlaylistLoader
(
'master.m3u8'
);
var
loader
=
new
videojs
.
H
ls
.
PlaylistLoader
(
'master.m3u8'
);
requests
.
pop
().
respond
(
200
,
null
,
'#EXTM3U\n'
+
'#EXT-X-STREAM-INF:BANDWIDTH=1\n'
+
...
...
test/segment-parser.js
View file @
73420aa
...
...
@@ -39,7 +39,7 @@
module
(
'segment parser'
,
{
setup
:
function
()
{
parser
=
new
window
.
videojs
.
h
ls
.
SegmentParser
();
parser
=
new
window
.
videojs
.
H
ls
.
SegmentParser
();
}
});
...
...
@@ -168,11 +168,11 @@
result
=
result
.
concat
(
makePsi
(
settings
));
// ensure the resulting packet is the correct size
result
.
length
=
window
.
videojs
.
h
ls
.
SegmentParser
.
MP2T_PACKET_LENGTH
;
result
.
length
=
window
.
videojs
.
H
ls
.
SegmentParser
.
MP2T_PACKET_LENGTH
;
return
result
;
},
h264Type
=
window
.
videojs
.
h
ls
.
SegmentParser
.
STREAM_TYPES
.
h264
,
adtsType
=
window
.
videojs
.
h
ls
.
SegmentParser
.
STREAM_TYPES
.
adts
;
h264Type
=
window
.
videojs
.
H
ls
.
SegmentParser
.
STREAM_TYPES
.
h264
,
adtsType
=
window
.
videojs
.
H
ls
.
SegmentParser
.
STREAM_TYPES
.
adts
;
parser
.
parseSegmentBinaryData
(
new
Uint8Array
(
makePacket
({
programs
:
{
...
...
test/videojs-hls.html
View file @
73420aa
...
...
@@ -15,7 +15,7 @@
<script
src=
"../libs/qunit/qunit.js"
></script>
<!-- video.js -->
<script
src=
"../node_modules/video.js/dist/video-js/video.js"
></script>
<script
src=
"../node_modules/video.js/dist/video-js/video.
dev.
js"
></script>
<script
src=
"../node_modules/videojs-contrib-media-sources/src/videojs-media-sources.js"
></script>
<!-- HLS plugin -->
...
...
Please
register
or
sign in
to post a comment