Skip to content

Commit

Permalink
Add config.file.hlsOptions
Browse files Browse the repository at this point in the history
Fixes #325
Fixes #319
  • Loading branch information
cookpete committed Feb 8, 2018
1 parent 74f8d5e commit 0cccf5e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Key | Options
`vimeo` | `playerOptions`: Override the [default params](https://developer.vimeo.com/player/embedding#universal-parameters)<br />`preload`: Used for [preloading](#preloading)
`wistia` | `options`: Override the [default player options](https://wistia.com/doc/embed-options#options_list)
`dailymotion` | `params`: Override the [default player vars](https://developer.dailymotion.com/player#player-parameters)<br />`preload`: Used for [preloading](#preloading)
`file` | `attributes`: Apply [element attributes](https://developer.mozilla.org/en/docs/Web/HTML/Element/video#Attributes)<br />`forceAudio`: Always render an `<audio>` element<br />`forceHLS`: Use [hls.js](https://github.com/video-dev/hls.js) for HLS streams<br />`forceDASH`: Always use [dash.js](https://github.com/Dash-Industry-Forum/dash.js) for DASH streams
`file` | `attributes`: Apply [element attributes](https://developer.mozilla.org/en/docs/Web/HTML/Element/video#Attributes)<br />`forceAudio`: Always render an `<audio>` element<br />`forceHLS`: Use [hls.js](https://github.com/video-dev/hls.js) for HLS streams<br />`forceDASH`: Always use [dash.js](https://github.com/Dash-Industry-Forum/dash.js) for DASH streams<br />`hlsOptions`: Override the [default `hls.js` options](https://github.com/video-dev/hls.js/blob/master/doc/API.md#fine-tuning)

##### Preloading

Expand Down
2 changes: 1 addition & 1 deletion src/players/FilePlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default class FilePlayer extends Component {
load (url) {
if (this.shouldUseHLS(url)) {
getSDK(HLS_SDK_URL, HLS_GLOBAL).then(Hls => {
this.hls = new Hls()
this.hls = new Hls(this.props.config.file.hlsOptions)
this.hls.loadSource(url)
this.hls.attachMedia(this.player)
})
Expand Down
6 changes: 4 additions & 2 deletions src/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export const propTypes = {
tracks: array,
forceAudio: bool,
forceHLS: bool,
forceDASH: bool
forceDASH: bool,
hlsOptions: object
}),
wistia: shape({
options: object
Expand Down Expand Up @@ -117,7 +118,8 @@ export const defaultProps = {
tracks: [],
forceAudio: false,
forceHLS: false,
forceDASH: false
forceDASH: false,
hlsOptions: {}
},
wistia: {
options: {}
Expand Down

0 comments on commit 0cccf5e

Please sign in to comment.