@cinecrew/cinecrew-player 0.1.14 → 0.1.15
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/package.json
CHANGED
|
@@ -62,7 +62,14 @@ export function useWebDashPlayback({
|
|
|
62
62
|
})
|
|
63
63
|
.catch((err) => {
|
|
64
64
|
if (!disposed) {
|
|
65
|
-
|
|
65
|
+
const actualMessage = typeof err?.message === 'string' && err.message.trim()
|
|
66
|
+
? err.message.trim()
|
|
67
|
+
: String(err || 'Unknown module loading error');
|
|
68
|
+
onErrorRef.current?.({
|
|
69
|
+
message: `Failed to initialize MPEG-DASH engine: ${actualMessage}`,
|
|
70
|
+
actualMessage,
|
|
71
|
+
err,
|
|
72
|
+
});
|
|
66
73
|
}
|
|
67
74
|
});
|
|
68
75
|
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import '../../../../vendor/mpegts.js/mpegts.js';
|
|
2
|
+
import * as mpegtsModule from '../../../../vendor/mpegts.js/mpegts.js';
|
|
3
3
|
import {
|
|
4
4
|
WEB_AC3_UNSUPPORTED_CODE,
|
|
5
5
|
WEB_AC3_UNSUPPORTED_MESSAGE,
|
|
6
6
|
} from './webPlaybackErrors';
|
|
7
7
|
|
|
8
8
|
const getMpegts = () => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const candidates = [
|
|
10
|
+
mpegtsModule.default,
|
|
11
|
+
mpegtsModule.default?.default,
|
|
12
|
+
mpegtsModule.mpegts,
|
|
13
|
+
typeof globalThis !== 'undefined' ? globalThis.mpegts : undefined,
|
|
14
|
+
typeof window !== 'undefined' ? window.mpegts : undefined,
|
|
15
|
+
];
|
|
16
|
+
return candidates.find((candidate) => (
|
|
17
|
+
typeof candidate?.isSupported === 'function'
|
|
18
|
+
&& typeof candidate?.createPlayer === 'function'
|
|
19
|
+
));
|
|
12
20
|
};
|
|
13
21
|
|
|
14
22
|
const getStashInitialSize = (useVideoOnly, isLive) => {
|