mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-22 21:31:20 -08:00
feat: update artplayerProxyCanvas to accept a callback for custom rendering options
This commit is contained in:
1 parent
92654e911f
commit
1605df2943
4 files changed
+10
-4
No files matched your search
@@ -146,7 +146,7 @@
|
||||
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
|
||||
parcelHelpers.defineInteropFlag(exports);
|
||||
parcelHelpers.export(exports, "default", ()=>artplayerProxyCanvas);
|
||||
function artplayerProxyCanvas() {
|
||||
function artplayerProxyCanvas(callback) {
|
||||
return (art)=>{
|
||||
const { constructor } = art;
|
||||
const { createElement } = constructor.utils;
|
||||
@@ -191,6 +191,7 @@ function artplayerProxyCanvas() {
|
||||
ctx.drawImage(bitmap, 0, 0, canvas.width, canvas.height);
|
||||
bitmap.close();
|
||||
} else ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
||||
callback && callback(ctx, video);
|
||||
art.emit("artplayerProxyCanvas:draw", ctx, video);
|
||||
} catch (error) {
|
||||
art.emit("artplayerProxyCanvas:error", error);
|
||||
|
||||
Reference in new issue
Block a user