@vkontakte/videoplayer-core 2.0.128-dev.1d1cd071.0 → 2.0.128-dev.3a6dea1e.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.128-dev.1d1cd071.0",
3
+ "version": "2.0.128-dev.3a6dea1e.0",
4
4
  "author": "vk.com",
5
5
  "description": "Videoplayer core library based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -49,7 +49,7 @@
49
49
  "**/*.d.ts"
50
50
  ],
51
51
  "dependencies": {
52
- "@vkontakte/videoplayer-shared": "1.0.56-dev.26550892.0",
52
+ "@vkontakte/videoplayer-shared": "1.0.56-dev.793a3cfd.0",
53
53
  "hls.js": "~1.4.7"
54
54
  }
55
55
  }
package/types/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { VideoFormat, IMpegSource, IDashSource, IHLSSource, IDashURLSource, IHLS
3
3
  import Player from './player/Player';
4
4
  import { IPlayer, PlaybackState, IPlayerInfo, IPlayerEvents, IConfig, ISources, ICueSettings, ChromecastState, HttpConnectionType, IExternalTextTrack, ITextTrack, PlaybackRate, IVideoStream, IAudioStream } from './player/types';
5
5
  import type { IOptionalTuningConfig } from './utils/tuningConfig';
6
+ export { clientChecker, isMobile } from './utils/ClientChecker';
6
7
  import type { ISubscription, IUnsubscriber, IEmitter, IObservable, IValueObservable, IValue, IOperator, IListener, ILogEntry, IRange, ExactVideoQuality } from '@vkontakte/videoplayer-shared';
7
8
  import { Subscription, Observable, Subject, ValueSubject, VideoQuality } from '@vkontakte/videoplayer-shared';
8
9
  /**
@@ -17,6 +17,7 @@ export default class Player implements IPlayer {
17
17
  private initedAt;
18
18
  private hasLiveOffsetByPaused;
19
19
  private hasLiveOffsetByPausedTimer;
20
+ private playerInited;
20
21
  private explicitInitialQuality;
21
22
  private wasSetStartedQuality;
22
23
  private desiredState;
@@ -191,4 +192,5 @@ export default class Player implements IPlayer {
191
192
  private initWakeLock;
192
193
  private setVideoTrackIdByQuality;
193
194
  private getActiveLiveDelay;
195
+ private isNotActiveTabCase;
194
196
  }
@@ -1,7 +1,5 @@
1
1
  import { VideoFormat } from '../../../player/types';
2
2
  import { type ITuningConfig } from '../../../utils/tuningConfig';
3
- export declare const nativeHlsSupported: boolean;
4
- export declare const getSupportedCodecs: () => string[];
5
3
  type FilterConstraints = Pick<ITuningConfig, 'useHlsJs' | 'useManagedMediaSource' | 'useOldMSEDetection'>;
6
4
  export declare const filterAvailableFormats: (formats: VideoFormat[], { useHlsJs, useManagedMediaSource, useOldMSEDetection }: FilterConstraints) => VideoFormat[];
7
5
  type VodFormat = VideoFormat.MPEG | VideoFormat.DASH_SEP | VideoFormat.DASH_WEBM | VideoFormat.DASH_WEBM_AV1 | VideoFormat.DASH_STREAMS | VideoFormat.DASH_ONDEMAND | VideoFormat.HLS | VideoFormat.HLS_ONDEMAND;
@@ -0,0 +1,22 @@
1
+ import { BrowserChecker } from './services/BrowserChecker';
2
+ import { DeviceChecker } from './services/DeviceChecker';
3
+ import { DisplayChecker } from './services/DisplayChecker';
4
+ import { VideoChecker } from './services/VideoChecker';
5
+ import { AudioChecker } from './services/AudioChecker';
6
+ import { ValueSubject } from '@vkontakte/videoplayer-shared';
7
+ export declare class ClientChecker {
8
+ isInited$: ValueSubject<boolean>;
9
+ private _displayChecker;
10
+ private _deviceChecker;
11
+ private _browserChecker;
12
+ private _videoChecker;
13
+ private _audioChecker;
14
+ constructor();
15
+ get display(): DisplayChecker;
16
+ get device(): DeviceChecker;
17
+ get browser(): BrowserChecker;
18
+ get video(): VideoChecker;
19
+ get audio(): AudioChecker;
20
+ detect(): Promise<void>;
21
+ }
22
+ export declare const clientChecker: ClientChecker;
@@ -0,0 +1,2 @@
1
+ export { clientChecker } from './ClientChecker';
2
+ export { isMobile } from './utils/isMobile';
@@ -0,0 +1,10 @@
1
+ import { Checker } from '../../../utils/ClientChecker/types/checker';
2
+ export declare const mp3Mime = "audio/mpeg";
3
+ export declare class AudioChecker implements Checker {
4
+ private _audio;
5
+ private _containers;
6
+ private _codecs;
7
+ supportMp3(): boolean;
8
+ detect(): void;
9
+ private destroyAudioElement;
10
+ }
@@ -0,0 +1,13 @@
1
+ import { CurrentClientBrowser } from '../../../utils/ClientChecker/types/currentClientBrowser';
2
+ import { Checker } from '../../../utils/ClientChecker/types/checker';
3
+ export declare class BrowserChecker implements Checker {
4
+ private _current;
5
+ private _safariVersion;
6
+ get current(): CurrentClientBrowser;
7
+ get isYandex(): boolean;
8
+ get isSafari(): boolean;
9
+ get isSamsungBrowser(): boolean;
10
+ get safariVersion(): number | undefined;
11
+ detect(): void;
12
+ private detectSafariVersion;
13
+ }
@@ -0,0 +1,23 @@
1
+ import { CurrentClientDevice } from '../../../utils/ClientChecker/types/currentClientDevice';
2
+ import { DisplayChecker } from '../../../utils/ClientChecker/services/DisplayChecker';
3
+ import { Checker } from '../../../utils/ClientChecker/types/checker';
4
+ export declare class DeviceChecker implements Checker {
5
+ private _displayChecker;
6
+ private _isMobile;
7
+ private _current;
8
+ private _iosVersion;
9
+ private _highEntropyValues;
10
+ constructor(displayChecker: DisplayChecker);
11
+ get current(): CurrentClientDevice;
12
+ get isIOS(): boolean;
13
+ get isMac(): boolean;
14
+ get isApple(): boolean;
15
+ get isIphoneOrOldIpad(): boolean;
16
+ get isAndroid(): boolean;
17
+ get isMobile(): boolean;
18
+ get iOSVersion(): number | undefined;
19
+ detect(): void;
20
+ private detectHighEntropyValues;
21
+ private detectDevice;
22
+ private detectIOSVersion;
23
+ }
@@ -0,0 +1,22 @@
1
+ import { Checker } from '../../../utils/ClientChecker/types/checker';
2
+ export { isMobile } from '../utils/isMobile';
3
+ export declare class DisplayChecker implements Checker {
4
+ private _maxTouchPoints;
5
+ private _height;
6
+ private _width;
7
+ private _isHdr;
8
+ private _pixelRatio;
9
+ private _screenHeight;
10
+ private _screenWidth;
11
+ private _colorDepth;
12
+ get isTouch(): boolean;
13
+ get maxTouchPoints(): number;
14
+ get height(): number;
15
+ get width(): number;
16
+ get screenHeight(): number;
17
+ get screenWidth(): number;
18
+ get pixelRatio(): number;
19
+ get isHDR(): boolean;
20
+ get colorDepth(): number;
21
+ detect(): void;
22
+ }
@@ -0,0 +1,45 @@
1
+ import { VideoFormat } from '../../../player/types';
2
+ import { DeviceChecker } from './DeviceChecker';
3
+ import { BrowserChecker } from './BrowserChecker';
4
+ import { Checker } from '../../../utils/ClientChecker/types/checker';
5
+ type Protocols = {
6
+ mms: boolean;
7
+ mse: boolean;
8
+ hls: boolean;
9
+ webrtc: boolean;
10
+ ws: boolean;
11
+ };
12
+ type Containers = {
13
+ mp4: boolean;
14
+ webm: boolean;
15
+ cmaf: boolean;
16
+ };
17
+ type Codecs = {
18
+ h264: boolean;
19
+ h265: boolean;
20
+ vp9: boolean;
21
+ av1: boolean;
22
+ aac: boolean;
23
+ opus: boolean;
24
+ mpeg: boolean;
25
+ };
26
+ export type WebmFormat = VideoFormat.DASH_WEBM | VideoFormat.DASH_WEBM_AV1;
27
+ export declare class VideoChecker implements Checker {
28
+ private _video;
29
+ private _deviceChecker;
30
+ private _browserChecker;
31
+ private _protocols;
32
+ private _containers;
33
+ private _codecs;
34
+ private _nativeHlsSupported;
35
+ constructor(deviceChecker: DeviceChecker, browserChecker: BrowserChecker);
36
+ get protocols(): Protocols;
37
+ get containers(): Containers;
38
+ get codecs(): Codecs;
39
+ get webmDecodingInfo(): Record<WebmFormat, MediaCapabilitiesDecodingInfo> | undefined;
40
+ get supportedCodecs(): string[];
41
+ get nativeHlsSupported(): boolean;
42
+ detect(): void;
43
+ private destroyVideoElement;
44
+ }
45
+ export {};
@@ -0,0 +1,3 @@
1
+ export interface Checker {
2
+ detect(): void;
3
+ }
@@ -0,0 +1,12 @@
1
+ export declare enum CurrentClientBrowser {
2
+ Unknown = "Unknown",
3
+ Yandex = "Yandex",
4
+ Chrome = "Chrome",
5
+ Chromium = "Chromium",//Хром и хромиум разделяем специально. Почти единственное отличие, поддержка H.264 как раз важна для нас
6
+ Firefox = "Firefox",
7
+ Safari = "Safari",
8
+ Opera = "Opera",
9
+ Edge = "Edge",
10
+ SamsungBrowser = "SamsungBrowser",
11
+ Rest = "Rest"
12
+ }
@@ -0,0 +1,10 @@
1
+ export declare enum CurrentClientDevice {
2
+ Unknown = "Unknown",
3
+ Android = "Android",
4
+ iPhone = "iPhone",
5
+ iPad = "iPad",
6
+ iPod = "iPod",
7
+ RestMobile = "RestMobile",
8
+ Mac = "Mac",
9
+ Desktop = "Desktop"
10
+ }
@@ -0,0 +1,33 @@
1
+ export declare enum ClientArchitecture {
2
+ ARM = "arm",
3
+ X86 = "x86"
4
+ }
5
+ export declare enum ClientBitness {
6
+ SHORT = "32",
7
+ LONG = "64"
8
+ }
9
+ export interface UADataBrandItem {
10
+ brand: string;
11
+ version: string;
12
+ }
13
+ export declare enum UADataPlatform {
14
+ WINDOWS = "Windows",
15
+ MACOS = "macOS",
16
+ LINUX = "Linux",
17
+ ANDROID = "Android",
18
+ IOS = "iOS"
19
+ }
20
+ export interface HighEntropyValues {
21
+ mobile?: boolean;
22
+ model?: string;
23
+ platform?: UADataPlatform;
24
+ platformVersion?: string;
25
+ architecture?: ClientArchitecture;
26
+ bitness?: ClientBitness;
27
+ brands?: UADataBrandItem[];
28
+ }
29
+ export type NavigatorWithUserAgentData = Navigator & {
30
+ userAgentData: {
31
+ getHighEntropyValues: (values: Array<string>) => HighEntropyValues;
32
+ };
33
+ };
@@ -0,0 +1 @@
1
+ export declare const isMobile: () => boolean;
@@ -198,6 +198,7 @@ export type ITuningConfig = {
198
198
  * Отключает яндексовскую магию с пипом.
199
199
  */
200
200
  disableYandexPiP?: boolean;
201
+ asyncResolveClientChecker?: boolean;
201
202
  };
202
203
  export type IOptionalTuningConfig = RecursivePartial<ITuningConfig> & {
203
204
  configName: ITuningConfig['configName'];