Skip to content

Commit

Permalink
Merge pull request #29 from Peer5/v3.1.0
Browse files Browse the repository at this point in the history
Hls advanced usage
  • Loading branch information
mrbar42 authored Oct 22, 2017
2 parents 5160404 + 756fb67 commit c304063
Show file tree
Hide file tree
Showing 6 changed files with 2,521 additions and 8 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,32 @@ hls.js is [very configurable](https://github.com/dailymotion/hls.js/blob/master/
});
</script>
```

## Advanced Usage

### Listening to hls.js events

events are passed to the tech and can be subscribed to

```js
var player = videojs('video');
player.tech_.on(Hls.Events.MANIFEST_LOADED, function (e) {
// do something
})
```

full list of hls.js events can be found [here](https://github.com/video-dev/hls.js/blob/master/doc/API.md#runtime-events)

*NOTE* hls.js global is exposed to `window.Hls` when the module is loaded

### Custom hls.js configuration

**DO NOT USE THIS REF UNLESS YOU KNOW WHAT YOU ARE DOING**

the hls.js instance is exposed on the sourceHandler instance

```js
var player = videojs('video');
// player.tech_.sourceHandler_.hls is the underlying Hls instance
player.tech_.sourceHandler_.hls.currentLevel = -1
```
2 changes: 1 addition & 1 deletion dist/videojs-contrib-hlsjs.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/videojs-contrib-hlsjs.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit c304063

Please sign in to comment.