Skip to content

Commit

Permalink
Fix 'deferred loading' when using urls ar array. Arrays are not prope…
Browse files Browse the repository at this point in the history
…rly tested for equality
  • Loading branch information
belgattitude committed Sep 20, 2018
1 parent 4cdb1a4 commit eaaea27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Player.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from 'react'

import { propTypes, defaultProps } from './props'
import { isEqual } from './utils'

const SEEK_ON_PLAY_EXPIRY = 5000

Expand Down Expand Up @@ -32,7 +33,7 @@ export default class Player extends Component {
componentWillReceiveProps (nextProps) {
// Invoke player methods based on incoming props
const { url, playing, volume, muted, playbackRate } = this.props
if (url !== nextProps.url) {
if (!isEqual(url, nextProps.url)) {
if (this.isLoading) {
console.warn(`ReactPlayer: the attempt to load ${nextProps.url} is being deferred until the player has loaded`)
this.loadOnReady = nextProps.url
Expand Down

0 comments on commit eaaea27

Please sign in to comment.