single-file-core 1.6.32 → 1.6.33
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.
- package/core/index.js +5 -1
- package/package.json +1 -1
package/core/index.js
CHANGED
|
@@ -1318,11 +1318,15 @@ class Processor {
|
|
|
1318
1318
|
const attributeValue = videoElement.getAttribute(util.VIDEO_ATTRIBUTE_NAME);
|
|
1319
1319
|
if (attributeValue) {
|
|
1320
1320
|
const videoData = this.options.videos[Number(attributeValue)];
|
|
1321
|
-
const src = videoData.src || videoElement.src;
|
|
1321
|
+
const src = videoData && videoData.size && (videoData.src || videoElement.src);
|
|
1322
1322
|
if (src) {
|
|
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) {
|
|
1327
|
+
videoElement.poster = this.registerGeneratedDataURI(blankPosterURI);
|
|
1328
|
+
return;
|
|
1329
|
+
}
|
|
1326
1330
|
const temporaryVideoElement = this.doc.createElement("video");
|
|
1327
1331
|
temporaryVideoElement.src = src;
|
|
1328
1332
|
temporaryVideoElement.style.setProperty("width", videoData.size.pxWidth + "px", "important");
|