mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 01:12:21 -08:00
fix(canvas): [PKG-CANVAS-04] preserve public type and export compatibility
This commit is contained in:
1 parent
2b319109cd
commit
224572032a
29 files changed
+682
-41
No files matched your search
@@ -0,0 +1,11 @@
|
||||
import Artplayer from 'artplayer'
|
||||
import canvas from 'artplayer-proxy-canvas'
|
||||
|
||||
const callback = (context: CanvasRenderingContext2D, video: HTMLVideoElement) => context.drawImage(video, 0, 0)
|
||||
const art = new Artplayer({ container: '#player', url: 'video.mp4', proxy: canvas(callback) })
|
||||
const result = canvas(callback)(art)
|
||||
const actual: HTMLCanvasElement = result
|
||||
const context: CanvasRenderingContext2D | null = result.getContext('2d')
|
||||
const accepted: Parameters<typeof canvas>[0] = callback
|
||||
const originalResult: ReturnType<ReturnType<typeof canvas>> = document.createElement('canvas')
|
||||
void [actual, context, accepted, originalResult]
|
||||
Reference in new issue
Block a user