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
e6622e00
authored
2015-03-20 13:01:35 -0400
by
Brandon Bay
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Adding _ to func names to indicate private scope
1 parent
2232121b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
src/videojs-hls.js
src/videojs-hls.js
View file @
e6622e0
...
...
@@ -171,7 +171,7 @@ videojs.Hls.prototype.src = function(src) {
// a loadedplaylist event, we will call translateMediaIndex and
// maintain our position at the live point.
if
(
this
.
duration
()
===
Infinity
&&
this
.
mediaIndex
===
0
)
{
this
.
mediaIndex
=
videojs
.
Hls
.
getMediaIndexForLive
(
oldMediaPlaylist
);
this
.
mediaIndex
=
videojs
.
Hls
.
getMediaIndexForLive
_
(
oldMediaPlaylist
);
}
selectedPlaylist
=
this
.
selectPlaylist
();
...
...
@@ -247,7 +247,7 @@ videojs.Hls.prototype.src = function(src) {
/* Returns the media index for the live point in the current playlist, and updates
the current time to go along with it.
*/
videojs
.
Hls
.
getMediaIndexForLive
=
function
(
selectedPlaylist
)
{
videojs
.
Hls
.
getMediaIndexForLive
_
=
function
(
selectedPlaylist
)
{
if
(
!
selectedPlaylist
.
segments
)
{
return
0
;
}
...
...
@@ -292,8 +292,8 @@ videojs.Hls.prototype.play = function() {
}
if
(
this
.
duration
()
===
Infinity
&&
this
.
playlists
.
media
()
&&
!
this
.
player
().
hasClass
(
'vjs-has-started'
))
{
this
.
mediaIndex
=
videojs
.
Hls
.
getMediaIndexForLive
(
this
.
playlists
.
media
());
this
.
setCurrentTime
(
this
.
getCurrentTimeByMediaIndex
(
this
.
playlists
.
media
(),
this
.
mediaIndex
));
this
.
mediaIndex
=
videojs
.
Hls
.
getMediaIndexForLive
_
(
this
.
playlists
.
media
());
this
.
setCurrentTime
(
this
.
getCurrentTimeByMediaIndex
_
(
this
.
playlists
.
media
(),
this
.
mediaIndex
));
}
// delegate back to the Flash implementation
...
...
@@ -953,7 +953,7 @@ videojs.Hls.translateMediaIndex = function(mediaIndex, original, update) {
if
(
translatedMediaIndex
>=
update
.
segments
.
length
||
translatedMediaIndex
<
0
)
{
// recalculate the live point if the streams are too far out of sync
return
videojs
.
Hls
.
getMediaIndexForLive
(
update
)
+
1
;
return
videojs
.
Hls
.
getMediaIndexForLive
_
(
update
)
+
1
;
}
// sync on media sequence
...
...
@@ -999,7 +999,7 @@ videojs.Hls.getMediaIndexByTime = function(playlist, time) {
* @param mediaIndex {number} The index of the target segment in the playlist.
* @returns {number} The current time to that point, or 0 if none appropriate.
*/
videojs
.
Hls
.
prototype
.
getCurrentTimeByMediaIndex
=
function
(
playlist
,
mediaIndex
)
{
videojs
.
Hls
.
prototype
.
getCurrentTimeByMediaIndex
_
=
function
(
playlist
,
mediaIndex
)
{
var
index
,
time
=
0
;
if
(
!
playlist
.
segments
||
mediaIndex
===
0
)
{
...
...
Please
register
or
sign in
to post a comment