|
@@ -73,6 +73,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
sequential: [
|
|
sequential: [
|
|
|
{ action: "removeUIElements" },
|
|
{ action: "removeUIElements" },
|
|
|
{ action: "replaceStyleContents" },
|
|
{ action: "replaceStyleContents" },
|
|
|
|
|
+ { option: "removeVideoSrc", action: "insertVideoPosters" },
|
|
|
{ option: "removeSrcSet", action: "removeSrcSet" },
|
|
{ option: "removeSrcSet", action: "removeSrcSet" },
|
|
|
{ option: "removeFrames", action: "removeFrames" },
|
|
{ option: "removeFrames", action: "removeFrames" },
|
|
|
{ option: "removeImports", action: "removeImports" },
|
|
{ option: "removeImports", action: "removeImports" },
|
|
@@ -136,6 +137,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
this.options.fontsData = docData.fontsData;
|
|
this.options.fontsData = docData.fontsData;
|
|
|
this.options.stylesheetContents = docData.stylesheetContents;
|
|
this.options.stylesheetContents = docData.stylesheetContents;
|
|
|
this.options.imageData = docData.imageData;
|
|
this.options.imageData = docData.imageData;
|
|
|
|
|
+ this.options.postersData = docData.postersData;
|
|
|
}
|
|
}
|
|
|
this.options.content = this.options.content || (this.options.doc ? DOM.serialize(this.options.doc, false) : null);
|
|
this.options.content = this.options.content || (this.options.doc ? DOM.serialize(this.options.doc, false) : null);
|
|
|
this.onprogress = options.onprogress || (() => { });
|
|
this.onprogress = options.onprogress || (() => { });
|
|
@@ -659,6 +661,16 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ insertVideoPosters() {
|
|
|
|
|
+ if (this.options.postersData) {
|
|
|
|
|
+ this.doc.querySelectorAll("video[src], video > source[src]").forEach((videoElement, videoIndex) => {
|
|
|
|
|
+ if (!videoElement.poster && this.options.postersData[videoIndex]) {
|
|
|
|
|
+ videoElement.setAttribute("poster", this.options.postersData[videoIndex]);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
async pageResources() {
|
|
async pageResources() {
|
|
|
const resourcePromises = [
|
|
const resourcePromises = [
|
|
|
DomProcessorHelper.processAttribute(this.doc.querySelectorAll("link[href][rel*=\"icon\"]"), "href", PREFIX_DATA_URI_IMAGE, this.baseURI, this.batchRequest),
|
|
DomProcessorHelper.processAttribute(this.doc.querySelectorAll("link[href][rel*=\"icon\"]"), "href", PREFIX_DATA_URI_IMAGE, this.baseURI, this.batchRequest),
|