mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-09-11 13:37:10 +03:00
Ensure we use the correct player video el
This commit is contained in:
parent
4a67994775
commit
121a617bec
@ -434,15 +434,14 @@ export class PeerTubeEmbed {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getImageDataUrl (): string {
|
getImageDataUrl (): string {
|
||||||
|
|
||||||
const video = this.playerHTML.getInitVideoEl()
|
|
||||||
|
|
||||||
const canvas = document.createElement('canvas')
|
const canvas = document.createElement('canvas')
|
||||||
|
|
||||||
canvas.width = video.videoWidth
|
canvas.width = this.player.videoWidth()
|
||||||
canvas.height = video.videoHeight
|
canvas.height = this.player.videoHeight()
|
||||||
|
|
||||||
canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height)
|
const videoEl = this.player.tech(true).el() as HTMLVideoElement
|
||||||
|
|
||||||
|
canvas.getContext('2d').drawImage(videoEl, 0, 0, canvas.width, canvas.height)
|
||||||
|
|
||||||
return canvas.toDataURL('image/jpeg')
|
return canvas.toDataURL('image/jpeg')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user