1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 09:49:20 +02:00

feat-1322 Version 3 without server side code changes

This commit is contained in:
Kent Anderson 2024-05-29 13:46:19 -05:00 committed by Chocobozzz
parent 4d6d2f0479
commit 58f156e748
8 changed files with 320 additions and 5 deletions

View file

@ -432,6 +432,20 @@ export class PeerTubeEmbed {
this.player = this.peertubePlayer.getPlayer()
}
getImageDataUrl (): string {
const video = this.playerHTML.getInitVideoEl()
const canvas = document.createElement('canvas')
canvas.width = video.videoWidth
canvas.height = video.videoHeight
canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height)
return canvas.toDataURL('image/jpeg')
}
}
PeerTubeEmbed.main()