From b59d251b1323d97d2494bc4a7fd65a12905a4ba5 Mon Sep 17 00:00:00 2001 From: Pete Cook Date: Thu, 13 Jul 2017 08:20:50 +0100 Subject: [PATCH] Pass through auto or falsey width and height to FilePlayer Fixes https://github.com/CookPete/react-player/issues/211 --- src/players/FilePlayer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/players/FilePlayer.js b/src/players/FilePlayer.js index 13672813..038090a2 100644 --- a/src/players/FilePlayer.js +++ b/src/players/FilePlayer.js @@ -108,15 +108,15 @@ export default class FilePlayer extends Base { this.player = player } render () { - const { url, loop, controls, fileConfig } = this.props + const { url, loop, controls, fileConfig, width, height } = this.props const useAudio = AUDIO_EXTENSIONS.test(url) || fileConfig.forceAudio const useHLS = this.shouldUseHLS(url) const useDASH = this.shouldUseDASH(url) const Element = useAudio ? 'audio' : 'video' const src = url instanceof Array || useHLS || useDASH ? undefined : url const style = { - width: '100%', - height: '100%', + width: !width || width === 'auto' ? width : '100%', + height: !height || height === 'auto' ? height : '100%', display: url ? 'block' : 'none' } return (