diff --git a/src/players/FilePlayer.js b/src/players/FilePlayer.js index 71a66e67..7ecd2e9b 100644 --- a/src/players/FilePlayer.js +++ b/src/players/FilePlayer.js @@ -24,7 +24,10 @@ export default class FilePlayer extends Component { componentDidMount () { this.props.onMount && this.props.onMount(this) this.addListeners(this.player) - this.player.src = this.getSource(this.props.url) // Ensure src is set in strict mode + const src = this.getSource(this.props.url) // Ensure src is set in strict mode + if (src) { + this.player.src = src + } if (IS_IOS || this.props.config.forceDisableHls) { this.player.load() } @@ -45,7 +48,7 @@ export default class FilePlayer extends Component { } componentWillUnmount () { - this.player.src = '' + this.player.removeAttribute('src') this.removeListeners(this.player) if (this.hls) { this.hls.destroy()