Skip to content

Commit 5d22a19

Browse files
committed
Destroy previous vidyard player before creating new one
1 parent 32bb251 commit 5d22a19

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/players/Vidyard.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ export default class Vidyard extends Component {
1515
this.props.onMount && this.props.onMount(this)
1616
}
1717

18-
load (url, isReady) {
18+
load (url) {
1919
const { config, onError, onDuration } = this.props
2020
const id = url && url.match(MATCH_URL_VIDYARD)[1]
21+
if (this.player) {
22+
this.stop()
23+
}
2124
getSDK(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(Vidyard => {
2225
if (!this.container) return
2326
Vidyard.api.addReadyListener((data, player) => {
@@ -50,6 +53,7 @@ export default class Vidyard extends Component {
5053

5154
stop () {
5255
window.VidyardV4.api.destroyPlayer(this.player)
56+
delete this.player
5357
}
5458

5559
seekTo (amount) {

0 commit comments

Comments
 (0)