Skip to content

Commit

Permalink
fix: src sttribute become "undefinded" if url is an array (#1648)
Browse files Browse the repository at this point in the history
  • Loading branch information
Losses authored Aug 31, 2023
1 parent 2efb40a commit 12bd95c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/players/FilePlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -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()
Expand Down

0 comments on commit 12bd95c

Please sign in to comment.