Skip to content

Commit

Permalink
better commonjs example
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbar42 committed Apr 26, 2017
1 parent 850ead1 commit 58233ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ Get a copy of [videojs-contrib-hls](#installation) and include it in your page a
</script>
```

in a CommonJS app

```js
var videojs = require('video.js');
require('videojs-contrib-media-sources'); // increase browser support with MSE polyfill
require('videojs-contrib-hlsjs'); // auto attaches hlsjs handler

var player = videojs('#player');

```

## Options
hls.js is [very configurable](https://github.com/dailymotion/hls.js/blob/master/API.md#fine-tuning), you may pass in an options object to the source handler at player initialization. You can pass in options just like you would for other parts of video.js:

Expand Down
4 changes: 1 addition & 3 deletions examples/commonjs-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ require('videojs-contrib-media-sources'); // increase browser support with MSE p
require('videojs-contrib-hlsjs'); // auto attaches hlsjs handler


window.onload = function() {
var player = videojs('#player');
};
var player = videojs('#player');

0 comments on commit 58233ca

Please sign in to comment.