hls.js 1.5.8-0.canary.10161 → 1.5.8-0.canary.10162
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/hls.js +6 -3
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +6 -3
- package/dist/hls.light.js.map +1 -1
- package/dist/hls.light.min.js +1 -1
- package/dist/hls.light.min.js.map +1 -1
- package/dist/hls.light.mjs +6 -3
- package/dist/hls.light.mjs.map +1 -1
- package/dist/hls.min.js +1 -1
- package/dist/hls.min.js.map +1 -1
- package/dist/hls.mjs +6 -3
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/dist/hls.worker.js.map +1 -1
- package/package.json +1 -1
- package/src/controller/buffer-controller.ts +9 -5
- package/src/utils/mediasource-helper.ts +6 -0
package/package.json
CHANGED
@@ -6,7 +6,10 @@ import {
|
|
6
6
|
getCodecCompatibleName,
|
7
7
|
pickMostCompleteCodecName,
|
8
8
|
} from '../utils/codecs';
|
9
|
-
import {
|
9
|
+
import {
|
10
|
+
getMediaSource,
|
11
|
+
isManagedMediaSource,
|
12
|
+
} from '../utils/mediasource-helper';
|
10
13
|
import {
|
11
14
|
ElementaryStreamTypes,
|
12
15
|
type Part,
|
@@ -101,10 +104,10 @@ export default class BufferController extends Logger implements ComponentAPI {
|
|
101
104
|
super('buffer-controller', hls.logger);
|
102
105
|
this.hls = hls;
|
103
106
|
this.fragmentTracker = fragmentTracker;
|
104
|
-
this.appendSource =
|
105
|
-
hls.config.preferManagedMediaSource
|
106
|
-
|
107
|
-
|
107
|
+
this.appendSource = isManagedMediaSource(
|
108
|
+
getMediaSource(hls.config.preferManagedMediaSource),
|
109
|
+
);
|
110
|
+
|
108
111
|
this._initSourceBuffer();
|
109
112
|
this.registerListeners();
|
110
113
|
}
|
@@ -207,6 +210,7 @@ export default class BufferController extends Logger implements ComponentAPI {
|
|
207
210
|
) {
|
208
211
|
const media = (this.media = data.media);
|
209
212
|
const MediaSource = getMediaSource(this.appendSource);
|
213
|
+
|
210
214
|
if (media && MediaSource) {
|
211
215
|
const ms = (this.mediaSource = new MediaSource());
|
212
216
|
this.log(`created media source: ${ms.constructor?.name}`);
|
@@ -15,3 +15,9 @@ export function getMediaSource(
|
|
15
15
|
((self as any).WebKitMediaSource as typeof MediaSource)
|
16
16
|
);
|
17
17
|
}
|
18
|
+
|
19
|
+
export function isManagedMediaSource(source: typeof MediaSource | undefined) {
|
20
|
+
return (
|
21
|
+
typeof self !== 'undefined' && source === (self as any).ManagedMediaSource
|
22
|
+
);
|
23
|
+
}
|