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
a5fb7c9f
authored
2014-05-07 19:13:42 -0400
by
Gary Katsevman
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
call Flash with correct context
1 parent
c6348181
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
25 deletions
src/videojs-hls.js
src/videojs-hls.js
View file @
a5fb7c9
...
...
@@ -178,9 +178,8 @@ var
* Initializes the HLS plugin.
* @param options {mixed} the URL to an HLS playlist
*/
init
=
function
(
options
,
ready
)
{
init
=
function
(
options
,
mediaSource
)
{
var
mediaSource
=
new
videojs
.
MediaSource
(),
segmentParser
=
new
videojs
.
Hls
.
SegmentParser
(),
player
=
this
,
srcUrl
,
...
...
@@ -202,7 +201,6 @@ var
extname
,
i
=
0
,
j
=
0
,
src
=
player
.
el
().
querySelector
(
'.vjs-tech'
).
src
,
sources
=
player
.
options
().
sources
,
techName
,
length
=
sources
.
length
;
...
...
@@ -214,17 +212,6 @@ var
return
options
.
url
;
}
// src attributes take precedence over source children
if
(
src
)
{
// assume files with the m3u8 extension are HLS
extname
=
(
/
[^
#?
]
*
(?:\/[^
#?
]
*
\.([^
#?
]
*
))
/
).
exec
(
src
);
if
(
extname
&&
extname
[
1
]
===
'm3u8'
)
{
return
src
;
}
return
;
}
// find the first playable source
for
(;
i
<
length
;
i
++
)
{
...
...
@@ -536,24 +523,22 @@ var
//player.play();
//}
var
source
=
options
.
source
;
options
.
source
=
[{
src
:
videojs
.
URL
.
createObjectURL
(
mediaSource
),
type
:
"video/flv"
}];
//delete options.source;
//console.log(options.source);
videojs
.
Flash
.
call
(
videojs
.
Hls
,
player
,
options
,
ready
);
options
.
source
=
source
;
console
.
log
(
options
.
source
);
};
var
mpegurlRE
=
/^application
\/(?:
x-|vnd
\.
apple
\.)
mpegurl/i
;
videojs
.
Hls
=
videojs
.
Flash
.
extend
({
init
:
function
(
player
,
options
,
ready
)
{
var
mediaSource
=
new
videojs
.
MediaSource
();
var
source
=
options
.
source
;
options
.
source
=
{
src
:
videojs
.
URL
.
createObjectURL
(
mediaSource
),
type
:
"video/flv"
};
videojs
.
Flash
.
call
(
this
,
player
,
options
,
ready
);
player
.
hls
=
{};
init
.
call
(
player
,
options
,
ready
);
options
.
source
=
source
;
init
.
call
(
player
,
options
,
mediaSource
);
}
});
...
...
Please
register
or
sign in
to post a comment