Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix embed with api enabled

Chocobozzz103505421fef
diff --git a/client/src/standalone/videos/embed-api.ts b/client/src/standalone/videos/embed-api.ts
index cc7b178db3..f7a46ddaeb 100644
--- a/client/src/standalone/videos/embed-api.ts
+++ b/client/src/standalone/videos/embed-api.ts
@@ -166,9 +166,9 @@ export class PeerTubeEmbedApi {
private disposeStateTracking () {
if (!this.player) return
- this.player.off('play', this.videoElPlayListener)
- this.player.off('pause', this.videoElPauseListener)
- this.player.off('ended', this.videoElEndedListener)
+ if (this.videoElPlayListener) this.player.off('play', this.videoElPlayListener)
+ if (this.videoElPauseListener) this.player.off('pause', this.videoElPauseListener)
+ if (this.videoElEndedListener) this.player.off('ended', this.videoElEndedListener)
clearInterval(this.videoElInterval)
}