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
1541a1dc
authored
2013-10-23 13:17:44 -0700
by
David LaPalomento
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Working example!
The single-segment example works.
1 parent
fbb6a663
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
example.html
example.html
View file @
1541a1d
...
...
@@ -71,14 +71,14 @@
mediaSource
=
new
videojs
.
MediaSource
();
mediaSource
.
addEventListener
(
'sourceopen'
,
function
(
event
){
var
tag
,
bytes
,
parser
,
i
,
feedBytes
,
everything
,
old
;
var
tag
,
bytes
,
parser
,
i
,
everything
,
old
;
// feed parsed bytes into the player
var
sourceBuffer
=
mediaSource
.
addSourceBuffer
(
'video/flv; codecs="vp6,aac"'
);
parser
=
new
videojs
.
hls
.
SegmentParser
();
// var header = parser.getFlvHeader();
everything
=
parser
.
getFlvHeader
();
// sourceBuffer.appendBuffer(header);
// sourceBuffer.appendBuffer(header
, video
);
parser
.
parseSegmentBinaryData
(
window
.
bcSegment
);
...
...
@@ -90,12 +90,12 @@
everything
.
set
(
tag
.
bytes
,
old
.
byteLength
);
}
console
.
log
(
'sending '
+
everything
.
byteLength
+
'B'
);
var
iframe
=
document
.
createElement
(
'iframe'
);
iframe
.
src
=
'data:video/x-flv;base64,'
+
window
.
btoa
((
Array
.
prototype
.
map
.
call
(
everything
,
function
(
byte
)
{
return
String
.
fromCharCode
(
byte
);
})).
join
(
''
));
document
.
body
.
appendChild
(
iframe
);
//
sourceBuffer.appendBuffer(everything, video);
//
var iframe = document.createElement('iframe');
//
iframe.src = 'data:video/x-flv;base64,' + window.btoa((Array.prototype.map.call(everything, function(byte) {
//
return String.fromCharCode(byte);
//
})).join(''));
//
document.body.appendChild(iframe);
sourceBuffer
.
appendBuffer
(
everything
,
video
);
},
false
);
url
=
videojs
.
URL
.
createObjectURL
(
mediaSource
);
...
...
Please
register
or
sign in
to post a comment