@vkontakte/videoplayer-core 2.0.105-dev.17a808f4.0 → 2.0.105-dev.330f23f2.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.105-dev.17a808f4.0",
3
+ "version": "2.0.105-dev.330f23f2.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.37-dev.0bef53b3.0",
52
+ "@vkontakte/videoplayer-shared": "1.0.37-dev.83782ae3.0",
53
53
  "hls.js": "~1.4.7"
54
54
  }
55
55
  }
@@ -394,6 +394,7 @@ export interface IConfig {
394
394
  sources: ISources;
395
395
  meta?: IMetadata;
396
396
  failoverHosts?: string[];
397
+ volumeMultiplier?: number;
397
398
  }
398
399
  export interface ISources {
399
400
  [VideoFormat.MPEG]?: IMpegSource;
@@ -467,6 +468,7 @@ export interface IVideoStream {
467
468
  id: string;
468
469
  language?: string;
469
470
  hdr?: boolean;
471
+ codec?: string;
470
472
  label?: string;
471
473
  }
472
474
  export interface IVideoTrack {
@@ -480,6 +482,7 @@ export interface IAudioStream {
480
482
  id: string;
481
483
  language?: string;
482
484
  label?: string;
485
+ codec?: string;
483
486
  isDefault?: boolean;
484
487
  }
485
488
  export interface IAudioTrack {
@@ -46,7 +46,7 @@ export default abstract class BaseDashProvider implements IProvider {
46
46
  protected abstract seek(position: Milliseconds, forcePrecise: boolean): void;
47
47
  protected getProviderSubscriptionInfo(): IProviderSubscriptionInfo;
48
48
  protected subscribe(): void;
49
- protected selectVideoAudioRepresentations(): [Representation, Representation] | undefined;
49
+ protected selectVideoAudioRepresentations(): [Representation, Representation | undefined] | undefined;
50
50
  protected prepare(manifestOffset?: number): void;
51
51
  protected syncPlayback: () => undefined;
52
52
  protected init3DScene: (init: CommonInit) => void;
@@ -1 +1,2 @@
1
1
  export declare const DASH_LIVE_UPDATE_INTERVAL_MS = 1000;
2
+ export declare const DASH_STALL_UPDATE_INTERVAL_MS = 1000;
@@ -64,7 +64,8 @@ export declare class BufferManager {
64
64
  getLiveSegmentsToLoadState(manifest: Manifest | null): IRange<Milliseconds> | undefined;
65
65
  seekLive: (param_0: Stream[] | undefined) => Promise<void | undefined>;
66
66
  updateLive(manifest: Manifest | null): void;
67
- private updateLowLatencyLive;
67
+ proceedLowLatencyLive(): void;
68
+ private updateLowLatencyLiveIfNeeded;
68
69
  findSegmentStartTime(position: Milliseconds): Milliseconds | undefined;
69
70
  setTarget(time: Milliseconds): void;
70
71
  setPreloadOnly(preloadOnly: boolean): void;
@@ -88,11 +89,15 @@ export declare class BufferManager {
88
89
  * @private
89
90
  */
90
91
  private onSomeByteRangesDataLoaded;
92
+ private onSomeByteRangesDataLoadedOld;
93
+ private onSomeByteRangesDataLoadedNew;
91
94
  private onSegmentFullyAppended;
92
95
  private abortSegment;
93
96
  private loadNextInit;
94
97
  private loadInit;
95
98
  private pruneBuffer;
99
+ private pruneBufferNew;
100
+ private pruneBufferOld;
96
101
  private abortBuffer;
97
102
  getDebugBufferState(): IRange<Milliseconds> | undefined;
98
103
  private detectGaps;
@@ -47,7 +47,7 @@ export declare class Player {
47
47
  livePositionFromPlayer$: IValueSubject<number>;
48
48
  liveEstimatedDelay: ISmoothedValue;
49
49
  timeInWaiting: number;
50
- isActiveLowLatency: boolean;
50
+ isActiveLowLatency$: IValueSubject<boolean>;
51
51
  private isUpdatingLive;
52
52
  private isJumpGapAfterSeekLive;
53
53
  private liveLastSeekOffset;
@@ -8,10 +8,10 @@ export declare enum StreamKind {
8
8
  TEXT = "text"
9
9
  }
10
10
  export declare enum LiveStatus {
11
- ActiveLowLatency = 0,
12
- LiveWithTargetOffset = 1,
13
- LiveForwardBuffering = 2,
14
- None = 3
11
+ ActiveLowLatency = "active_low_latency",
12
+ LiveWithTargetOffset = "live_with_target_offset",
13
+ LiveForwardBuffering = "live_forward_buffering",
14
+ None = "none"
15
15
  }
16
16
  export declare enum Profile {
17
17
  WEBM_AS_IN_SPEC = "urn:mpeg:dash:profile:webm-on-demand:2012",
@@ -1,5 +1,5 @@
1
1
  import { Representation, Segment, SegmentReference, Stream, TemplateSegment, TemplateSegmentReference } from '../../../providers/DashProvider/lib/types';
2
- import { IAudioTrack, IInternalTextTrack, IVideoTrack } from '../../../player/types';
2
+ import { IAudioStream, IAudioTrack, IInternalTextTrack, IVideoStream, IVideoTrack } from '../../../player/types';
3
3
  export declare const representationToVideoTrack: ({ id, width, height, bitrate, fps, quality: qualityString }: Representation) => IVideoTrack | undefined;
4
4
  export declare const representationToAudioTrack: ({ id, bitrate }: Representation) => IAudioTrack;
5
5
  export declare const selectAudioForVideo: (videoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[]) => IAudioTrack | undefined;
@@ -7,6 +7,8 @@ export declare const representationToTextTrack: ({ language, label }: Stream, {
7
7
  url: string;
8
8
  isAuto: boolean;
9
9
  }) => IInternalTextTrack;
10
+ export declare const streamToIAudioStream: ({ id, language, label, codecs }: Stream) => IAudioStream;
11
+ export declare const streamToIVideoStream: ({ id, language, label, hdr, codecs }: Stream) => IVideoStream;
10
12
  export declare const isTemplateSegment: (segment: Segment) => segment is TemplateSegment;
11
13
  export declare const isTemplateSegmentReference: (segmentReference: SegmentReference) => segmentReference is TemplateSegmentReference;
12
14
  export declare const isAbortError: (e: Error | unknown) => boolean;
@@ -10,11 +10,13 @@ interface IParams extends IProviderDependencies {
10
10
  failoverHosts: string[];
11
11
  desiredState: IDesiredState;
12
12
  tuning: ITuningConfig;
13
+ volumeMultiplier?: number;
13
14
  }
14
15
  export default class ProviderContainer implements IProviderContainer {
15
16
  current$: IValueSubject<IProviderEntry>;
16
17
  providerError$: ISubject<IError>;
17
18
  noAvailableProvidersError$: ISubject<VideoFormat | undefined>;
19
+ volumeMultiplierError$: ISubject<IError>;
18
20
  providerOutput: IProviderOutput;
19
21
  private subscription;
20
22
  private screenFormatsIterator;
@@ -22,6 +24,7 @@ export default class ProviderContainer implements IProviderContainer {
22
24
  private log;
23
25
  private params;
24
26
  private failoverIndex;
27
+ private volumeMultiplierManager;
25
28
  constructor(params: IParams);
26
29
  init(): void;
27
30
  destroy(): void;
@@ -5,6 +5,7 @@ export interface IProviderContainer {
5
5
  current$: IValueObservable<IProviderEntry>;
6
6
  providerError$: ISubject<IError>;
7
7
  noAvailableProvidersError$: ISubject<VideoFormat | undefined>;
8
+ volumeMultiplierError$: ISubject<IError>;
8
9
  providerOutput: IProviderOutput;
9
10
  init(): void;
10
11
  destroy(): void;
@@ -86,4 +86,5 @@ export interface IProviderOutput {
86
86
  is3DVideo$: ISubject<boolean>;
87
87
  inPiP$: IValueSubject<boolean>;
88
88
  inFullscreen$: IValueSubject<boolean>;
89
+ playbackState$: IValueSubject<PlaybackState | string>;
89
90
  }
@@ -0,0 +1,17 @@
1
+ import { IError, ISubject, IValueSubject } from '@vkontakte/videoplayer-shared';
2
+ import { IProviderOutput } from '../../providers/types';
3
+ import { IProviderEntry } from '../../providers/ProviderContainer/types';
4
+ export declare class VolumeMultiplierManager {
5
+ private providerOutput;
6
+ private provider$;
7
+ private volumeMultiplierError$;
8
+ private volumeMultiplier;
9
+ private static errorId;
10
+ private subscriptions;
11
+ private lastAudioContextResumeId;
12
+ constructor(providerOutput: IProviderOutput, provider$: IValueSubject<IProviderEntry>, volumeMultiplierError$: ISubject<IError>, volumeMultiplier: number, enabled: boolean);
13
+ private subscribe;
14
+ private isSupported;
15
+ private initAudioContextOnce;
16
+ destroy(): void;
17
+ }
@@ -0,0 +1,9 @@
1
+ interface IAudioContext {
2
+ audioCtx: AudioContext;
3
+ gainNode: GainNode;
4
+ }
5
+ /**
6
+ * Возвращает AudioContext
7
+ */
8
+ export declare function getAudioContext(): IAudioContext;
9
+ export {};
@@ -0,0 +1 @@
1
+ export { VolumeMultiplierManager } from './VolumeMultiplierManager';
@@ -0,0 +1,2 @@
1
+ export declare const isHDRSupported: () => boolean;
2
+ export declare const isHDREncoded: (codec: string) => boolean;
@@ -19,6 +19,7 @@ export type ITuningConfig = {
19
19
  deviationFactor: number;
20
20
  lowLatency: {
21
21
  continuesByteSequenceInterval: Milliseconds;
22
+ maxLastEvaluationTimeout: Milliseconds;
22
23
  };
23
24
  };
24
25
  autoTrackSelection: {
@@ -130,6 +131,8 @@ export type ITuningConfig = {
130
131
  useDashAbortPartiallyFedSegment: boolean;
131
132
  useNativeHLSTextTracks: boolean;
132
133
  useManagedMediaSource: boolean;
134
+ useNewPruneBufferStrategy: boolean;
135
+ useNewPartialSegmentFeeding: boolean;
133
136
  isAudioDisabled: boolean;
134
137
  autoplayOnlyInActiveTab: boolean;
135
138
  dynamicImportTimeout: Milliseconds;
@@ -159,6 +162,7 @@ export type ITuningConfig = {
159
162
  speedFadeTime: Milliseconds;
160
163
  speedFadeThreshold: Milliseconds;
161
164
  };
165
+ useVolumeMultiplier: boolean;
162
166
  };
163
167
  export type IOptionalTuningConfig = RecursivePartial<ITuningConfig> & {
164
168
  configName: ITuningConfig['configName'];