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:
parent
4d6d2f0479
commit
58f156e748
8 changed files with 320 additions and 5 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue