Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/players/Twitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ export class Twitch extends Component {
muted: this.props.muted,
...config.twitch.options
})
const { READY, PLAYING, PAUSE, ENDED } = Twitch.Player
const { READY, PLAYING, PAUSE, ENDED, ONLINE, OFFLINE } = Twitch.Player
this.player.addEventListener(READY, this.props.onReady)
this.player.addEventListener(PLAYING, this.props.onPlay)
this.player.addEventListener(PAUSE, this.props.onPause)
this.player.addEventListener(ENDED, this.props.onEnded)

// Prevent weird isLoading behaviour when streams are offline
this.player.addEventListener(ONLINE, this.props.onLoaded)
this.player.addEventListener(OFFLINE, this.props.onLoaded)
}, onError)
}
play () {
Expand Down