@inappstory/slide-api 0.1.44 → 0.1.45
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/index.cjs +12 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2630,9 +2630,15 @@ const waitForImageHtmlElementLoad = async (nodeRef) => {
|
|
|
2630
2630
|
}));
|
|
2631
2631
|
}
|
|
2632
2632
|
nodeRef.removeEventListener("load", onLoad);
|
|
2633
|
+
nodeRef.removeEventListener("error", onError);
|
|
2634
|
+
};
|
|
2635
|
+
const onError = () => {
|
|
2636
|
+
nodeRef.removeEventListener("load", onLoad);
|
|
2637
|
+
nodeRef.removeEventListener("error", onError);
|
|
2638
|
+
reject(new Error(`Could not load (Network error) Image from URL: ${nodeRef.src}`));
|
|
2633
2639
|
};
|
|
2634
2640
|
nodeRef.addEventListener("load", onLoad);
|
|
2635
|
-
nodeRef.addEventListener("error",
|
|
2641
|
+
nodeRef.addEventListener("error", onError);
|
|
2636
2642
|
if (nodeRef.complete && nodeRef.naturalHeight !== 0) {
|
|
2637
2643
|
if (nodeRef.decode != null) {
|
|
2638
2644
|
nodeRef.decode().then(() => resolve(nodeRef), reason => reject(reason));
|
|
@@ -3044,11 +3050,12 @@ class Video {
|
|
|
3044
3050
|
return false;
|
|
3045
3051
|
}
|
|
3046
3052
|
start(muted = true, getIsLooped) {
|
|
3047
|
-
this._videoStartedPromise = new Promise(async (resolve) => {
|
|
3053
|
+
this._videoStartedPromise = new Promise(async (resolve, reject) => {
|
|
3048
3054
|
// invariant - always wait for mediaElementsLoadingPromises
|
|
3049
3055
|
// else call of _initVOD can start and onAllMediaLoaded failed
|
|
3050
3056
|
// TODO - add for all Elements state invariant protection
|
|
3051
|
-
Promise.all(this.mediaElementsLoadingPromises)
|
|
3057
|
+
Promise.all(this.mediaElementsLoadingPromises)
|
|
3058
|
+
.then(async () => {
|
|
3052
3059
|
if (this._video) {
|
|
3053
3060
|
if (this._isVOD && this._vodPlayerInstance === null) {
|
|
3054
3061
|
// console.log("_initVOD 5.1");
|
|
@@ -3095,7 +3102,8 @@ class Video {
|
|
|
3095
3102
|
getVideoCurrentTime: () => 0,
|
|
3096
3103
|
});
|
|
3097
3104
|
}
|
|
3098
|
-
})
|
|
3105
|
+
})
|
|
3106
|
+
.catch(reject);
|
|
3099
3107
|
});
|
|
3100
3108
|
return this._videoStartedPromise;
|
|
3101
3109
|
}
|