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
e8fc6fc0
authored
2014-02-13 17:28:39 -0500
by
David LaPalomento
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge pull request #12 from videojs/bugfix/autoplay
Autoplay if requested
2 parents
bd468d14
fe02f9d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletions
src/videojs-hls.js
test/videojs-hls_test.js
src/videojs-hls.js
View file @
e8fc6fc
...
...
@@ -584,6 +584,10 @@ var
src
:
videojs
.
URL
.
createObjectURL
(
mediaSource
),
type
:
"video/flv"
}]);
if
(
player
.
options
().
autoplay
)
{
player
.
play
();
}
};
videojs
.
plugin
(
'hls'
,
function
()
{
...
...
test/videojs-hls_test.js
View file @
e8fc6fc
...
...
@@ -55,7 +55,7 @@ var
module
(
'HLS'
,
{
setup
:
function
()
{
// mock out Flash feature for phantomjs
// mock out Flash feature
s
for phantomjs
oldFlashSupported
=
videojs
.
Flash
.
isSupported
;
videojs
.
Flash
.
isSupported
=
function
()
{
return
true
;
...
...
@@ -118,6 +118,20 @@ module('HLS', {
}
});
test
(
'starts playing if autoplay is specified'
,
function
()
{
var
plays
=
0
;
player
.
play
=
function
()
{
plays
++
;
};
player
.
options
().
autoplay
=
true
;
player
.
hls
(
'manifest/playlist.m3u8'
);
videojs
.
mediaSources
[
player
.
currentSrc
()].
trigger
({
type
:
'sourceopen'
});
strictEqual
(
1
,
plays
,
'play was called'
);
});
test
(
'loads the specified manifest URL on init'
,
function
()
{
var
loadedmanifest
=
false
,
loadedmetadata
=
false
;
player
.
on
(
'loadedmanifest'
,
function
()
{
...
...
Please
register
or
sign in
to post a comment