Skip to content

Commit

Permalink
Remove class property semicolons
Browse files Browse the repository at this point in the history
No longer necessary since latest release of standard
  • Loading branch information
cookpete committed May 19, 2016
1 parent fe8a871 commit 0c8070d
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
12 changes: 6 additions & 6 deletions src/ReactPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { propTypes, defaultProps } from './props'
import players from './players'

export default class ReactPlayer extends Component {
static displayName = 'ReactPlayer';
static propTypes = propTypes;
static defaultProps = defaultProps;
static displayName = 'ReactPlayer'
static propTypes = propTypes
static defaultProps = defaultProps
static canPlay (url) {
return players.some((player) => player.canPlay(url))
}
Expand All @@ -30,7 +30,7 @@ export default class ReactPlayer extends Component {
if (player) {
player.seekTo(fraction)
}
};
}
progress = () => {
if (this.props.url && this.refs.player) {
let progress = {}
Expand All @@ -47,7 +47,7 @@ export default class ReactPlayer extends Component {
}
}
this.progressTimeout = setTimeout(this.progress, this.props.progressFrequency)
};
}
renderPlayer = (Player) => {
const active = Player.canPlay(this.props.url)
const { youtubeConfig, soundcloudConfig, vimeoConfig, ...activeProps } = this.props
Expand All @@ -61,7 +61,7 @@ export default class ReactPlayer extends Component {
{...props}
/>
)
};
}
render () {
const style = {
width: this.props.width,
Expand Down
22 changes: 11 additions & 11 deletions src/demo/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,39 @@ export default class App extends Component {
played: 0,
loaded: 0,
duration: 0
};
}
load = (url) => {
this.setState({
url,
played: 0,
loaded: 0
})
};
}
playPause = () => {
this.setState({ playing: !this.state.playing })
};
}
stop = () => {
this.setState({ url: null, playing: false })
};
}
setVolume = (e) => {
this.setState({ volume: parseFloat(e.target.value) })
};
}
onSeekMouseDown = (e) => {
this.setState({ seeking: true })
};
}
onSeekChange = (e) => {
this.setState({ played: parseFloat(e.target.value) })
};
}
onSeekMouseUp = (e) => {
this.setState({ seeking: false })
this.refs.player.seekTo(parseFloat(e.target.value))
};
}
onProgress = (state) => {
// We only want to update time slider if we are not currently seeking
if (!this.state.seeking) {
this.setState(state)
}
};
}
onConfigSubmit = () => {
let config
try {
Expand All @@ -59,14 +59,14 @@ export default class App extends Component {
console.error('Error setting config:', error)
}
this.setState(config)
};
}
renderLoadButton = (url, label) => {
return (
<button onClick={() => this.load(url)}>
{label}
</button>
)
};
}
render () {
const {
url, playing, volume,
Expand Down
10 changes: 5 additions & 5 deletions src/players/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { propTypes, defaultProps } from '../props'
const SEEK_ON_READY_EXPIRY = 5000

export default class Base extends Component {
static propTypes = propTypes;
static defaultProps = defaultProps;
static propTypes = propTypes
static defaultProps = defaultProps
componentDidMount () {
if (this.props.url) {
this.load(this.props.url)
Expand Down Expand Up @@ -34,7 +34,7 @@ export default class Base extends Component {
shouldComponentUpdate (nextProps) {
return this.props.url !== nextProps.url
}
isReady = false;
isReady = false
seekTo (fraction) {
// When seeking before player is ready, store value and seek later
if (!this.isReady && fraction !== 0) {
Expand All @@ -50,7 +50,7 @@ export default class Base extends Component {
this.seekOnReady = null
}
this.props.onDuration(this.getDuration())
};
}
onReady = () => {
this.isReady = true
if (this.props.playing || this.preloading) {
Expand All @@ -62,5 +62,5 @@ export default class Base extends Component {
this.play()
}
}
};
}
}
2 changes: 1 addition & 1 deletion src/players/FilePlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm)($|\?)/
const AUDIO_EXTENSIONS = /\.(mp3|wav)($|\?)/

export default class FilePlayer extends Base {
static displayName = 'FilePlayer';
static displayName = 'FilePlayer'
static canPlay (url) {
return VIDEO_EXTENSIONS.test(url) || AUDIO_EXTENSIONS.test(url)
}
Expand Down
6 changes: 3 additions & 3 deletions src/players/SoundCloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const MATCH_URL = /^https?:\/\/(soundcloud.com|snd.sc)\/([a-z0-9-_]+\/[a-z0-9-_]
const songData = {} // Cache song data requests

export default class SoundCloud extends Base {
static displayName = 'SoundCloud';
static displayName = 'SoundCloud'
static canPlay (url) {
return MATCH_URL.test(url)
}
state = {
image: null
};
}
shouldComponentUpdate (nextProps, nextState) {
return (
super.shouldComponentUpdate(nextProps, nextState) ||
Expand Down Expand Up @@ -83,7 +83,7 @@ export default class SoundCloud extends Base {
if (state === 'paused') this.props.onPause()
if (state === 'loading') this.props.onBuffer()
if (state === 'ended') this.props.onEnded()
};
}
play () {
if (!this.isReady) return
this.player.play()
Expand Down
6 changes: 3 additions & 3 deletions src/players/Vimeo.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const DEFAULT_IFRAME_PARAMS = {
}

export default class Vimeo extends Base {
static displayName = 'Vimeo';
static displayName = 'Vimeo'
static canPlay (url) {
return MATCH_URL.test(url)
}
Expand Down Expand Up @@ -86,12 +86,12 @@ export default class Vimeo extends Base {
this.duration = data.value // Store for use later
this.onReady()
}
};
}
postMessage = (method, value) => {
if (!this.origin) return
const data = JSON.stringify({ method, value })
return this.iframe.contentWindow && this.iframe.contentWindow.postMessage(data, this.origin)
};
}
render () {
const { fullscreen } = this.getIframeParams()
const style = {
Expand Down
6 changes: 3 additions & 3 deletions src/players/YouTube.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const DEFAULT_PLAYER_VARS = {
let playerIdCount = 0

export default class YouTube extends Base {
static displayName = 'YouTube';
static displayName = 'YouTube'
static canPlay (url) {
return MATCH_URL.test(url)
}
playerId = PLAYER_ID + '-' + playerIdCount++;
playerId = PLAYER_ID + '-' + playerIdCount++
componentDidMount () {
if (!this.props.url && this.props.youtubeConfig.preload) {
this.preloading = true
Expand Down Expand Up @@ -92,7 +92,7 @@ export default class YouTube extends Base {
if (data === BUFFERING) this.props.onBuffer()
if (data === ENDED) this.props.onEnded()
if (data === CUED) this.onReady()
};
}
play () {
if (!this.isReady || !this.player.playVideo) return
this.player.playVideo()
Expand Down

0 comments on commit 0c8070d

Please sign in to comment.