Skip to content

Commit

Permalink
Destroy previous vidyard player before creating new one
Browse files Browse the repository at this point in the history
  • Loading branch information
schipiga committed May 22, 2020
1 parent 32bb251 commit 0973658
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/players/Vidyard.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export default class Vidyard extends Component {
load (url, isReady) {
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 Expand Up @@ -50,6 +53,7 @@ export default class Vidyard extends Component {

stop () {
window.VidyardV4.api.destroyPlayer(this.player)
delete this.player
}

seekTo (amount) {
Expand Down

0 comments on commit 0973658

Please sign in to comment.