hls.js 1.6.0-beta.3.0.canary.10980 → 1.6.0-beta.3.0.canary.10982
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.d.mts +15 -6
- package/dist/hls.d.ts +15 -6
- package/dist/hls.js +4609 -4503
- package/dist/hls.js.d.ts +15 -6
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +5646 -5601
- 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 +3802 -3759
- 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 +4597 -4494
- 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/config.ts +4 -4
- package/src/controller/abr-controller.ts +2 -1
- package/src/controller/audio-stream-controller.ts +7 -5
- package/src/controller/base-stream-controller.ts +2 -2
- package/src/controller/buffer-controller.ts +8 -3
- package/src/controller/error-controller.ts +14 -0
- package/src/controller/id3-track-controller.ts +1 -1
- package/src/controller/interstitial-player.ts +15 -5
- package/src/controller/interstitials-controller.ts +146 -84
- package/src/controller/stream-controller.ts +16 -12
- package/src/define-plugin.d.ts +1 -1
- package/src/hls.ts +4 -1
- package/src/loader/interstitial-event.ts +2 -2
- package/src/utils/codecs.ts +14 -1
- package/src/utils/mediacapabilities-helper.ts +31 -4
- package/src/utils/mp4-tools.ts +2 -3
@@ -1,4 +1,10 @@
|
|
1
|
-
import {
|
1
|
+
import {
|
2
|
+
fillInMissingAV01Params,
|
3
|
+
getCodecsForMimeType,
|
4
|
+
mimeTypeForCodec,
|
5
|
+
userAgentHevcSupportIsInaccurate,
|
6
|
+
} from './codecs';
|
7
|
+
import { isHEVC } from './mp4-tools';
|
2
8
|
import type { AudioTracksByGroup } from './rendition-helper';
|
3
9
|
import type { Level, VideoRange } from '../types/level';
|
4
10
|
import type { AudioSelectionOption } from '../types/media-playlist';
|
@@ -115,10 +121,31 @@ export function getMediaDecodingInfoPromise(
|
|
115
121
|
baseVideoConfiguration.transferFunction =
|
116
122
|
videoRange.toLowerCase() as TransferFunction;
|
117
123
|
}
|
118
|
-
|
124
|
+
const videoCodecsArray = videoCodecs.split(',');
|
125
|
+
// Override Windows Firefox HEVC MediaCapabilities result (https://github.com/video-dev/hls.js/issues/7046)
|
126
|
+
const ua = navigator.userAgent;
|
127
|
+
if (
|
128
|
+
videoCodecsArray.some((videoCodec) => isHEVC(videoCodec)) &&
|
129
|
+
userAgentHevcSupportIsInaccurate()
|
130
|
+
) {
|
131
|
+
return Promise.resolve({
|
132
|
+
supported: false,
|
133
|
+
configurations,
|
134
|
+
decodingInfoResults: [
|
135
|
+
{
|
136
|
+
supported: false,
|
137
|
+
smooth: false,
|
138
|
+
powerEfficient: false,
|
139
|
+
},
|
140
|
+
],
|
141
|
+
error: new Error(
|
142
|
+
`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (${ua})`,
|
143
|
+
),
|
144
|
+
});
|
145
|
+
}
|
119
146
|
configurations.push.apply(
|
120
147
|
configurations,
|
121
|
-
|
148
|
+
videoCodecsArray.map((videoCodec) => ({
|
122
149
|
type: 'media-source',
|
123
150
|
video: {
|
124
151
|
...baseVideoConfiguration,
|
@@ -187,7 +214,7 @@ function getMediaDecodingInfoKey(config: MediaDecodingConfiguration): string {
|
|
187
214
|
const { audio, video } = config;
|
188
215
|
const mediaConfig = video || audio;
|
189
216
|
if (mediaConfig) {
|
190
|
-
const codec = mediaConfig.contentType
|
217
|
+
const codec = getCodecsForMimeType(mediaConfig.contentType);
|
191
218
|
if (video) {
|
192
219
|
return `r${video.height}x${video.width}f${Math.ceil(video.framerate)}${
|
193
220
|
video.transferFunction || 'sd'
|
package/src/utils/mp4-tools.ts
CHANGED
@@ -1012,12 +1012,11 @@ export function parseSamples(
|
|
1012
1012
|
return seiSamples;
|
1013
1013
|
}
|
1014
1014
|
|
1015
|
-
function isHEVC(codec: string) {
|
1015
|
+
export function isHEVC(codec: string | undefined) {
|
1016
1016
|
if (!codec) {
|
1017
1017
|
return false;
|
1018
1018
|
}
|
1019
|
-
const
|
1020
|
-
const baseCodec = delimit < 0 ? codec : codec.substring(0, delimit);
|
1019
|
+
const baseCodec = codec.substring(0, 4);
|
1021
1020
|
return (
|
1022
1021
|
baseCodec === 'hvc1' ||
|
1023
1022
|
baseCodec === 'hev1' ||
|