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
9c47ba5b
authored
2015-11-17 20:12:49 -0500
by
jrivera
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Start 3 segments from the end of the playlist instead of 3 target durations
1 parent
58b7c472
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
src/playlist.js
test/playlist_test.js
src/playlist.js
View file @
9c47ba5
...
...
@@ -141,8 +141,7 @@
// 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
+
playlist
.
segments
.
length
);
end
-=
(
playlist
.
targetDuration
||
DEFAULT_TARGET_DURATION
)
*
3
;
playlist
.
mediaSequence
+
Math
.
max
(
0
,
playlist
.
segments
.
length
-
3
));
end
=
Math
.
max
(
0
,
end
);
return
videojs
.
createTimeRange
(
start
,
end
);
};
...
...
test/playlist_test.js
View file @
9c47ba5
...
...
@@ -381,8 +381,8 @@
});
equal
(
seekable
.
start
(
0
),
0
,
'starts at the earliest available segment'
);
equal
(
seekable
.
end
(
0
),
9
-
(
2
*
3
),
'allows seeking no further than three
target duration
s from the end'
);
9
-
(
2
+
2
+
1
),
'allows seeking no further than three
segment
s from the end'
);
});
})(
window
,
window
.
videojs
);
...
...
Please
register
or
sign in
to post a comment