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