mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 12:41:20 -08:00
feat: createImageBitmap
This commit is contained in:
1 parent
710f9477f8
commit
a74e7bbff4
5 files changed
+15
-13
No files matched your search
@@ -63,9 +63,13 @@ export default function artplayerProxyCanvas() {
|
||||
|
||||
async function draw() {
|
||||
try {
|
||||
const bitmap = await createImageBitmap(video);
|
||||
ctx.drawImage(bitmap, 0, 0, canvas.width, canvas.height);
|
||||
bitmap.close();
|
||||
if (typeof createImageBitmap !== 'undefined') {
|
||||
const bitmap = await createImageBitmap(video);
|
||||
ctx.drawImage(bitmap, 0, 0, canvas.width, canvas.height);
|
||||
bitmap.close();
|
||||
} else {
|
||||
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
||||
}
|
||||
art.emit('artplayerProxyCanvas:draw', ctx);
|
||||
} catch (error) {
|
||||
art.emit('artplayerProxyCanvas:error', error);
|
||||
|
||||
Reference in new issue
Block a user