@vkontakte/videoplayer-core 2.0.180 → 2.0.181-beta.1
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/es2015.cjs +17 -17
- package/es2015.esm.js +17 -17
- package/esnext.cjs +16 -16
- package/esnext.esm.js +16 -16
- package/evergreen.esm.js +16 -16
- package/package.json +2 -2
- package/types/index.d.ts +3 -2
- package/types/player/Player.d.ts +3 -2
- package/types/player/types.d.ts +7 -11
- package/types/providers/DashProvider/baseDashProvider.d.ts +1 -1
- package/types/providers/DashProvider/lib/buffer.d.ts +28 -3
- package/types/providers/DashProvider/lib/fetcher.d.ts +31 -6
- package/types/providers/DashProvider/lib/player.d.ts +2 -0
- package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +1 -1
- package/types/providers/DashProviderVirtual/lib/buffer/types.d.ts +1 -0
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.d.ts +7 -3
- package/types/providers/DashProviderVirtual/lib/fetcher.d.ts +30 -6
- package/types/providers/DashProviderVirtual/lib/player/basePlayer.d.ts +1 -0
- package/types/providers/DashProviderVirtual/lib/player/types.d.ts +2 -1
- package/types/providers/types.d.ts +1 -3
- package/types/providers/utils/Abr/rules/video/stallsRule.d.ts +9 -11
- package/types/providers/utils/StallsManager.d.ts +1 -8
- package/types/providers/utils/TextTrackManager.d.ts +16 -0
- package/types/utils/ClientChecker/services/DeviceChecker.d.ts +4 -0
- package/types/utils/ClientChecker/types/userAgentData.d.ts +4 -2
- package/types/utils/ThroughputEstimator.d.ts +20 -4
- package/types/utils/UserHappinessController.d.ts +8 -0
- package/types/utils/UserHappinessObserver/constants.d.ts +12 -0
- package/types/utils/UserHappinessObserver/index.d.ts +15 -0
- package/types/utils/UserHappinessObserver/metrics/hasFatalError.d.ts +3 -0
- package/types/utils/UserHappinessObserver/metrics/highStallRatio.d.ts +3 -0
- package/types/utils/UserHappinessObserver/metrics/lowQuality/constants.d.ts +5 -0
- package/types/utils/UserHappinessObserver/metrics/lowQuality/createLowQuality.d.ts +4 -0
- package/types/utils/UserHappinessObserver/metrics/lowQuality/index.d.ts +1 -0
- package/types/utils/UserHappinessObserver/metrics/lowQuality/types.d.ts +13 -0
- package/types/utils/UserHappinessObserver/metrics/lowQuality/utils.d.ts +26 -0
- package/types/utils/UserHappinessObserver/metrics/slowFirstFrame.d.ts +3 -0
- package/types/utils/UserHappinessObserver/types.d.ts +8 -0
- package/types/utils/UserHappinessObserver/utils/qualityPlatform.d.ts +2 -0
- package/types/utils/UserHappinessObserver/utils/thresholds.d.ts +2 -0
- package/types/utils/UserHappinessObserver/utils/watchedTimeSeconds.d.ts +3 -0
- package/types/utils/buffer/isPositionBuffered.d.ts +1 -0
- package/types/utils/tuningConfig.d.ts +52 -21
- package/types/utils/userHappinessTriggers.d.ts +4 -0
- package/types/providers/utils/HTMLVideoElement/TextTrackManager.d.ts +0 -32
- package/types/utils/setStateWithSubscribe.d.ts +0 -6
|
@@ -1,15 +1,30 @@
|
|
|
1
|
-
import type { Byte, Kbps, Milliseconds, IValueSubject } from "@vkontakte/videoplayer-shared";
|
|
1
|
+
import type { Byte, Kbps, Milliseconds, IValueSubject, IComponentLogger } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
import type { ITuningConfig } from "./tuningConfig";
|
|
3
3
|
declare class ThroughputEstimator {
|
|
4
4
|
private throughput;
|
|
5
5
|
private rtt;
|
|
6
6
|
private subscription;
|
|
7
|
+
private wiring;
|
|
8
|
+
private readonly throughputVarianceProxy$;
|
|
9
|
+
private currentHost;
|
|
10
|
+
private hasThroughputSamples;
|
|
11
|
+
private hasRttSamples;
|
|
12
|
+
private storageReadDone;
|
|
7
13
|
private tuningConfig;
|
|
14
|
+
private readonly logger?;
|
|
15
|
+
private initialThroughputSource;
|
|
16
|
+
private initialRttSource;
|
|
8
17
|
private concurrentDownloads;
|
|
9
18
|
throughput$: IValueSubject<Kbps>;
|
|
10
19
|
rtt$: IValueSubject<Milliseconds>;
|
|
11
20
|
rttAdjustedThroughput$: IValueSubject<Kbps>;
|
|
12
|
-
constructor(tuning: ITuningConfig["throughputEstimator"]);
|
|
21
|
+
constructor(tuning: ITuningConfig["throughputEstimator"], hostname$?: IValueSubject<string | undefined>, logger?: IComponentLogger);
|
|
22
|
+
private static readLegacyNumber;
|
|
23
|
+
private static resolveInitialThroughput;
|
|
24
|
+
private static resolveInitialRtt;
|
|
25
|
+
private tryAdopt;
|
|
26
|
+
private recreateSmoothed;
|
|
27
|
+
private wireSmoothed;
|
|
13
28
|
destroy(): void;
|
|
14
29
|
trackXHR(xhr: XMLHttpRequest): void;
|
|
15
30
|
trackStream(stream: ReadableStream, isLowLatency?: boolean): void;
|
|
@@ -21,10 +36,11 @@ declare class ThroughputEstimator {
|
|
|
21
36
|
*/
|
|
22
37
|
addRawThroughput(rate: Kbps): void;
|
|
23
38
|
addRawRtt(time: Milliseconds): void;
|
|
39
|
+
private markSample;
|
|
24
40
|
private sanityCheck;
|
|
25
41
|
get throughputVariance$(): IValueSubject<number>;
|
|
26
|
-
private static
|
|
27
|
-
private
|
|
42
|
+
private static readHostRecord;
|
|
43
|
+
private writeStored;
|
|
28
44
|
private static validateStored;
|
|
29
45
|
}
|
|
30
46
|
export default ThroughputEstimator;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ITracer } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IPlayerEvents, IPlayerExperimental, IPlayerInfo } from "../player/types";
|
|
3
|
+
export declare class UserHappinessController {
|
|
4
|
+
private readonly subscription;
|
|
5
|
+
private readonly observer?;
|
|
6
|
+
constructor(info: IPlayerInfo, events: IPlayerEvents, experimental: IPlayerExperimental, tracer: ITracer, configuredTriggers: unknown);
|
|
7
|
+
destroy(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Пороги метрик довольности пользователя. Источник формул и значений:
|
|
3
|
+
* UVP-11892 и документация метрики:
|
|
4
|
+
* https://confluence.vk.team/pages/viewpage.action?pageId=2056272767
|
|
5
|
+
*/
|
|
6
|
+
export declare const MIN_SESSION_TVT_SECONDS = 30;
|
|
7
|
+
export declare const MAX_STALL_RATIO = 1.5;
|
|
8
|
+
export declare const MAX_MOBILE_STALL_RATIO = 3;
|
|
9
|
+
export declare const MAX_FIRST_FRAME_TIME_MS = 2e3;
|
|
10
|
+
export declare const MAX_MOBILE_FIRST_FRAME_TIME_MS = 1300;
|
|
11
|
+
export declare const MIN_QUALITY_SCORE = .8;
|
|
12
|
+
export declare const ALLOWED_DEFICIT_RANK = .2;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IValueSubject } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IPlayerEvents, IPlayerExperimental, IPlayerInfo } from "../../player/types";
|
|
3
|
+
import type { UserHappinessTrigger } from "../userHappinessTriggers";
|
|
4
|
+
import type { UserHappinessQualityPlatform, UserHappinessThresholds } from "./types";
|
|
5
|
+
export declare class UserHappinessObserver {
|
|
6
|
+
private readonly subscription;
|
|
7
|
+
private readonly sessionFinalized$;
|
|
8
|
+
readonly lowQuality$: IValueSubject<boolean>;
|
|
9
|
+
readonly highStallRatio$: IValueSubject<boolean>;
|
|
10
|
+
readonly hasFatalError$: IValueSubject<boolean>;
|
|
11
|
+
readonly slowFirstFrame$: IValueSubject<boolean>;
|
|
12
|
+
constructor(info: IPlayerInfo, events: IPlayerEvents, experimental: IPlayerExperimental, triggers: readonly UserHappinessTrigger[], thresholds: UserHappinessThresholds, qualityPlatform: UserHappinessQualityPlatform);
|
|
13
|
+
destroy(): void;
|
|
14
|
+
finalizeSession(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IValueObservable, IValueSubject, Milliseconds, Seconds, Subscription } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IPlayerEvents, IPlayerInfo } from "../../../player/types";
|
|
3
|
+
export declare const createHighStallRatio: (info: IPlayerInfo, events: IPlayerEvents, watchedTimeSeconds$: IValueObservable<Seconds>, sessionFinalized$: IValueObservable<boolean>, subscription: Subscription, maxStallRatio: number, nowInt: () => Milliseconds) => IValueSubject<boolean>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { VideoQuality } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
export declare const QUALITY_RANKS: Partial<Record<VideoQuality, number>>;
|
|
3
|
+
export declare const DEFAULT_NETWORK_QUALITY_THRESHOLDS: readonly [281, 452, 967, 2300, 2551, 4483, 8965];
|
|
4
|
+
export declare const WEBM_NETWORK_QUALITY_THRESHOLDS: readonly [196.4, 357.7, 595.6, 1108, 2100, 7850, 16770];
|
|
5
|
+
export declare const AV1_NETWORK_QUALITY_THRESHOLDS: readonly [245, 424, 641, 1140, 2048, 3935, 7469];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type IValueObservable, type IValueSubject, type Seconds, type Subscription } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IPlayerExperimental, IPlayerInfo } from "../../../../player/types";
|
|
3
|
+
import type { UserHappinessQualityPlatform, UserHappinessThresholds } from "../../types";
|
|
4
|
+
export declare const createLowQuality: (info: IPlayerInfo, experimental: IPlayerExperimental, totalViewTimeSeconds$: IValueObservable<Seconds>, sessionFinalized$: IValueObservable<boolean>, subscription: Subscription, thresholds: Pick<UserHappinessThresholds, "minQualityScore" | "allowedDeficitRank">, qualityPlatform: UserHappinessQualityPlatform) => IValueSubject<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createLowQuality } from "./createLowQuality";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface QualityScoreFineStats {
|
|
2
|
+
requiredQualityTotalSeconds: number;
|
|
3
|
+
qualityScoreFineSeconds: number;
|
|
4
|
+
}
|
|
5
|
+
export interface QualityStats {
|
|
6
|
+
totalSeconds: number;
|
|
7
|
+
rankSeconds: number;
|
|
8
|
+
unknownSeconds: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ModeStats {
|
|
11
|
+
totalSeconds: number;
|
|
12
|
+
rankSeconds: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { VideoQuality } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import { Surface, VideoFormat } from "../../../../player/types";
|
|
3
|
+
import type { UserHappinessQualityPlatform } from "../../types";
|
|
4
|
+
import type { ModeStats, QualityScoreFineStats, QualityStats } from "./types";
|
|
5
|
+
export declare const getQualityRank: (quality: VideoQuality | undefined) => number | undefined;
|
|
6
|
+
/** Ранг цели для fallback по mode_stats, без viewport и сетевых ограничений. */
|
|
7
|
+
export declare const getFallbackModeQualityRank: (surface: Surface, isLive: boolean, availableQualities: VideoQuality[]) => number | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Восстанавливает required_quality для текущего runtime-интервала по правилам SQL:
|
|
10
|
+
* mode/surface → viewport → max_quality → network_quality_rank.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getRequiredQualityRank: (surface: Surface, availableQualities: VideoQuality[], options: {
|
|
13
|
+
viewportSize?: {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
};
|
|
17
|
+
throughputKbps?: number;
|
|
18
|
+
format?: VideoFormat;
|
|
19
|
+
platform: UserHappinessQualityPlatform;
|
|
20
|
+
}) => number | undefined;
|
|
21
|
+
/** Добавляет одну пару actual|required в потоковые агрегаты quality_score_fine сессии. */
|
|
22
|
+
export declare const addRequiredQualityPair: (stats: QualityScoreFineStats, actualQualityRank: number | undefined, requiredQualityRank: number, watchTimeSeconds: number) => void;
|
|
23
|
+
/** Реализация quality_score_fine для агрегированных пар actual|required одной сессии. */
|
|
24
|
+
export declare const getQualityScoreFine: (stats: QualityScoreFineStats) => number | undefined;
|
|
25
|
+
/** Точная проверка finalize_quality из fallback-ветки PDF/SQL. */
|
|
26
|
+
export declare const finalizeQualityFallback: (qualityStats: QualityStats, modeStats: ModeStats, allowedDeficitRank: number) => boolean | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IValueSubject, Milliseconds, Subscription } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IPlayerEvents } from "../../../player/types";
|
|
3
|
+
export declare const createSlowFirstFrame: (events: IPlayerEvents, subscription: Subscription, maxFirstFrameTimeMs: Milliseconds) => IValueSubject<boolean>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
export type UserHappinessQualityPlatform = "web2" | "mvk" | "smart_tv";
|
|
3
|
+
export interface UserHappinessThresholds {
|
|
4
|
+
maxFirstFrameTimeMs: Milliseconds;
|
|
5
|
+
maxStallRatio: number;
|
|
6
|
+
minQualityScore: number;
|
|
7
|
+
allowedDeficitRank: number;
|
|
8
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IValueSubject, Milliseconds, Seconds, Subscription } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IPlayerEvents, IPlayerInfo } from "../../../player/types";
|
|
3
|
+
export declare const createWatchedTimeSeconds: (info: IPlayerInfo, events: IPlayerEvents, subscription: Subscription, nowInt: () => Milliseconds) => IValueSubject<Seconds>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
declare const _default: (timeRanges: TimeRanges, position: Milliseconds, tolerance?: number) => boolean;
|
|
3
3
|
export default _default;
|
|
4
|
+
export declare const isTimeRangeBuffered: (timeRanges: TimeRanges, from: Milliseconds, to: Milliseconds) => boolean;
|
|
@@ -5,6 +5,7 @@ import { IOSPreferredFormat } from "../enums/IOSPreferredFormat";
|
|
|
5
5
|
import type { Byte, Kbps, Milliseconds, RecursivePartial, Seconds, TimerModule } from "@vkontakte/videoplayer-shared";
|
|
6
6
|
import { type ExactVideoQuality, VideoQuality } from "@vkontakte/videoplayer-shared";
|
|
7
7
|
import { AudioRuleName, VideoRuleName } from "../providers/utils/Abr/types";
|
|
8
|
+
import type { UserHappinessTrigger } from "./userHappinessTriggers";
|
|
8
9
|
import type { SegmentCacheConfig } from "../providers/utils/segmentCache/types";
|
|
9
10
|
export type ITuningConfig = {
|
|
10
11
|
/** @deprecated */
|
|
@@ -42,6 +43,15 @@ export type ITuningConfig = {
|
|
|
42
43
|
initialThroughput: Kbps;
|
|
43
44
|
measureNonSegmentRequests: boolean;
|
|
44
45
|
smallSampleMinDuration: Milliseconds;
|
|
46
|
+
/**
|
|
47
|
+
* Верхняя граница скорости одного замера (Кбпс), выше которой sanityCheck его
|
|
48
|
+
* отбрасывает: такую полосу не даёт пользовательский канал — это кэш CDN/браузера,
|
|
49
|
+
* отдавший объект практически мгновенно. Дефолт 1 000 000 Кбит/с унаследован из
|
|
50
|
+
* хардкода sanityCheck до этого поля. Поднимается в e2e (UVP-11954): CI-раннеры
|
|
51
|
+
* стоят в одном ДЦ с CDN и качают сегменты быстрее гигабита — с дефолтным лимитом
|
|
52
|
+
* все замеры режутся и хостовая запись кеша не появляется.
|
|
53
|
+
*/
|
|
54
|
+
maxSampleRate: Kbps;
|
|
45
55
|
cacheThresholdSize: Milliseconds;
|
|
46
56
|
/**
|
|
47
57
|
* UVP-11541: верхняя граница порога, ниже которого ответ считается кэш-хитом по TTFB.
|
|
@@ -71,7 +81,7 @@ export type ITuningConfig = {
|
|
|
71
81
|
* мелкий сегмент качается параллельно с аудио и другого замера не получает.
|
|
72
82
|
* Параллельной считается загрузка, отдававшая байты внутри окна замера: открытая,
|
|
73
83
|
* но молчащая (подвисла либо уже выкачала своё и ждёт done) полосу не занимает.
|
|
74
|
-
* Честный кэш (мгновенная отдача
|
|
84
|
+
* Честный кэш (мгновенная отдача — скорость замера выше maxSampleRate) по-прежнему режется.
|
|
75
85
|
*
|
|
76
86
|
* Пункты 3 и 4 добавлены после эксперимента 37621: без них включённые быстрые сэмплы
|
|
77
87
|
* систематически занижали оценку, ABR держал низкое качество и сегменты оставались
|
|
@@ -90,23 +100,41 @@ export type ITuningConfig = {
|
|
|
90
100
|
maxLastEvaluationTimeout: Milliseconds;
|
|
91
101
|
};
|
|
92
102
|
/**
|
|
93
|
-
*
|
|
94
|
-
* При включении: если сохранённое значение старше storedThroughputTtlMs
|
|
95
|
-
* или тип сети изменился (Wi-Fi→3G) — значение отбрасывается.
|
|
96
|
-
* Предотвращает старт в 4K при переходе с Wi-Fi на мобильную сеть.
|
|
103
|
+
* UVP-11954: кеш оценки сети с разрезом по хосту раздачи (CDN).
|
|
97
104
|
*
|
|
98
|
-
* При
|
|
99
|
-
*
|
|
100
|
-
*
|
|
105
|
+
* При включении: ключи vk_uvp_throughput / vk_uvp_rtt хранят JSON
|
|
106
|
+
* {"hosts":{"<host>":{"value","timestamp","networkType"?}}} — чтение только
|
|
107
|
+
* записи текущего хоста (TTL + совпадение networkType), промах = холодный старт
|
|
108
|
+
* (browser estimation, затем initialThroughput). Запись — hosts-only, без общей
|
|
109
|
+
* записи; набор хостов ограничен LRU по hostsLimit. Чтение отложено до
|
|
110
|
+
* первого события адаптации: определённая эмиссия hostname$ или первый замер.
|
|
101
111
|
*/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
112
|
+
cdnCache: {
|
|
113
|
+
/**
|
|
114
|
+
* Гейт всех изменений UVP-11954. При false (дефолт): бит-в-бит прежнее
|
|
115
|
+
* поведение — plain number в legacy-ключах one_video_*; ключи vk_uvp_*
|
|
116
|
+
* не читаются и не пишутся. Это даёт безопасный rollback JS-версии
|
|
117
|
+
* без потери свежих данных для старого кода.
|
|
118
|
+
*/
|
|
119
|
+
enabled: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Срок жизни каждой хостовой записи кеша (мс). По умолчанию 4 часа.
|
|
122
|
+
* Запись старше TTL при чтении отбрасывается — холодный старт.
|
|
123
|
+
* Применимо только при cdnCache.enabled=true.
|
|
124
|
+
*/
|
|
125
|
+
ttlMs: Milliseconds;
|
|
126
|
+
/**
|
|
127
|
+
* Предел числа хостовых записей в hosts (UVP-11954). При превышении при записи
|
|
128
|
+
* вытесняется запись с наименьшим timestamp (не считая текущего хоста).
|
|
129
|
+
* Протухшие по TTL записи уходят первыми — отдельной чистки нет.
|
|
130
|
+
* 10: ключ кеша — хост раздачи, а балансировщик video.get выдаёт хост
|
|
131
|
+
* при каждой загрузке видео и не гарантирует повтор предыдущего. За TTL
|
|
132
|
+
* активный пользователь может собрать записи по нескольким хостам —
|
|
133
|
+
* 10 покрывает это с запасом при ~100 Б на запись, ~1 КБ на набор из 10.
|
|
134
|
+
* Применимо только при cdnCache.enabled=true.
|
|
135
|
+
*/
|
|
136
|
+
hostsLimit: number;
|
|
137
|
+
};
|
|
110
138
|
};
|
|
111
139
|
autoTrackSelection: {
|
|
112
140
|
bitrateFactorAtEmptyBuffer: number;
|
|
@@ -143,7 +171,6 @@ export type ITuningConfig = {
|
|
|
143
171
|
enabled: boolean;
|
|
144
172
|
ignoreDynamicAbrForShortVideo: boolean;
|
|
145
173
|
stallDurationNoDataBeforeQualityDecrease: Milliseconds;
|
|
146
|
-
stallDurationToBeCount: Milliseconds;
|
|
147
174
|
stallCountBeforeQualityDecrease: Milliseconds;
|
|
148
175
|
resetQualityRestrictionTimeout: Milliseconds;
|
|
149
176
|
ignoreStallsOnSeek: boolean;
|
|
@@ -283,6 +310,9 @@ export type ITuningConfig = {
|
|
|
283
310
|
* дешевле замершего воспроизведения.
|
|
284
311
|
*/
|
|
285
312
|
recoverStuckSegmentLoading: boolean;
|
|
313
|
+
skipReloadOfFullyBufferedPartiallyEjectedSegments: boolean;
|
|
314
|
+
/** В Safari ждёт завершения append init-сегмента после abort перед выполнением remove. */
|
|
315
|
+
deferRemoveUntilAbortCompletes: boolean;
|
|
286
316
|
};
|
|
287
317
|
dashCmafLive: {
|
|
288
318
|
externalStopControl: boolean;
|
|
@@ -342,6 +372,8 @@ export type ITuningConfig = {
|
|
|
342
372
|
};
|
|
343
373
|
enableWakeLock: boolean;
|
|
344
374
|
enableTelemetryAtStart: boolean;
|
|
375
|
+
/** Список user-happiness-триггеров, включённых для отправки в tracer. Пустой список отключает их. */
|
|
376
|
+
userHappinessTriggers: UserHappinessTrigger[];
|
|
345
377
|
forceFormat: VideoFormat | undefined;
|
|
346
378
|
formatsToAvoid: VideoFormat[];
|
|
347
379
|
disableChromecast: boolean;
|
|
@@ -373,10 +405,10 @@ export type ITuningConfig = {
|
|
|
373
405
|
*/
|
|
374
406
|
stallIgnoreThreshold: Milliseconds;
|
|
375
407
|
/**
|
|
376
|
-
* Стратегия записи
|
|
408
|
+
* Стратегия записи stall
|
|
377
409
|
* verbose - записываем всё
|
|
378
|
-
* exclude-threshold - записываем
|
|
379
|
-
* include-threshold - записываем
|
|
410
|
+
* exclude-threshold - записываем stall длиннее stallIgnoreThreshold, но вычитаем длину stallIgnoreThreshold
|
|
411
|
+
* include-threshold - записываем stall длиннее stallIgnoreThreshold
|
|
380
412
|
*/
|
|
381
413
|
stallHandlingStrategy: "verbose" | "exclude-threshold" | "include-threshold";
|
|
382
414
|
stallIgnoreOnPause: boolean;
|
|
@@ -385,7 +417,6 @@ export type ITuningConfig = {
|
|
|
385
417
|
/** @deprecated HLS.js удалён, флаг ничего не делает */
|
|
386
418
|
useHlsJs: boolean;
|
|
387
419
|
disableHlsOnDesktop: boolean;
|
|
388
|
-
useNativeHLSTextTracks: boolean;
|
|
389
420
|
useNewSwitchTo: boolean;
|
|
390
421
|
alwaysAbortPreviousSwitch: boolean;
|
|
391
422
|
useDashProviderVirtual: boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const USER_HAPPINESS_TRIGGER_NAMES: readonly ["has_fatal_error", "slow_first_frame", "high_stall_ratio", "low_quality"];
|
|
2
|
+
export type UserHappinessTrigger = (typeof USER_HAPPINESS_TRIGGER_NAMES)[number];
|
|
3
|
+
export declare const isUserHappinessTrigger: (value: unknown) => value is UserHappinessTrigger;
|
|
4
|
+
export declare const normalizeUserHappinessTriggers: (value: unknown) => UserHappinessTrigger[];
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { IExternalTextTrack, IInternalTextTrack, ITextTrack } from "../../../player/types";
|
|
2
|
-
import type { IDesiredState, IProviderOutput } from "../../types";
|
|
3
|
-
/**
|
|
4
|
-
* TODO: сейчас externalTextTracks и internalTextTracks записываются в availableTextTracks отсюда
|
|
5
|
-
* нужно будет выпилить этот класс за исключением этой логики,
|
|
6
|
-
* когда перестанет быть необходима поддержка браузерных субтитров
|
|
7
|
-
*/
|
|
8
|
-
declare class TextTrackManager {
|
|
9
|
-
private available$;
|
|
10
|
-
private current$;
|
|
11
|
-
private error$;
|
|
12
|
-
private video;
|
|
13
|
-
private cueSettings;
|
|
14
|
-
private subscription;
|
|
15
|
-
private externalTracks;
|
|
16
|
-
private internalTracks;
|
|
17
|
-
private baseURL?;
|
|
18
|
-
constructor(baseURL?: string);
|
|
19
|
-
connect(video: HTMLVideoElement, desiredState: Pick<IDesiredState, "externalTextTracks" | "internalTextTracks" | "currentTextTrack" | "textTrackCuesSettings">, providerOutput: Pick<IProviderOutput, "availableTextTracks$" | "currentTextTrack$" | "error$">): void;
|
|
20
|
-
private subscribe;
|
|
21
|
-
private applyCueSettings;
|
|
22
|
-
private htmlTextTracksAsArray;
|
|
23
|
-
private htmlTextTrackToITextTrack;
|
|
24
|
-
private static isHealthyTrack;
|
|
25
|
-
setExternal(tracks: IExternalTextTrack[]): void;
|
|
26
|
-
setInternal(tracks: IInternalTextTrack[]): void;
|
|
27
|
-
select(selectedId: ITextTrack["id"] | undefined): void;
|
|
28
|
-
destroy(): void;
|
|
29
|
-
private attach;
|
|
30
|
-
private detach;
|
|
31
|
-
}
|
|
32
|
-
export default TextTrackManager;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { IValueSubject } from "@vkontakte/videoplayer-shared";
|
|
2
|
-
import type { IStateMachine } from "./StateMachine/types";
|
|
3
|
-
export declare const setStateWithSubscribe: <
|
|
4
|
-
State,
|
|
5
|
-
Value
|
|
6
|
-
>(nextState: State | undefined, currentState: IStateMachine<State | undefined>, availableValues: IValueSubject<Array<Value>> | undefined, predicate: (value: Value) => boolean) => void;
|