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
e22b9e82
authored
2014-01-08 15:59:30 -0800
by
Tom Johnson
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
code cleanup for intra seek, needs newest SWF
1 parent
b910b291
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
src/videojs-hls.js
src/videojs-hls.js
View file @
e22b9e8
...
...
@@ -112,7 +112,7 @@ var
player
.
currentTime
=
function
(
value
)
{
if
(
value
)
{
try
{
player
.
el
().
getElementsByClassName
(
'vjs-tech'
)[
0
].
vjs_setProperty
(
'currentTime'
,
0
);
player
.
el
().
getElementsByClassName
(
'vjs-tech'
)[
0
].
vjs_setProperty
(
'currentTime'
,
value
);
player
.
el
().
getElementsByClassName
(
'vjs-tech'
)[
0
].
vjs_setProperty
(
'appendBytesAction'
,
'resetSeek'
);
player
.
el
().
getElementsByClassName
(
'vjs-tech'
)[
0
].
vjs_setProperty
(
'appendBytesAction'
,
'resetBegin'
);
}
catch
(
err
)
{
...
...
@@ -120,7 +120,6 @@ var
}
player
.
hls
.
sourceBuffer
.
appendBuffer
(
segmentParser
.
getFlvHeader
());
player
.
hls
.
mediaIndex
=
player
.
hls
.
selectSegmentIndexByTime
(
value
);
console
.
log
(
value
,
parseInt
(
value
-
player
.
hls
.
getSegmentByTime
(
value
).
timeRange
.
start
,
10
));
fillBuffer
(
parseInt
(
value
-
player
.
hls
.
getSegmentByTime
(
value
).
timeRange
.
start
,
10
));
}
else
{
try
{
...
...
@@ -352,14 +351,14 @@ var
console.log(player.hls.selectPlaylist().segments[player.hls.mediaIndex].duration);
console.log((segmentParser.getTags().length/player.hls.selectPlaylist().segments[player.hls.mediaIndex].duration)*gotoSecond);
*/
var
se
gmentCount
=
100
;
//(segmentParser.getTags().length/player.hls.selectPlaylist().segments[player.hls.mediaIndex].duration)*gotoSecond
;
var
xx
=
0
;
var
se
ekToTagIndex
=
parseInt
((
segmentParser
.
getTags
().
length
/
player
.
hls
.
selectPlaylist
().
segments
[
player
.
hls
.
mediaIndex
].
duration
)
*
gotoSecond
,
10
)
;
var
seekToTagCounter
=
0
;
//drain until where you want in the buffer
while
(
xx
<
segmentCount
)
while
(
seekToTagCounter
<
seekToTagIndex
)
{
segmentParser
.
getNextTag
();
xx
++
;
seekToTagCounter
++
;
}
}
...
...
@@ -367,6 +366,18 @@ var
player
.
hls
.
sourceBuffer
.
appendBuffer
(
segmentParser
.
getNextTag
().
bytes
,
player
);
}
/*
if(player.hls.mediaIndex === player.hsl.selectPlaylist.segments.length-1)
{
try {
// TODO - Still need to test this. This tells the Flash Player the stream is over
// player.el().getElementsByClassName('vjs-tech')[0].vjs_setProperty('appendBytesAction', 'endSequence');
} catch(err) {
}
}
*/
segmentXhr
=
null
;
player
.
hls
.
mediaIndex
++
;
...
...
Please
register
or
sign in
to post a comment