<commit_before>import { Component } from 'react'

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

export default class Base extends Component {
  static propTypes = propTypes
  static defaultProps = defaultProps
  componentDidMount () {
    if (this.props.url) {
      this.load(this.props.url)
    }
  }
  componentWillUnmount () {
    this.stop()
  }
  componentWillReceiveProps (nextProps) {
    // Invoke player methods based on incoming props
    if (this.props.url !== nextProps.url && nextProps.url) {
      this.load(nextProps.url, nextProps.playing)
      this.props.onProgress({ played: 0, loaded: 0 }) // Needed?
    } else if (this.props.url && !nextProps.url) {
      this.stop()
      clearTimeout(this.updateTimeout)
    } else if (!this.props.playing && nextProps.playing) {
      this.play()
    } else if (this.props.playing && !nextProps.playing) {
      this.pause()
    } else if (this.props.volume !== nextProps.volume) {
      this.setVolume(nextProps.volume)
    }
  }
  shouldComponentUpdate (nextProps) {
    return this.props.url !== nextProps.url
  }
  isReady = false
  onReady = () => {
    this.setVolume(this.props.volume)
    if (this.props.playing || this.preloading) {
      this.preloading = false
      this.isReady = true
      if (this.loadOnReady) {
        this.load(this.loadOnReady, this.props.playing)
      } else {
        this.play()
      }
    }
  }
}<commit_msg>Set isReady before setVolume in onReady<commit_after>import { Component } from 'react'

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

export default class Base extends Component {
  static propTypes = propTypes
  static defaultProps = defaultProps
  componentDidMount () {
    if (this.props.url) {
      this.load(this.props.url)
    }
  }
  componentWillUnmount () {
    this.stop()
  }
  componentWillReceiveProps (nextProps) {
    // Invoke player methods based on incoming props
    if (this.props.url !== nextProps.url && nextProps.url) {
      this.load(nextProps.url, nextProps.playing)
      this.props.onProgress({ played: 0, loaded: 0 }) // Needed?
    } else if (this.props.url && !nextProps.url) {
      this.stop()
      clearTimeout(this.updateTimeout)
    } else if (!this.props.playing && nextProps.playing) {
      this.play()
    } else if (this.props.playing && !nextProps.playing) {
      this.pause()
    } else if (this.props.volume !== nextProps.volume) {
      this.setVolume(nextProps.volume)
    }
  }
  shouldComponentUpdate (nextProps) {
    return this.props.url !== nextProps.url
  }
  isReady = false
  onReady = () => {
    this.isReady = true
    this.setVolume(this.props.volume)
    if (this.props.playing || this.preloading) {
      this.preloading = false
      if (this.loadOnReady) {
        this.load(this.loadOnReady, this.props.playing)
      } else {
        this.play()
      }
    }
  }
}
{'fraction_non_alphanumeric': 0.13095238095238096, 'fraction_numerical': 0.0014005602240896359, 'mean_word_length': 2.7395287958115184, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2715442', 'n_tokens_mistral': 917, 'n_tokens_neox': 899, 'n_words': 187}