Skip to content

Commit

Permalink
Merge pull request #1 from intuiface/hotfix/FixVideoAndModelViewer
Browse files Browse the repository at this point in the history
Fix video and model viewer
  • Loading branch information
nicolas-daures authored Feb 8, 2024
2 parents 9965314 + d565695 commit 3a15ed4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "html-to-image-mod",
"version": "1.11.11-1",
"version": "1.11.11-2",
"description": "Generates an image from a DOM node using HTML5 canvas and SVG. This is a fork which fixes #345 from original Repo (bubkoo/html-to-image) ",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/clone-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function cloneCanvasElement(canvas: HTMLCanvasElement) {
}

async function cloneVideoElement(video: HTMLVideoElement, options: Options) {
if (video.currentSrc) {
if (video.currentSrc && (video.poster == null || video.poster === '' || video.currentTime > 0)) {
const canvas = document.createElement('canvas')
const ctx = canvas.getContext('2d')
canvas.width = video.clientWidth
Expand Down Expand Up @@ -74,7 +74,7 @@ async function cloneChildren<T extends HTMLElement>(
): Promise<T> {
let children: T[] = []

if (isSlotElement(nativeNode) && nativeNode.assignedNodes) {
if (isSlotElement(nativeNode) && nativeNode.assignedNodes && nativeNode.assignedNodes().length > 0) {
children = toArray<T>(nativeNode.assignedNodes())
} else if (
isInstanceOfElement(nativeNode, HTMLIFrameElement) &&
Expand Down

0 comments on commit 3a15ed4

Please sign in to comment.