Skip to content

Commit

Permalink
Add forceAudio to fileConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
albanqoku committed May 7, 2017
1 parent 64f8f39 commit 51a05c2
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 @@ -114,7 +114,7 @@ Prop | Description
`youtubeConfig` | Configuration object for the YouTube player.<br />Set `playerVars` to override the [default player vars](https://developers.google.com/youtube/player_parameters?playerVersion=HTML5).<br />Set `preload` for [preloading](#preloading).
`vidmeConfig` | Configuration object for the Vidme player.<br />Set `format` to use a certain quality of video, when available.<br />Possible values: `240p`, `480p`, `720p`, `1080p`, `dash`, `hls`
`dailymotionConfig` | Configuration object for the DailyMotion player.<br />Set `params` to override the [default player vars](https://developer.dailymotion.com/player#player-parameters).<br />Set `preload` for [preloading](#preloading).
`fileConfig` | Configuration object for the file player.<br />Set `attributes` to apply [element attributes](https://developer.mozilla.org/en/docs/Web/HTML/Element/video#Attributes).
`fileConfig` | Configuration object for the file player.<br />Set `attributes` to apply [element attributes](https://developer.mozilla.org/en/docs/Web/HTML/Element/video#Attributes).<br />Set `forceAudio` to always render an `<audio>` element.
`facebookConfig` | Configuration object for the Facebook player.<br />Set `appId` to your own [Facebook app ID](https://developers.facebook.com/docs/apps/register#app-id).

##### 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 @@ -90,7 +90,7 @@ export default class FilePlayer extends Base {
}
render () {
const { url, loop, controls, fileConfig } = this.props
const Media = AUDIO_EXTENSIONS.test(url) ? 'audio' : 'video'
const Media = AUDIO_EXTENSIONS.test(url) || fileConfig.forceAudio ? 'audio' : 'video'
const style = {
width: '100%',
height: '100%',
Expand Down
6 changes: 4 additions & 2 deletions src/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export const propTypes = {
format: string
}),
fileConfig: shape({
attributes: object
attributes: object,
forceAudio: bool
}),
onReady: func,
onStart: func,
Expand Down Expand Up @@ -84,7 +85,8 @@ export const defaultProps = {
format: null
},
fileConfig: {
attributes: {}
attributes: {},
forceAudio: false
},
onReady: function () {},
onStart: function () {},
Expand Down

0 comments on commit 51a05c2

Please sign in to comment.