Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for other media sources and destinations (i.e encapsulate MSE concerns into buffer controller only) #60

Merged
merged 12 commits into from Nov 20, 2015
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions API.md
Expand Up @@ -32,7 +32,7 @@ let's
var video = document.getElementById('video');
var hls = new Hls();
// bind them together
hls.attachVideo(video);
hls.attachMedia(video);
// MSE_ATTACHED event is fired by hls object once MediaSource is ready
hls.on(Hls.Events.MSE_ATTACHED,function() {
console.log("video and hls.js are now bound together !");
Expand All @@ -53,7 +53,7 @@ you need to provide manifest URL as below:
var video = document.getElementById('video');
var hls = new Hls();
// bind them together
hls.attachVideo(video);
hls.attachMedia(video);
hls.on(Hls.Events.MSE_ATTACHED,function() {
console.log("video and hls.js are now bound together !");
hls.loadSource("http://my.streamURL.com/playlist.m3u8");
Expand Down Expand Up @@ -322,7 +322,7 @@ parameter should be a class providing 2 getter/setters and a destroy() method:

## Video Binding/Unbinding API

#### ```hls.attachVideo(videoElement)```
#### ```hls.attachMedia(videoElement)```
calling this method will :

- bind videoElement and hls instance,
Expand Down
4 changes: 2 additions & 2 deletions demo/index.html
Expand Up @@ -107,7 +107,7 @@ <h4> Playback Control </h4>
<button type="button" class="btn btn-sm btn-info" onclick="$('#video')[0].currentTime-=10">currentTime-=10</button>
<button type="button" class="btn btn-sm btn-info" onclick="$('#video')[0].currentTime=$('#seek_pos').val()">seek to </button>
<input type="text" id='seek_pos' size="8" onkeydown="if(window.event.keyCode=='13'){$('#video')[0].currentTime=$('#seek_pos').val();}"><br><br>
<button type="button" class="btn btn-xs btn-warning" onclick="hls.attachVideo($('#video')[0])">attach Video</button>
<button type="button" class="btn btn-xs btn-warning" onclick="hls.attachMedia($('#video')[0])">attach Video</button>
<button type="button" class="btn btn-xs btn-warning" onclick="hls.detachVideo()">detach Video</button><br>
<button type="button" class="btn btn-xs btn-warning" onclick="hls.startLoad()">recover Network Error</button>
<button type="button" class="btn btn-xs btn-warning" onclick="hls.recoverMediaError()">recover Media Error</button><br>
Expand Down Expand Up @@ -244,7 +244,7 @@ <h4> Stats Display </h4>
hls = new Hls({debug:true});
$("#HlsStatus").text('loading manifest and attaching video element...');
hls.loadSource(url);
hls.attachVideo(video);
hls.attachMedia(video);
hls.on(Hls.Events.MSE_ATTACHED,function() {
$("#HlsStatus").text('MediaSource attached...');
bufferingIdx = -1;
Expand Down
11 changes: 6 additions & 5 deletions package.json
Expand Up @@ -4,12 +4,12 @@
"description": "Media Source Extension - HLS library, by/for Dailymotion",
"homepage": "https://github.com/dailymotion/hls.js",
"authors": "Guillaume du Pontavice <guillaume.dupontavice@dailymotion.com>",
"repository" : {
"type" : "git",
"url" : "https://github.com/dailymotion/hls.js"
"repository": {
"type": "git",
"url": "https://github.com/dailymotion/hls.js"
},
"bugs" : {
"url" : "https://github.com/dailymotion/hls.js/issues"
"bugs": {
"url": "https://github.com/dailymotion/hls.js/issues"
},
"main": "src/hls.js",
"private": true,
Expand All @@ -35,6 +35,7 @@
},
"dependencies": {
"babelify": "^6.1.2",
"stream-browserify": "^2.0.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed ?

"webworkify": "^1.0.2"
},
"devDependencies": {
Expand Down