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
f9d2e1e1
authored
2014-04-07 10:03:52 -0700
by
Tom Johnson
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
test fix.
1 parent
1639b663
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
src/videojs-hls.js
src/videojs-hls.js
View file @
f9d2e1e
...
...
@@ -210,7 +210,7 @@ var
if
(
!
playlist
||
!
playlist
.
segments
)
{
return
0
;
}
i
=
playlist
.
segments
.
length
;
// if present, use the duration specified in the playlist
...
...
@@ -368,10 +368,6 @@ var
return
1
;
// HAVE_METADATA
};
player
.
on
(
'loadedmanifest'
,
function
()
{
updateDuration
();
});
player
.
on
(
'seeking'
,
function
()
{
var
currentTime
=
player
.
currentTime
();
player
.
hls
.
mediaIndex
=
getMediaIndexByTime
(
player
.
hls
.
media
,
currentTime
);
...
...
@@ -389,9 +385,9 @@ var
/**
* Update the player duration
*/
updateDuration
=
function
()
{
updateDuration
=
function
(
playlist
)
{
// update the duration
player
.
duration
(
totalDuration
(
play
er
.
hls
.
media
));
player
.
duration
(
totalDuration
(
play
list
));
// tell the flash tech of the new duration
if
(
player
.
el
().
querySelector
(
'.vjs-tech'
).
id
===
'video_flash_api'
)
{
player
.
el
().
querySelector
(
'.vjs-tech'
).
vjs_setProperty
(
'duration'
,
player
.
duration
());
...
...
@@ -426,7 +422,7 @@ var
playlist
);
player
.
hls
.
media
=
playlist
;
updateDuration
();
updateDuration
(
player
.
hls
.
media
);
}
};
...
...
@@ -577,7 +573,7 @@ var
player
.
hls
.
media
=
player
.
hls
.
master
.
playlists
[
0
];
// update the duration
player
.
duration
(
totalDuration
(
parser
.
manifest
)
);
updateDuration
(
parser
.
manifest
);
// periodicaly check if the buffer needs to be refilled
player
.
on
(
'timeupdate'
,
fillBuffer
);
...
...
Please
register
or
sign in
to post a comment