aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/standalone/videos/embed-api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/standalone/videos/embed-api.ts')
-rw-r--r--client/src/standalone/videos/embed-api.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/client/src/standalone/videos/embed-api.ts b/client/src/standalone/videos/embed-api.ts
index 61e5d0b9a..c5fbe07fa 100644
--- a/client/src/standalone/videos/embed-api.ts
+++ b/client/src/standalone/videos/embed-api.ts
@@ -80,7 +80,7 @@ export class PeerTubeEmbedApi {
80 } 80 }
81 81
82 private setupStateTracking () { 82 private setupStateTracking () {
83 let currentState: 'playing' | 'paused' | 'unstarted' = 'unstarted' 83 let currentState: 'playing' | 'paused' | 'unstarted' | 'ended' = 'unstarted'
84 84
85 setInterval(() => { 85 setInterval(() => {
86 const position = this.element.currentTime 86 const position = this.element.currentTime
@@ -106,6 +106,11 @@ export class PeerTubeEmbedApi {
106 this.channel.notify({ method: 'playbackStatusChange', params: 'paused' }) 106 this.channel.notify({ method: 'playbackStatusChange', params: 'paused' })
107 }) 107 })
108 108
109 this.element.addEventListener('ended', ev => {
110 currentState = 'ended'
111 this.channel.notify({ method: 'playbackStatusChange', params: 'ended' })
112 })
113
109 // PeerTube specific capabilities 114 // PeerTube specific capabilities
110 115
111 if (this.isWebtorrent()) { 116 if (this.isWebtorrent()) {