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
2a4bb073
authored
2016-02-05 17:05:25 -0500
by
brandonocasey
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
removing linebreak after parens lines
1 parent
5a33fc57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
17 deletions
src/playlist-loader.js
src/playlist.js
src/playlist-loader.js
View file @
2a4bb07
...
...
@@ -74,11 +74,10 @@ const updateMaster = function(master, media) {
// if the update could overlap existing segment information,
// merge the two lists
if
(
playlist
.
segments
)
{
result
.
playlists
[
i
].
segments
=
updateSegments
(
playlist
.
segments
,
media
.
segments
,
media
.
mediaSequence
-
playlist
.
mediaSequence
);
result
.
playlists
[
i
].
segments
=
updateSegments
(
playlist
.
segments
,
media
.
segments
,
media
.
mediaSequence
-
playlist
.
mediaSequence
);
}
changed
=
true
;
}
...
...
@@ -518,9 +517,9 @@ export default class PlaylistLoader extends Stream {
// so fallback to interpolating between the segment index
// based on the known span of the timeline we are dealing with
// and the number of segments inside that span
return
startIndex
+
Math
.
floor
(
((
originalTime
-
knownStart
)
/
(
knownEnd
-
knownStart
))
*
(
endIndex
-
startIndex
));
return
startIndex
+
Math
.
floor
(
((
originalTime
-
knownStart
)
/
(
knownEnd
-
knownStart
))
*
(
endIndex
-
startIndex
));
}
// We _still_ haven't found a segment so load the last one
...
...
src/playlist.js
View file @
2a4bb07
...
...
@@ -152,11 +152,9 @@ export const duration = function(playlist, endSequence, includeTrailingTime) {
}
// calculate the total duration based on the segment durations
return
intervalDuration
(
playlist
,
endSequence
,
includeTrailingTime
);
return
intervalDuration
(
playlist
,
endSequence
,
includeTrailingTime
);
};
/**
...
...
@@ -187,10 +185,9 @@ export const seekable = function(playlist) {
// of content from the end of the playlist
// https://tools.ietf.org/html/draft-pantos-http-live-streaming-16#section-6.3.3
start
=
intervalDuration
(
playlist
,
playlist
.
mediaSequence
);
end
=
intervalDuration
(
playlist
,
playlist
.
mediaSequence
+
Math
.
max
(
0
,
playlist
.
segments
.
length
-
3
)
);
end
=
intervalDuration
(
playlist
,
playlist
.
mediaSequence
+
Math
.
max
(
0
,
playlist
.
segments
.
length
-
3
));
return
createTimeRange
(
start
,
end
);
};
...
...
Please
register
or
sign in
to post a comment