@vkontakte/videoplayer-core 2.0.136-dev.3c83a8ac.0 → 2.0.136-dev.47a35d10.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.136-dev.3c83a8ac.0",
3
+ "version": "2.0.136-dev.47a35d10.0",
4
4
  "author": "vk.com",
5
5
  "description": "Videoplayer core library based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -54,6 +54,6 @@
54
54
  "**/*.d.ts"
55
55
  ],
56
56
  "dependencies": {
57
- "@vkontakte/videoplayer-shared": "1.0.64-dev.4e556fd6.0"
57
+ "@vkontakte/videoplayer-shared": "1.0.64-dev.ba1f4b34.0"
58
58
  }
59
59
  }
package/types/index.d.ts CHANGED
@@ -4,6 +4,7 @@ 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
6
  export { clientChecker, isMobile } from './utils/ClientChecker';
7
+ export { areValidLiveRecordSources } from './utils/videoFormat';
7
8
  import type { ISubscription, IUnsubscriber, IEmitter, IObservable, IValueObservable, IValue, IOperator, IListener, ILogEntry, IRange, ExactVideoQuality } from '@vkontakte/videoplayer-shared';
8
9
  import { Subscription, Observable, Subject, ValueSubject, VideoQuality } from '@vkontakte/videoplayer-shared';
9
10
  /**
@@ -49,6 +49,7 @@ export default class Player implements IPlayer {
49
49
  isLooped$: ValueSubject<boolean>;
50
50
  isLive$: ValueSubject<boolean | undefined>;
51
51
  isLiveEnded$: ValueSubject<boolean | null>;
52
+ canPlayLiveTailBuffer$: ValueSubject<boolean>;
52
53
  canChangePlaybackSpeed$: ValueSubject<boolean | undefined>;
53
54
  atLiveEdge$: ValueSubject<boolean | undefined>;
54
55
  atLiveDurationEdge$: ValueSubject<boolean | undefined>;
@@ -331,6 +331,10 @@ export interface IPlayerInfo {
331
331
  * Играем ли мы сейчас самый актуальный кадр лайва
332
332
  */
333
333
  atLiveEdge$: IValueObservable<boolean | undefined>;
334
+ /**
335
+ * Может ли плеер доиграть буффер законченной трансляции при перемотке
336
+ */
337
+ canPlayLiveTailBuffer$: IValueObservable<boolean>;
334
338
  /**
335
339
  * Играем ли мы сейчас самый старый кадр лайва
336
340
  */
@@ -26,6 +26,7 @@ export interface FetchParams {
26
26
  priority?: Priority;
27
27
  measureThroughput?: boolean;
28
28
  isLowLatency?: boolean;
29
+ bufferOptimisation?: boolean;
29
30
  }
30
31
  export type RepresentationFetchResult = {
31
32
  init: CommonInit | null;
@@ -93,5 +93,5 @@ export declare class Player {
93
93
  /**
94
94
  * Возвращает duration в милисекундах.
95
95
  */
96
- calculateDurationFromSegments(): number | undefined;
96
+ calculateDurationFromSegments(): number;
97
97
  }
@@ -26,6 +26,7 @@ export interface FetchParams {
26
26
  priority?: Priority;
27
27
  measureThroughput?: boolean;
28
28
  isLowLatency?: boolean;
29
+ bufferOptimisation?: boolean;
29
30
  }
30
31
  export type RepresentationFetchResult = {
31
32
  init: CommonInit | null;
@@ -1,7 +1,5 @@
1
1
  import { VideoFormat } from '../../../player/types';
2
2
  import { type ITuningConfig } from '../../../utils/tuningConfig';
3
- type FilterConstraints = Pick<ITuningConfig, 'useManagedMediaSource' | 'useOldMSEDetection'>;
4
- export declare const filterAvailableFormats: (formats: VideoFormat[], { useManagedMediaSource, useOldMSEDetection }: FilterConstraints) => VideoFormat[];
5
3
  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;
6
4
  type Constraints = Pick<ITuningConfig, 'webmCodec' | 'androidPreferredFormat' | 'preferCMAF' | 'preferWebRTC' | 'preferMultiStream'>;
7
5
  /**
@@ -69,6 +69,7 @@ export interface IProviderOutput {
69
69
  isBuffering$: IValueSubject<boolean>;
70
70
  isLive$: IValueSubject<boolean | undefined>;
71
71
  isLiveEnded$: IValueSubject<boolean | null>;
72
+ canPlayLiveTailBuffer$: IValueSubject<boolean>;
72
73
  isLowLatency$: IValueSubject<boolean | undefined>;
73
74
  liveTime$: IValueSubject<Milliseconds | undefined>;
74
75
  liveBufferTime$: IValueSubject<Milliseconds | undefined>;
@@ -1,4 +1,4 @@
1
- import { type Box } from './box';
1
+ import { type Box, ValidBox } from './box';
2
2
  /**
3
3
  * Queryable object to get needed boxes from structure
4
4
  */
@@ -12,9 +12,9 @@ export declare class BoxModel {
12
12
  /**
13
13
  * Returns first box of given type
14
14
  */
15
- find<T extends Box>(type: string): T | null;
15
+ find<T extends Box>(type: string): ValidBox<T> | null;
16
16
  /**
17
- * Returns all boxes of given typoe
17
+ * Returns all boxes of given type
18
18
  */
19
- findAll<T extends Box>(type: string): T[];
19
+ findAll<T extends Box>(type: string): ValidBox<T>[];
20
20
  }
@@ -1,4 +1,9 @@
1
1
  import { type BoxParser } from './BoxParser';
2
+ export type ValidBox<T extends Box> = T & {
3
+ valid: true;
4
+ size: number;
5
+ };
6
+ export declare const isValid: <T extends Box>(box: T) => box is ValidBox<T>;
2
7
  /**
3
8
  * Generic boxes description
4
9
  *
@@ -19,10 +24,9 @@ export declare class Box {
19
24
  source: DataView;
20
25
  boxParser: BoxParser;
21
26
  type: string;
22
- size32: number;
23
- size64: number;
24
- usertype: number;
27
+ size: number | undefined;
25
28
  content: DataView;
29
+ valid: boolean;
26
30
  children: Box[];
27
31
  /**
28
32
  * Next byte in source buffer to be read
@@ -32,10 +36,6 @@ export declare class Box {
32
36
  * for compatibility with old Box type
33
37
  */
34
38
  get id(): string;
35
- /**
36
- *
37
- */
38
- get size(): number;
39
39
  constructor(source: DataView, boxParser: BoxParser);
40
40
  /**
41
41
  * Internal method to scan for children
@@ -1,26 +1,26 @@
1
1
  export { Box } from '../box';
2
- export { UnknownBox } from '../boxes/unknown';
3
- export { UuidBox } from '../boxes/uuid';
4
- export { FtypBox } from '../boxes/ftyp';
5
- export { MoovBox } from '../boxes/moov';
6
- export { MvhdBox } from '../boxes/mvhd';
7
- export { MoofBox } from '../boxes/moof';
8
- export { MdatBox } from '../boxes/mdat';
9
- export { SidxBox, SidxBoxSegment } from '../boxes/sidx';
10
- export { TrakBox } from '../boxes/trak';
11
- export { Sv3dBox } from '../boxes/sv3d';
12
- export { St3dBox } from '../boxes/st3d';
13
- export { PrhdBox } from '../boxes/prhd';
14
- export { EquiBox } from '../boxes/equi';
15
- export { MdiaBox } from '../boxes/mdia';
16
- export { TkhdBox } from '../boxes/tkhd';
17
- export { MinfBox } from '../boxes/minf';
18
- export { ProjBox } from '../boxes/proj';
19
- export { MfhdBox } from '../boxes/mfhd';
20
- export { TrafBox } from '../boxes/traf';
21
- export { TfhdBox } from '../boxes/tfhd';
22
- export { TfdtBox } from '../boxes/tfdt';
23
- export { TrunBox } from '../boxes/trun';
24
- export { StblBox } from '../boxes/stbl';
25
- export { StsdBox } from '../boxes/stsd';
26
- export { Avc1Box } from '../boxes/avc1';
2
+ export { UnknownBox } from './unknown';
3
+ export { UuidBox } from './uuid';
4
+ export { FtypBox } from './ftyp';
5
+ export { MoovBox } from './moov';
6
+ export { MvhdBox } from './mvhd';
7
+ export { MoofBox } from './moof';
8
+ export { MdatBox } from './mdat';
9
+ export { SidxBox, SidxBoxSegment } from './sidx';
10
+ export { TrakBox } from './trak';
11
+ export { Sv3dBox } from './sv3d';
12
+ export { St3dBox } from './st3d';
13
+ export { PrhdBox } from './prhd';
14
+ export { EquiBox } from './equi';
15
+ export { MdiaBox } from './mdia';
16
+ export { TkhdBox } from './tkhd';
17
+ export { MinfBox } from './minf';
18
+ export { ProjBox } from './proj';
19
+ export { MfhdBox } from './mfhd';
20
+ export { TrafBox } from './traf';
21
+ export { TfhdBox } from './tfhd';
22
+ export { TfdtBox } from './tfdt';
23
+ export { TrunBox } from './trun';
24
+ export { StblBox } from './stbl';
25
+ export { StsdBox } from './stsd';
26
+ export { Avc1Box } from './avc1';
@@ -1,11 +1,18 @@
1
1
  import { Box } from '../box';
2
2
  import { BoxParser } from '../BoxParser';
3
3
  import { Milliseconds } from '@vkontakte/videoplayer-shared';
4
- export declare class UuidBox extends Box {
5
- serverDataReceivedTimestamp: Milliseconds;
6
- serverDataPreparedTime: Milliseconds;
7
- private readonly ondemandPrefix;
8
- private readonly ondemandDataReceivedKey;
9
- private readonly ondemandDataPreparedKey;
4
+ export declare const enum UserType {
5
+ ONDEMAND_LIVE_TIME = "ondemandlivejson"
6
+ }
7
+ export type ServerLiveProcessingTimes = {
8
+ received: Milliseconds;
9
+ prepared: Milliseconds;
10
+ };
11
+ export type KNOWN_UUID_BOXES = {
12
+ [UserType.ONDEMAND_LIVE_TIME]: ServerLiveProcessingTimes;
13
+ };
14
+ export declare class UuidBox<T extends UserType> extends Box {
15
+ userData: KNOWN_UUID_BOXES[T];
10
16
  constructor(source: DataView, boxParser: BoxParser);
17
+ private parseData;
11
18
  }
@@ -104,6 +104,7 @@ export type ITuningConfig = {
104
104
  sourceOpenTimeout: number;
105
105
  vktvAbrThrottle: number;
106
106
  timeupdateEventTickThrottle: number;
107
+ fetcherBufferOptimisation: boolean;
107
108
  };
108
109
  dashCmafLive: {
109
110
  maxActiveLiveOffset: Milliseconds;
@@ -112,6 +113,7 @@ export type ITuningConfig = {
112
113
  normalizedActualBufferOffset: Milliseconds;
113
114
  offsetCalculationError: Milliseconds;
114
115
  maxLiveDuration: Seconds;
116
+ catchupLiveForMutedInactiveTab: boolean;
115
117
  lowLatency: {
116
118
  maxTargetOffset: Milliseconds;
117
119
  maxTargetOffsetDeviation: Milliseconds;
@@ -1,2 +1,7 @@
1
- import { VideoFormat } from '../player/types';
1
+ import { type ISources, VideoFormat } from '../player/types';
2
+ import type { ITuningConfig } from '../utils/tuningConfig';
3
+ type FilterConstraints = Pick<ITuningConfig, 'useManagedMediaSource' | 'useOldMSEDetection'>;
4
+ export declare const filterAvailableFormats: (formats: VideoFormat[], { useManagedMediaSource, useOldMSEDetection }: FilterConstraints) => VideoFormat[];
2
5
  export declare const isLiveFormat: (format: VideoFormat) => boolean;
6
+ export declare const areValidLiveRecordSources: (sources: ISources, constraints: FilterConstraints) => boolean;
7
+ export {};