Skip to content

Commit

Permalink
Destroy previous vidyard player before creating new one (#894)
Browse files Browse the repository at this point in the history
* Destroy previous vidyard player before creating new one

* Remove delete statement

Co-authored-by: Pete Cook <pete@cookpete.com>
  • Loading branch information
webmiraclepro and cookpete committed May 22, 2020
1 parent 8bf183c commit f33fd93
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/players/Vidyard.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ export default class Vidyard extends Component {
this.props.onMount && this.props.onMount(this)
}

load (url, isReady) {
load (url) {
const { config, onError, onDuration } = this.props
const id = url && url.match(MATCH_URL_VIDYARD)[1]
if (this.player) {
this.stop()
}
getSDK(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(Vidyard => {
if (!this.container) return
Vidyard.api.addReadyListener((data, player) => {
Expand Down

0 comments on commit f33fd93

Please sign in to comment.