Skip to content

Commit

Permalink
- expose Hls constructor
Browse files Browse the repository at this point in the history
- update to latest hls.js
- add advanced hls usage examples to main doc
- minor fixes
- add package-lock.json
  • Loading branch information
mrbar42 committed Oct 22, 2017
1 parent 5160404 commit 756fb67
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 756fb67

Please sign in to comment.