Skip to content

Commit

Permalink
Improve .gitignore, remove unused acorn dev dep, improve comment …
Browse files Browse the repository at this point in the history
…and add test for no `video.src` (#777)
  • Loading branch information
MatthewHerbst authored Dec 25, 2024
1 parent 1541738 commit fc02314
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ node_modules
.npmrc

# Build Data
dist/*
es/*
lib/*
dist
es
lib

# Optional REPL history
.node_repl_history
Expand Down
8 changes: 8 additions & 0 deletions examples/ComponentToPrint/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ export const ComponentToPrint = React.forwardRef<HTMLDivElement | null, Componen
/>
</td>
</tr>
<tr>
<td>Video: Without src</td>
<td>
<video
width="200"
/>
</td>
</tr>
</tbody>
</table>
<div ref={shadowRootHostEl}/>
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"@eslint/js": "^9.17.0",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"acorn": "^8.14.0",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.2",
Expand Down
3 changes: 2 additions & 1 deletion src/utils/handlePrintWindowOnLoad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ export function handlePrintWindowOnLoad(
if (videoNode.readyState >= 2) { // Check if the video has already loaded a frame
markLoaded(videoNode);
} else if (!videoNode.src) {
markLoaded(videoNode, ["video src empty", videoNode, "Error"]);
// There are scenarios where `src` can be empty, for example with lazy loading.
markLoaded(videoNode, ["Error loading video, `src` is empty", videoNode]);
} else{
videoNode.onloadeddata = () => {
markLoaded(videoNode)
Expand Down

0 comments on commit fc02314

Please sign in to comment.