Skip to content

Commit 4722c78

Browse files
authored
Merge pull request #114 from DiceTechnology/patch/v1.6.11-doris
upgrade master-doris branch to [email protected]
2 parents 2037a16 + f75c23e commit 4722c78

File tree

75 files changed

+3602
-2517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+3602
-2517
lines changed

.eslintrc.js

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
const asyncKeywordConstraintMsg =
2+
'The async keyword adds a `regenerator` dependency in the hls.js ES5 output not allowed in v1 due to bundle size constraints.';
3+
const selfVsWindowGlobalMsg =
4+
'Use `self` instead of `window` to access the global context everywhere (including workers).';
5+
const arrayFindCompatibilityMsg =
6+
'Usage of Array find methods is restricted for compatibility.';
7+
const arrayFindIndexCompatibilityMsg =
8+
'Usage of Array findIndex methods is restricted for compatibility.';
9+
110
module.exports = {
211
env: { browser: true, commonjs: true, es6: true },
312
globals: {
@@ -27,20 +36,13 @@ module.exports = {
2736
2,
2837
{
2938
name: 'window',
30-
message:
31-
'Use `self` instead of `window` to access the global context everywhere (including workers).',
39+
message: selfVsWindowGlobalMsg,
3240
},
3341
{ name: 'SourceBuffer', message: 'Use `self.SourceBuffer`' },
3442
{ name: 'setTimeout', message: 'Use `self.setTimeout`' },
3543
{ name: 'setInterval', message: 'Use `self.setInterval`' },
3644
],
3745

38-
'no-restricted-properties': [
39-
2,
40-
{ property: 'findIndex' }, // Intended to block usage of Array.prototype.findIndex
41-
{ property: 'find' }, // Intended to block usage of Array.prototype.find
42-
],
43-
4446
'import/first': 1,
4547
'no-var': 1,
4648
'no-empty': 1,
@@ -67,6 +69,31 @@ module.exports = {
6769
'no-unused-vars': 0,
6870
'no-undef': 0,
6971
'no-use-before-define': 'off',
72+
'no-restricted-syntax': [
73+
'error',
74+
{
75+
selector: 'FunctionDeclaration[async=true]',
76+
message: asyncKeywordConstraintMsg,
77+
},
78+
{
79+
selector: 'ArrowFunctionExpression[async=true]',
80+
message: asyncKeywordConstraintMsg,
81+
},
82+
{
83+
selector: 'MethodDefinition[value.async=true]',
84+
message: asyncKeywordConstraintMsg,
85+
},
86+
{
87+
selector:
88+
'MemberExpression[property.name="find"][object.type="Identifier"]',
89+
message: arrayFindCompatibilityMsg,
90+
},
91+
{
92+
selector:
93+
'MemberExpression[property.name="findIndex"][object.type="Identifier"]',
94+
message: arrayFindIndexCompatibilityMsg,
95+
},
96+
],
7097
'import/order': [
7198
'warn',
7299
{
@@ -98,6 +125,8 @@ module.exports = {
98125
'@typescript-eslint/consistent-type-imports': 'error',
99126
'@typescript-eslint/no-import-type-side-effects': 'error',
100127
'@typescript-eslint/no-restricted-imports': 'error',
128+
'@typescript-eslint/no-floating-promises': 'error',
129+
'@typescript-eslint/no-misused-promises': 'error',
101130
},
102131
},
103132
],

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.16.0
1+
22.17.1

api-extractor/report/hls.js.api.md

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export class AudioStreamController extends BaseStreamController implements Netwo
197197
// (undocumented)
198198
protected onHandlerDestroying(): void;
199199
// (undocumented)
200-
onInitPtsFound(event: Events.INIT_PTS_FOUND, { frag, id, initPTS, timescale }: InitPTSFoundData): void;
200+
onInitPtsFound(event: Events.INIT_PTS_FOUND, { frag, id, initPTS, timescale, trackId }: InitPTSFoundData): void;
201201
// (undocumented)
202202
protected onManifestLoading(): void;
203203
// (undocumented)
@@ -392,6 +392,8 @@ export class BaseStreamController extends TaskLoop implements NetworkComponentAP
392392
// (undocumented)
393393
protected checkLiveUpdate(details: LevelDetails): void;
394394
// (undocumented)
395+
protected checkRetryDate(): void;
396+
// (undocumented)
395397
protected clearTrackerIfNeeded(frag: Fragment): void;
396398
// (undocumented)
397399
protected config: HlsConfig;
@@ -458,7 +460,7 @@ export class BaseStreamController extends TaskLoop implements NetworkComponentAP
458460
// (undocumented)
459461
get inFlightFrag(): InFlightData;
460462
// (undocumented)
461-
protected initPTS: RationalTimestamp[];
463+
protected initPTS: TimestampOffset[];
462464
// (undocumented)
463465
protected isLoopLoading(frag: Fragment, targetBufferTime: number): boolean;
464466
// (undocumented)
@@ -528,8 +530,6 @@ export class BaseStreamController extends TaskLoop implements NetworkComponentAP
528530
// (undocumented)
529531
protected resetLoadingState(): void;
530532
// (undocumented)
531-
protected resetStartWhenNotLoaded(level: Level | null): void;
532-
// (undocumented)
533533
protected resetTransmuxer(): void;
534534
// (undocumented)
535535
protected resetWhenMissingContext(chunkMeta: ChunkMetadata | Fragment): void;
@@ -563,6 +563,8 @@ export class BaseStreamController extends TaskLoop implements NetworkComponentAP
563563
// (undocumented)
564564
protected transmuxer: TransmuxerInterface | null;
565565
// (undocumented)
566+
protected unhandledEncryptionError(initSegment: InitSegmentData, frag: Fragment): boolean;
567+
// (undocumented)
566568
protected unregisterListeners(): void;
567569
// (undocumented)
568570
protected waitForCdnTuneIn(details: LevelDetails): boolean | 0;
@@ -579,6 +581,8 @@ export interface BaseTrack {
579581
// (undocumented)
580582
container: string;
581583
// (undocumented)
584+
encrypted?: boolean;
585+
// (undocumented)
582586
id: 'audio' | 'main';
583587
// (undocumented)
584588
levelCodec?: string;
@@ -631,7 +635,7 @@ export interface BufferAppendingData {
631635
// (undocumented)
632636
chunkMeta: ChunkMetadata;
633637
// (undocumented)
634-
data: Uint8Array;
638+
data: Uint8Array<ArrayBuffer>;
635639
// (undocumented)
636640
frag: Fragment;
637641
// (undocumented)
@@ -1185,8 +1189,8 @@ export type EMEControllerConfig = {
11851189
licenseResponseCallback?: (this: Hls, xhr: XMLHttpRequest, url: string, keyContext: MediaKeySessionContext) => ArrayBuffer;
11861190
emeEnabled: boolean;
11871191
widevineLicenseUrl?: string;
1188-
drmSystems: DRMSystemsConfiguration;
1189-
drmSystemOptions: DRMSystemOptions;
1192+
drmSystems: DRMSystemsConfiguration | undefined;
1193+
drmSystemOptions: DRMSystemOptions | undefined;
11901194
requestMediaKeySystemAccessFunc: MediaKeyFunc | null;
11911195
requireKeySystemAccessOnStart: boolean;
11921196
};
@@ -1200,9 +1204,11 @@ export const enum ErrorActionFlags {
12001204
// (undocumented)
12011205
MoveAllAlternatesMatchingHost = 1,
12021206
// (undocumented)
1207+
MoveAllAlternatesMatchingKey = 4,
1208+
// (undocumented)
12031209
None = 0,
12041210
// (undocumented)
1205-
SwitchToSDR = 4
1211+
SwitchToSDR = 8
12061212
}
12071213

12081214
// Warning: (ae-missing-release-tag) "ErrorController" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -1235,6 +1241,8 @@ export interface ErrorData {
12351241
// (undocumented)
12361242
context?: PlaylistLoaderContext;
12371243
// (undocumented)
1244+
decryptdata?: LevelKey;
1245+
// (undocumented)
12381246
details: ErrorDetails;
12391247
// @deprecated (undocumented)
12401248
err?: {
@@ -1503,8 +1511,6 @@ export enum Events {
15031511
// (undocumented)
15041512
KEY_LOADING = "hlsKeyLoading",
15051513
// (undocumented)
1506-
KEY_STATUSES_CHANGED = "hlsKeyStatusesChanged",
1507-
// (undocumented)
15081514
LEVEL_LOADED = "hlsLevelLoaded",
15091515
// (undocumented)
15101516
LEVEL_LOADING = "hlsLevelLoading",
@@ -1809,7 +1815,7 @@ export class Fragment extends BaseSegment {
18091815
level: number;
18101816
// (undocumented)
18111817
levelkeys?: {
1812-
[key: string]: LevelKey;
1818+
[key: string]: LevelKey | undefined;
18131819
};
18141820
// (undocumented)
18151821
loader: Loader<FragmentLoaderContext> | null;
@@ -1927,7 +1933,7 @@ export class FragmentTracker implements ComponentAPI {
19271933
detectPartialFragments(data: FragBufferedData): void;
19281934
// (undocumented)
19291935
fragBuffered(frag: MediaFragment, force?: true): void;
1930-
getAppendedFrag(position: number, levelType: PlaylistLevelType): Fragment | Part | null;
1936+
getAppendedFrag(position: number, levelType: PlaylistLevelType): MediaFragment | Part | null;
19311937
getBufferedFrag(position: number, levelType: PlaylistLevelType): MediaFragment | null;
19321938
// (undocumented)
19331939
getFragAtPos(position: number, levelType: PlaylistLevelType, buffered?: boolean): MediaFragment | null;
@@ -2190,12 +2196,14 @@ export class HlsAssetPlayer {
21902196
// (undocumented)
21912197
get duration(): number;
21922198
// (undocumented)
2193-
readonly hls: Hls;
2199+
hls: Hls | null;
21942200
// (undocumented)
2195-
readonly interstitial: InterstitialEvent;
2201+
interstitial: InterstitialEvent;
21962202
// (undocumented)
21972203
get interstitialId(): InterstitialId;
21982204
// (undocumented)
2205+
loadSource(): void;
2206+
// (undocumented)
21992207
get media(): HTMLMediaElement | null;
22002208
// (undocumented)
22012209
off<E extends keyof HlsListeners, Context = undefined>(event: E, listener: HlsListeners[E], context?: Context): void;
@@ -2403,8 +2411,6 @@ export interface HlsListeners {
24032411
// (undocumented)
24042412
[Events.KEY_LOADING]: (event: Events.KEY_LOADING, data: KeyLoadingData) => void;
24052413
// (undocumented)
2406-
[Events.KEY_STATUSES_CHANGED]: (event: Events.KEY_STATUSES_CHANGED, data: KeyStatusesChangedData) => void;
2407-
// (undocumented)
24082414
[Events.LEVEL_LOADED]: (event: Events.LEVEL_LOADED, data: LevelLoadedData) => void;
24092415
// (undocumented)
24102416
[Events.LEVEL_LOADING]: (event: Events.LEVEL_LOADING, data: LevelLoadingData) => void;
@@ -2588,6 +2594,8 @@ export interface InitPTSFoundData {
25882594
initPTS: number;
25892595
// (undocumented)
25902596
timescale: number;
2597+
// (undocumented)
2598+
trackId: number;
25912599
}
25922600

25932601
// Warning: (ae-missing-release-tag) "InitSegmentData" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -2802,6 +2810,8 @@ export interface InterstitialPlayer {
28022810
// (undocumented)
28032811
assetPlayers: (HlsAssetPlayer | null)[];
28042812
// (undocumented)
2813+
bufferedEnd: number;
2814+
// (undocumented)
28052815
currentTime: number;
28062816
// (undocumented)
28072817
duration: number;
@@ -2975,8 +2985,8 @@ export interface KeyLoadedData {
29752985
// Warning: (ae-missing-release-tag) "KeyLoader" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
29762986
//
29772987
// @public (undocumented)
2978-
export class KeyLoader implements ComponentAPI {
2979-
constructor(config: HlsConfig);
2988+
export class KeyLoader extends Logger implements ComponentAPI {
2989+
constructor(config: HlsConfig, logger: ILogger);
29802990
// (undocumented)
29812991
abort(type?: PlaylistLevelType): void;
29822992
// (undocumented)
@@ -2993,10 +3003,6 @@ export class KeyLoader implements ComponentAPI {
29933003
// (undocumented)
29943004
emeController: EMEController | null;
29953005
// (undocumented)
2996-
keyUriToKeyInfo: {
2997-
[keyuri: string]: KeyLoaderInfo;
2998-
};
2999-
// (undocumented)
30003006
load(frag: Fragment): Promise<KeyLoadedData>;
30013007
// (undocumented)
30023008
loadClear(loadingFrag: Fragment, encryptedFragments: Fragment[], startFragRequested: boolean): null | Promise<void>;
@@ -3040,16 +3046,6 @@ export interface KeyLoadingData {
30403046
frag: Fragment;
30413047
}
30423048

3043-
// Warning: (ae-missing-release-tag) "KeyStatusesChangedData" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
3044-
//
3045-
// @public (undocumented)
3046-
export interface KeyStatusesChangedData {
3047-
// (undocumented)
3048-
keyStatuses: MediaKeyStatusMap;
3049-
// (undocumented)
3050-
keySystem: string;
3051-
}
3052-
30533049
// Warning: (ae-missing-release-tag) "KeySystemFormats" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
30543050
//
30553051
// @public (undocumented)
@@ -3248,7 +3244,7 @@ export class LevelDetails {
32483244
// (undocumented)
32493245
canSkipUntil: number;
32503246
// (undocumented)
3251-
dateRanges: Record<string, DateRange>;
3247+
dateRanges: Record<string, DateRange | undefined>;
32523248
// (undocumented)
32533249
dateRangeTagCount: number;
32543250
// (undocumented)
@@ -3282,6 +3278,8 @@ export class LevelDetails {
32823278
// (undocumented)
32833279
get fragmentStart(): number;
32843280
// (undocumented)
3281+
hasKey(levelKey: LevelKey): boolean;
3282+
// (undocumented)
32853283
get hasProgramDateTime(): boolean;
32863284
// (undocumented)
32873285
hasVariableRefs: boolean;
@@ -4366,6 +4364,8 @@ export interface RemuxedTrack {
43664364
// (undocumented)
43674365
dropped?: number;
43684366
// (undocumented)
4367+
encrypted?: boolean;
4368+
// (undocumented)
43694369
endDTS: number;
43704370
// (undocumented)
43714371
endPTS: number;
@@ -4810,6 +4810,13 @@ export enum TimelineOccupancy {
48104810
Range = 1
48114811
}
48124812

4813+
// Warning: (ae-missing-release-tag) "TimestampOffset" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
4814+
//
4815+
// @public (undocumented)
4816+
export type TimestampOffset = RationalTimestamp & {
4817+
trackId: number;
4818+
};
4819+
48134820
// Warning: (ae-missing-release-tag) "Track" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
48144821
//
48154822
// @public (undocumented)
@@ -4880,7 +4887,7 @@ export class TransmuxerInterface {
48804887
// (undocumented)
48814888
flush(chunkMeta: ChunkMetadata): void;
48824889
// (undocumented)
4883-
push(data: ArrayBuffer, initSegmentData: Uint8Array | undefined, audioCodec: string | undefined, videoCodec: string | undefined, frag: MediaFragment, part: Part | null, duration: number, accurateTimeOffset: boolean, chunkMeta: ChunkMetadata, defaultInitPTS?: RationalTimestamp): void;
4890+
push(data: ArrayBuffer, initSegmentData: Uint8Array | undefined, audioCodec: string | undefined, videoCodec: string | undefined, frag: MediaFragment, part: Part | null, duration: number, accurateTimeOffset: boolean, chunkMeta: ChunkMetadata, defaultInitPTS?: TimestampOffset): void;
48844891
// (undocumented)
48854892
reset(): void;
48864893
}

build-config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ const babelTsWithPresetEnvTargets = ({ targets, stripConsole }) =>
136136
],
137137
plugins: [
138138
[
139-
'@babel/plugin-proposal-class-properties',
139+
'@babel/plugin-transform-class-properties',
140140
{
141141
loose: true,
142142
},
143143
],
144-
'@babel/plugin-proposal-object-rest-spread',
144+
'@babel/plugin-transform-object-rest-spread',
145145
{
146146
visitor: {
147147
CallExpression: function (espath) {
@@ -172,7 +172,7 @@ const babelTsWithPresetEnvTargets = ({ targets, stripConsole }) =>
172172
},
173173
},
174174
['@babel/plugin-transform-object-assign'],
175-
['@babel/plugin-proposal-optional-chaining'],
175+
['@babel/plugin-transform-optional-chaining'],
176176

177177
...(stripConsole
178178
? [

0 commit comments

Comments
 (0)