@vkontakte/videoplayer-core 2.0.176-dev.f3d8604c7.0 → 2.0.177-beta.0

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer-core",
3
- "version": "2.0.176-dev.f3d8604c7.0",
3
+ "version": "2.0.177-beta.0",
4
4
  "author": "vk.ru",
5
5
  "description": "Videoplayer core library based on the vk.ru platform",
6
6
  "homepage": "https://vk.ru",
@@ -42,6 +42,6 @@
42
42
  "**/*.d.ts"
43
43
  ],
44
44
  "dependencies": {
45
- "@vkontakte/videoplayer-shared": "1.0.105-dev.f3d8604c7.0"
45
+ "@vkontakte/videoplayer-shared": "1.0.106-beta.0"
46
46
  }
47
47
  }
package/types/index.d.ts CHANGED
@@ -3,9 +3,7 @@ import type { IMpegSource, IDashSource, IHLSSource, IDashURLSource, IHLSLiveSour
3
3
  import type { VideoCodec } from "./player/types";
4
4
  import { VideoFormat, Surface, PredefinedQualityLimits, VideoCodecName } from "./player/types";
5
5
  import Player from "./player/Player";
6
- import warmUpSources from "./utils/warmUpSources";
7
- import type { IWarmUp } from "./utils/warmUpSources";
8
- import type { IPlayer, IPlayerInfo, IPlayerEvents, IConfig, ISources, ICueSettings, IExternalTextTrack, ITextTrack, PlaybackRate, IVideoStream, IAudioStream, StartEnd, HttpConnectionMetrics, HttpDownloadMetrics } from "./player/types";
6
+ import type { IPlayer, IPlayerInfo, IPlayerEvents, IConfig, ISources, ICueSettings, IExternalTextTrack, ITextTrack, PlaybackRate, IVideoStream, IAudioStream } from "./player/types";
9
7
  import { PlaybackState, ChromecastState, HttpConnectionType } from "./player/types";
10
8
  import type { IOptionalTuningConfig } from "./utils/tuningConfig";
11
9
  export { clientChecker, isMobile } from "./utils/ClientChecker";
@@ -17,6 +15,5 @@ import { Subscription, Observable, Subject, ValueSubject, VideoQuality } from "@
17
15
  * @deprecated
18
16
  */
19
17
  declare const SDK_VERSION: string;
20
- export type { IPlayer, IPlayerInfo, IPlayerEvents, IConfig, IOptionalTuningConfig, ILogEntry, ISources, IExternalTextTrack, ITextTrack, ISubscription, IUnsubscriber, IObservable, IEmitter, IValueObservable, IValue, IOperator, IListener, IMpegSource, IDashSource, IDashURLSource, IHLSSource, IHLSLiveSource, URLSource, RawSource, URLSourceWithSeek, ExactVideoQuality, IRange, ISeekRequest, ICueSettings, PlaybackRate, IVideoStream, IAudioStream, StartEnd, HttpConnectionMetrics, HttpDownloadMetrics };
21
- export type { IWarmUp };
22
- export { Player, warmUpSources, PlaybackState, ChromecastState, HttpConnectionType, Surface, Subscription, VideoFormat, VideoQuality, Observable, Subject, ValueSubject, VERSION, SDK_VERSION, PredefinedQualityLimits, VideoCodec, VideoCodecName };
18
+ export type { IPlayer, IPlayerInfo, IPlayerEvents, IConfig, IOptionalTuningConfig, ILogEntry, ISources, IExternalTextTrack, ITextTrack, ISubscription, IUnsubscriber, IObservable, IEmitter, IValueObservable, IValue, IOperator, IListener, IMpegSource, IDashSource, IDashURLSource, IHLSSource, IHLSLiveSource, URLSource, RawSource, URLSourceWithSeek, ExactVideoQuality, IRange, ISeekRequest, ICueSettings, PlaybackRate, IVideoStream, IAudioStream };
19
+ export { Player, PlaybackState, ChromecastState, HttpConnectionType, Surface, Subscription, VideoFormat, VideoQuality, Observable, Subject, ValueSubject, VERSION, SDK_VERSION, PredefinedQualityLimits, VideoCodec, VideoCodecName };
@@ -29,7 +29,7 @@ export declare abstract class BaseVirtualBufferManager<T extends Segment> implem
29
29
  protected parsedInitData: Map<Representation["id"], CommonInit>;
30
30
  protected forwardBufferRepresentations: Map<Representation["id"], T[]>;
31
31
  protected segments: Map<Representation["id"], T[]>;
32
- protected gaps: IRange<Milliseconds>[];
32
+ protected gaps: Map<Representation["id"], IRange<Milliseconds>[]>;
33
33
  protected containerParser: ContainerParser;
34
34
  protected bufferPlaybackQueue: IBufferPlaybackQueueItem<T>[];
35
35
  protected downloadingBufferItems: IBufferPlaybackQueueItem<T>[];
@@ -76,8 +76,8 @@ export declare abstract class BaseVirtualBufferManager<T extends Segment> implem
76
76
  getActiveSegmentProgress(): VideoSegmentLoadProgress | undefined;
77
77
  getMpdSegmentDuration(): Milliseconds | undefined;
78
78
  get lastDataObtainedTimestamp(): Milliseconds;
79
+ protected searchGaps(representationId: Representation["id"], segments: T[]): void;
79
80
  getGaps(): IRange<Milliseconds>[];
80
- protected searchGaps(): void;
81
81
  setTarget(time: Milliseconds): void;
82
82
  setPreloadOnly(preloadOnly: boolean): void;
83
83
  destroy(): void;
@@ -108,8 +108,6 @@ export declare abstract class BaseVirtualBufferManager<T extends Segment> implem
108
108
  protected loadInits(): Promise<void>;
109
109
  protected loadInitIfNeeded(representation: Representation, requestedPriority?: Priority, critical?: boolean): Promise<void>;
110
110
  protected loadInit(representation: Representation, requestedPriority?: Priority, critical?: boolean): Promise<void>;
111
- private lockForNativeOps;
112
- private lockForSwitchInit;
113
111
  protected maintainNativeBuffer(signal: AbortSignal): Promise<void>;
114
112
  protected maintainPlaybackBuffer(position: Milliseconds): Promise<void>;
115
113
  protected actualizeLastSegmentInfo(currentPosition: Milliseconds): void;
@@ -118,4 +118,5 @@ export declare abstract class BasePlayer {
118
118
  protected tick(): Promise<void>;
119
119
  private jumpToMaxBufferStartIfNeeded;
120
120
  private collectGapEndsContaining;
121
+ private jumpToFirstNativeBufferFrameIfNeeded;
121
122
  }
@@ -215,6 +215,7 @@ export type ITuningConfig = {
215
215
  ignoreNetworkErrorsOnLoadInit: boolean;
216
216
  bufferTolerance: Milliseconds;
217
217
  useBufferGapWatchdog: boolean;
218
+ jumpToFirstNativeBufferFrame: boolean;
218
219
  minNativeBufferSize: Milliseconds;
219
220
  removeTimeShiftFromSegment: Milliseconds;
220
221
  tickMaintainInterval: Milliseconds;
@@ -1,21 +0,0 @@
1
- export interface IWarmUpTargets {
2
- preconnect: string[];
3
- dnsPrefetch: string[];
4
- }
5
- /**
6
- * Прогрев соединения к хостам раздачи. Первый запрос плеера иначе оплачивает полный
7
- * холодный путь DNS → TCP → TLS, и только после него едут байты.
8
- *
9
- * `crossOrigin` на preconnect обязателен: медиазапросы уходят с CORS, а прогретое без него
10
- * соединение лежит в другом пуле браузера — то есть впустую. Для dns-prefetch он не нужен:
11
- * резолв имени от пула соединений не зависит.
12
- *
13
- * Линки снимаются при `destroy`: плеер переинициализируют, и без уборки `<head>` копил бы
14
- * их до перезагрузки страницы.
15
- */
16
- export declare class ConnectionWarmUp {
17
- private links;
18
- warmUp(targets: IWarmUpTargets): IWarmUpTargets;
19
- destroy(): void;
20
- private appendLinks;
21
- }
@@ -1,19 +0,0 @@
1
- import type { ISources } from "../player/types";
2
- import type { IWarmUpTargets } from "./ConnectionWarmUp";
3
- export interface IWarmUp {
4
- applied: IWarmUpTargets;
5
- destroy: () => void;
6
- }
7
- interface IOptions {
8
- failoverHosts?: string[];
9
- limit?: number;
10
- }
11
- /**
12
- * Прогрев соединения к хостам раздачи по готовым `sources` — до того, как создан плеер.
13
- *
14
- * Экономия равна запасу времени до первого запроса: плеер успевает пройти путь от `initVideo`
15
- * до манифеста за считанные миллисекунды, поэтому звать эту функцию имеет смысл там, где
16
- * `sources` появились сильно раньше плеера, — сразу после ответа API у потребителя.
17
- */
18
- declare const _default: (sources: ISources, { failoverHosts, limit }?: IOptions) => IWarmUp;
19
- export default _default;
@@ -1,18 +0,0 @@
1
- import type { ISources } from "../player/types";
2
- /**
3
- * Хосты, к которым плеер пойдёт за данными. Считаются до того, как выбран формат:
4
- * прогрев соединения имеет смысл ровно пока выбор ещё не сделан.
5
- *
6
- * Лимит намеренно жёсткий. Каждое лишнее соединение — это DNS, TCP и TLS, потраченные
7
- * на хост, к которому в этой сессии, скорее всего, не пойдут.
8
- */
9
- export declare const collectSourceOrigins: (sources: ISources, limit?: number) => string[];
10
- /**
11
- * Запасные хосты, которым достаточно резолва имени. Соединение к ним в большинстве сессий
12
- * не понадобится — failover это аварийный путь, — но DNS стоит дешевле соединения,
13
- * поэтому лимит прогрева на них не распространяется.
14
- *
15
- * `failoverHosts` — голые хосты: `ProviderContainer.applyFailoverHost` подставляет их
16
- * в существующий URL, сохраняя протокол. Протокол здесь берётся у прогретого источника.
17
- */
18
- export declare const collectDnsPrefetchHosts: (failoverHosts: string[], preconnectOrigins: string[]) => string[];