@front10/canvas-video-player
Advanced tools
Comparing version 1.3.3 to 1.3.5
{ | ||
"name": "@front10/canvas-video-player", | ||
"version": "1.3.3", | ||
"version": "1.3.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,2 +22,3 @@ import gsap from 'gsap'; | ||
try { | ||
obj.item(0).set({ dirty: true }); | ||
canvas.renderAll.bind(canvas)(); | ||
@@ -32,2 +33,3 @@ } catch (error) { } | ||
try { | ||
obj.item(0).set({ dirty: true }); | ||
canvas.renderAll.bind(canvas)(); | ||
@@ -42,2 +44,3 @@ } catch (error) { } | ||
try { | ||
obj.item(0).set({ dirty: true }); | ||
canvas.renderAll.bind(canvas)(); | ||
@@ -52,2 +55,3 @@ } catch (error) { } | ||
try { | ||
obj.item(0).set({ dirty: true }); | ||
canvas.renderAll.bind(canvas)(); | ||
@@ -54,0 +58,0 @@ } catch (error) { } |
@@ -17,3 +17,7 @@ import { colorStops } from "../../helpers/fabric"; | ||
config: { | ||
colors | ||
colors, | ||
listeners: { | ||
onReady, | ||
onError | ||
} | ||
} }) { | ||
@@ -116,4 +120,7 @@ try { | ||
me.object = backgroundBox; | ||
setTimeout(() => { | ||
onReady(); | ||
}); | ||
} catch (error) { | ||
onError(); | ||
} | ||
@@ -120,0 +127,0 @@ } |
@@ -17,3 +17,7 @@ import { colorStops } from "../../helpers/fabric"; | ||
config: { | ||
colors | ||
colors, | ||
listeners: { | ||
onReady, | ||
onError | ||
} | ||
} }) { | ||
@@ -65,3 +69,8 @@ try { | ||
me.object = backgroundBox; | ||
} catch (error) { } | ||
setTimeout(() => { | ||
onReady(); | ||
}); | ||
} catch (error) { | ||
onError(); | ||
} | ||
} | ||
@@ -68,0 +77,0 @@ } |
@@ -17,3 +17,7 @@ import { colorStops } from "../../helpers/fabric"; | ||
config: { | ||
colors | ||
colors, | ||
listeners: { | ||
onReady, | ||
onError | ||
} | ||
} }) { | ||
@@ -79,3 +83,8 @@ try { | ||
me.object = backgroundBox; | ||
} catch (error) { } | ||
setTimeout(() => { | ||
onReady(); | ||
}); | ||
} catch (error) { | ||
onError(); | ||
} | ||
} | ||
@@ -82,0 +91,0 @@ } |
@@ -18,3 +18,7 @@ import { colorStops } from "../../helpers/fabric"; | ||
colors, | ||
svg | ||
svg, | ||
listeners: { | ||
onReady, | ||
onError | ||
} | ||
} }) { | ||
@@ -41,4 +45,4 @@ try { | ||
const shadow = new fabric.Shadow({ | ||
color: "rgba(0, 0, 0, .05)", | ||
blur: 0, | ||
color: "rgba(0, 0, 0, .07)", | ||
blur: 7, | ||
offsetX: 7, | ||
@@ -67,33 +71,39 @@ }); | ||
const bgG = new fabric.Group([...figures], { | ||
originX: "center", | ||
originY: "center", | ||
const group = new fabric.Group([...figures]); | ||
fabric.Image.fromURL(group.toDataURL(), (image) => { | ||
const backgroundBox = new fabric.Group([image], { | ||
selectable: false, | ||
_selectable: false, | ||
cache: false, | ||
hasRotatingPoint: false, | ||
editable: false, | ||
hasControls: false, | ||
hoverCursor: "default", | ||
isGradient: true, | ||
zIndex: 0, | ||
anime: (canvas, status, time, maxDurationTime) => { | ||
try { | ||
gradient_svg({ | ||
obj: me.object, | ||
canvas, | ||
status, | ||
maxDurationTime, | ||
time | ||
}); | ||
} catch (error) { console.log(error) } | ||
} | ||
}); | ||
me.object = backgroundBox; | ||
onReady(); | ||
}, { | ||
crossOrigin: 'Anonymous', | ||
originX: 'center', | ||
originY: 'center', | ||
top: _height / 2, | ||
left: _width / 2, | ||
}); | ||
const backgroundBox = new fabric.Group([bgG], { | ||
selectable: false, | ||
_selectable: false, | ||
cache: false, | ||
hasRotatingPoint: false, | ||
editable: false, | ||
hasControls: false, | ||
hoverCursor: "default", | ||
isGradient: true, | ||
zIndex: 0, | ||
anime: (canvas, status, time, maxDurationTime) => { | ||
try { | ||
gradient_svg({ | ||
obj: me.object, | ||
canvas, | ||
status, | ||
maxDurationTime, | ||
time | ||
}); | ||
} catch (error) { console.log(error) } | ||
} | ||
}); | ||
me.object = backgroundBox; | ||
} catch (error) { } | ||
} catch (error) { | ||
onError(); | ||
} | ||
} | ||
@@ -100,0 +110,0 @@ } |
@@ -17,3 +17,7 @@ import { colorStops } from "../../helpers/fabric"; | ||
config: { | ||
colors | ||
colors, | ||
listeners: { | ||
onReady, | ||
onError | ||
} | ||
} }) { | ||
@@ -122,3 +126,8 @@ try { | ||
me.object = backgroundBox; | ||
} catch (error) { } | ||
setTimeout(() => { | ||
onReady(); | ||
}); | ||
} catch (error) { | ||
onError(); | ||
} | ||
} | ||
@@ -125,0 +134,0 @@ } |
@@ -8,2 +8,3 @@ import ObjectBase from "./Object"; | ||
import { loadSVG } from "../../helpers/videos_V2"; | ||
import { isFunction } from "../../helpers/javascript"; | ||
@@ -55,13 +56,20 @@ const images = { | ||
colors: me.colors, | ||
svg | ||
svg, | ||
listeners: { | ||
onError: () => { | ||
if (isFunction(me.onReady)) | ||
me.onReady({ id: me.id }); | ||
}, | ||
onReady: () => { | ||
me.background.addToCanvas(me.canvas); | ||
me.background.sortLayers(me.canvas); | ||
if (me.animated) | ||
me.background.anime(me.canvas, me.status, time, me.duration); | ||
me.background.createCover(me.canvas, me.fabric, ({ cover }) => { | ||
me.onReady({ id: me.id, cover }) | ||
}); | ||
} | ||
} | ||
} | ||
}); | ||
me.background.addToCanvas(me.canvas); | ||
me.background.sortLayers(me.canvas); | ||
if (me.animated) | ||
me.background.anime(me.canvas, me.status, time, me.duration); | ||
me.background.createCover(me.canvas, me.fabric, ({ cover }) => { | ||
me.onReady({ id: me.id, cover }) | ||
}); | ||
}; | ||
@@ -68,0 +76,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
528055
15149