single-file-core 1.6.33 → 1.6.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/core/index.js +3 -2
  2. package/package.json +1 -1
package/core/index.js CHANGED
@@ -1323,7 +1323,8 @@ class Processor {
1323
1323
  const blankPosterURI = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='" +
1324
1324
  (videoData.size.videoWidth || videoData.size.pxWidth) + "' height='" +
1325
1325
  (videoData.size.videoHeight || videoData.size.pxHeight) + "'%3E%3C/svg%3E";
1326
- if (!this.options.doc) {
1326
+ const liveDoc = this.options.doc || (this.options.win && this.options.win.document);
1327
+ if (!liveDoc) {
1327
1328
  videoElement.poster = this.registerGeneratedDataURI(blankPosterURI);
1328
1329
  return;
1329
1330
  }
@@ -1335,7 +1336,7 @@ class Processor {
1335
1336
  temporaryVideoElement.crossOrigin = "anonymous";
1336
1337
  const canvasElement = this.doc.createElement("canvas");
1337
1338
  const context = canvasElement.getContext("2d");
1338
- this.options.doc.body.appendChild(temporaryVideoElement);
1339
+ liveDoc.body.appendChild(temporaryVideoElement);
1339
1340
  return new Promise(resolve => {
1340
1341
  temporaryVideoElement.currentTime = videoData.currentTime;
1341
1342
  temporaryVideoElement.oncanplay = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.6.33",
3
+ "version": "1.6.34",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",