Skip to content

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

Ensure we use the correct player video el

Chocobozzz121a617bec02
diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts
index d3407c7e6d..1861726925 100644
--- a/client/src/standalone/videos/embed.ts
+++ b/client/src/standalone/videos/embed.ts
@@ -434,15 +434,14 @@ export class PeerTubeEmbed {
}
getImageDataUrl (): string {
-
- const video = this.playerHTML.getInitVideoEl()
-
const canvas = document.createElement('canvas')
- canvas.width = video.videoWidth
- canvas.height = video.videoHeight
+ canvas.width = this.player.videoWidth()
+ canvas.height = this.player.videoHeight()
+
+ const videoEl = this.player.tech(true).el() as HTMLVideoElement
- canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height)
+ canvas.getContext('2d').drawImage(videoEl, 0, 0, canvas.width, canvas.height)
return canvas.toDataURL('image/jpeg')
}