Skip to content

Commit

Permalink
Merge pull request video-dev#116 from flavioribeiro/master
Browse files Browse the repository at this point in the history
Update event name prefix from MSE_ to MEDIA_
  • Loading branch information
mangui committed Dec 8, 2015
2 parents ca828c3 + 7f641df commit 8417f3a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ let's
var hls = new Hls();
// bind them together
hls.attachMedia(video);
// MSE_ATTACHED event is fired by hls object once MediaSource is ready
hls.on(Hls.Events.MSE_ATTACHED,function() {
// MEDIA_ATTACHED event is fired by hls object once MediaSource is ready
hls.on(Hls.Events.MEDIA_ATTACHED,function() {
console.log("video and hls.js are now bound together !");
});
}
Expand All @@ -54,7 +54,7 @@ you need to provide manifest URL as below:
var hls = new Hls();
// bind them together
hls.attachMedia(video);
hls.on(Hls.Events.MSE_ATTACHED,function() {
hls.on(Hls.Events.MEDIA_ATTACHED,function() {
console.log("video and hls.js are now bound together !");
hls.loadSource("http://my.streamURL.com/playlist.m3u8");
hls.on(Hls.Events.MANIFEST_PARSED, function(event,data) {
Expand Down Expand Up @@ -364,7 +364,7 @@ calling this method will :
- bind videoElement and hls instance,
- create MediaSource and set it as video source
- once MediaSource object is successfully created, MSE_ATTACHED event will be fired.
- once MediaSource object is successfully created, MEDIA_ATTACHED event will be fired.
#### ```hls.detachMedia()```
calling this method will :
Expand Down Expand Up @@ -496,7 +496,7 @@ full list of Events available below :
- data: {curentDropped : nb of dropped frames in last monitoring period, currentDecoded: nb of decoded frames in last monitoring period, totalDropped : total dropped frames on this video element}
- `Hls.Events.ERROR` - Identifier for an error event
- data: { type : error Type, details : error details, fatal : is error fatal or not, other error specific data}
- `Hls.Events.DESTROYING` - fired when hls.js instance starts destroying. Different from MSE_DETACHED as one could want to detach and reattach a video to the instance of hls.js to handle mid-rolls for example.
- `Hls.Events.DESTROYING` - fired when hls.js instance starts destroying. Different from MEDIA_DETACHED as one could want to detach and reattach a video to the instance of hls.js to handle mid-rolls for example.
- data: { }
Expand Down
2 changes: 1 addition & 1 deletion src/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default {
FPS_DROP: 'hlsFPSDrop',
// Identifier for an error event - data: { type : error type, details : error details, fatal : if true, hls.js cannot/will not try to recover, if false, hls.js will try to recover,other error specific data}
ERROR: 'hlsError',
// fired when hls.js instance starts destroying. Different from MSE_DETACHED as one could want to detach and reattach a media to the instance of hls.js to handle mid-rolls for example
// fired when hls.js instance starts destroying. Different from MEDIA_DETACHED as one could want to detach and reattach a media to the instance of hls.js to handle mid-rolls for example
DESTROYING: 'hlsDestroying',
// fired when a decrypt key loading starts - data: { frag : fragment object}
KEY_LOADING: 'hlsKeyLoading',
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/multiple/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
hls1 = new Hls({debug: true}),
hls2 = new Hls({debug: true});

hls1.on(Hls.Events.MSE_ATTACHED, function () {
hls1.on(Hls.Events.MEDIA_ATTACHED, function () {
hls1.loadSource("http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8");
});

hls2.on(Hls.Events.MSE_ATTACHED, function () {
hls2.on(Hls.Events.MEDIA_ATTACHED, function () {
hls2.loadSource("http://www.streambox.fr/playlists/x31jrg1/x31jrg1.m3u8");
});

Expand Down

0 comments on commit 8417f3a

Please sign in to comment.