Skip to content

Commit

Permalink
Fix youtube looping
Browse files Browse the repository at this point in the history
  • Loading branch information
Webmaster1116 committed Jun 13, 2019
1 parent a7ea9f9 commit 4c9a1bf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/players/YouTube.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@ export class YouTube extends Component {
...playerVars
},
events: {
onReady: this.props.onReady,
onReady: () => {
if (loop) {
this.player.setLoop(true) // Enable playlist looping
}
this.props.onReady()
},
onStateChange: this.onStateChange,
onError: event => onError(event.data)
},
...embedOptions
})
if (loop) {
this.player.setLoop(true) // Enable playlist looping
}
}, onError)
}
onStateChange = ({ data }) => {
Expand Down

0 comments on commit 4c9a1bf

Please sign in to comment.