@geekapps/silo-elements-nextjs 0.3.10 → 0.3.12
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/dist/MediaUploader.js +41 -3
- package/dist/MediaUploader.js.map +1 -1
- package/dist/VideoPlayer.js +29 -5
- package/dist/VideoPlayer.js.map +1 -1
- package/dist/VideoUploader.js +41 -3
- package/dist/VideoUploader.js.map +1 -1
- package/dist/index.js +70 -8
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -3
- package/styles.css +1 -1
package/dist/MediaUploader.js
CHANGED
|
@@ -774,10 +774,48 @@ function getCompatIssues(info) {
|
|
|
774
774
|
}
|
|
775
775
|
return issues;
|
|
776
776
|
}
|
|
777
|
+
var MEDIAINFO_CDN = "https://cdn.jsdelivr.net/npm/mediainfo.js@0.3.7/dist/umd/index.js";
|
|
778
|
+
var WASM_CDN = "https://cdn.jsdelivr.net/npm/mediainfo.js@0.3.7/dist/MediaInfoModule.wasm";
|
|
779
|
+
function loadMediaInfoFromCDN() {
|
|
780
|
+
return new Promise((resolve, reject) => {
|
|
781
|
+
if (typeof window === "undefined") {
|
|
782
|
+
reject(new Error("analyzeVideoFile requires a browser environment"));
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
const w = window;
|
|
786
|
+
if (typeof w["MediaInfo"] === "function") {
|
|
787
|
+
resolve(w["MediaInfo"]);
|
|
788
|
+
return;
|
|
789
|
+
}
|
|
790
|
+
const existing = document.getElementById("__mediainfo_cdn__");
|
|
791
|
+
if (existing) {
|
|
792
|
+
const interval = setInterval(() => {
|
|
793
|
+
if (typeof w["MediaInfo"] === "function") {
|
|
794
|
+
clearInterval(interval);
|
|
795
|
+
resolve(w["MediaInfo"]);
|
|
796
|
+
}
|
|
797
|
+
}, 50);
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
const script = document.createElement("script");
|
|
801
|
+
script.id = "__mediainfo_cdn__";
|
|
802
|
+
script.src = MEDIAINFO_CDN;
|
|
803
|
+
script.onload = () => {
|
|
804
|
+
if (typeof w["MediaInfo"] === "function") {
|
|
805
|
+
resolve(w["MediaInfo"]);
|
|
806
|
+
} else {
|
|
807
|
+
reject(new Error("MediaInfo not found on window after CDN script load"));
|
|
808
|
+
}
|
|
809
|
+
};
|
|
810
|
+
script.onerror = () => reject(new Error("Failed to load mediainfo.js from CDN"));
|
|
811
|
+
document.head.appendChild(script);
|
|
812
|
+
});
|
|
813
|
+
}
|
|
777
814
|
async function analyzeVideoFile(file) {
|
|
778
|
-
const
|
|
779
|
-
const
|
|
780
|
-
|
|
815
|
+
const MediaInfoFactory = await loadMediaInfoFromCDN();
|
|
816
|
+
const mediainfo = await MediaInfoFactory(
|
|
817
|
+
{ format: "object", locateFile: () => WASM_CDN }
|
|
818
|
+
);
|
|
781
819
|
const getSize = () => file.size;
|
|
782
820
|
const readChunk = (chunkSize, offset) => new Promise((resolve, reject) => {
|
|
783
821
|
const reader = new FileReader();
|