@vkontakte/videoplayer-core 2.0.128-dev.699ea99e.0 → 2.0.128-dev.6c63bff4.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.699ea99e.0",
3
+ "version": "2.0.128-dev.6c63bff4.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.5a1ed05c.0",
52
+ "@vkontakte/videoplayer-shared": "^1.0.55",
53
53
  "hls.js": "~1.4.7"
54
54
  }
55
55
  }
package/types/index.d.ts CHANGED
@@ -9,5 +9,4 @@ import { Subscription, Observable, Subject, ValueSubject, VideoQuality } from '@
9
9
  * @deprecated
10
10
  */
11
11
  declare const SDK_VERSION: string;
12
- export { PlayerGroupManager } from './utils/PlayerGroupManager';
13
12
  export { Player, IPlayer, PlaybackState, IPlayerInfo, IPlayerEvents, IConfig, IOptionalTuningConfig, ILogEntry, ISources, IExternalTextTrack, ITextTrack, ChromecastState, HttpConnectionType, Surface, Subscription, ISubscription, IUnsubscriber, IObservable, IEmitter, IValueObservable, IValue, IOperator, IListener, VideoFormat, IMpegSource, IDashSource, IDashURLSource, IHLSSource, IHLSLiveSource, URLSource, RawSource, URLSourceWithSeek, VideoQuality, ExactVideoQuality, Observable, Subject, ValueSubject, IRange, ISeekRequest, ICueSettings, VERSION, SDK_VERSION, PlaybackRate, IVideoStream, IAudioStream, PredefinedQualityLimits, };
@@ -2,8 +2,6 @@ import { IOptionalTuningConfig } from '../utils/tuningConfig';
2
2
  import { IError, ILogEntry, Seconds, Subject, ValueSubject, QualityLimits, VideoQuality, ITracer } from '@vkontakte/videoplayer-shared';
3
3
  import { ChromecastState, HttpConnectionType, IAudioStream, IConfig, ICueSettings, IExternalTextTrack, IPlayer, ISeekRequest, ISources, ITextTrack, IVideoStream, PlaybackRate, PlaybackState, PredefinedQualityLimits, StartEnd, Surface, VideoFormat } from './types';
4
4
  export default class Player implements IPlayer {
5
- private id;
6
- private readonly groupManager;
7
5
  private subscription;
8
6
  private domContainer;
9
7
  private providerContainer?;
@@ -48,6 +46,7 @@ export default class Player implements IPlayer {
48
46
  isEnded$: ValueSubject<boolean>;
49
47
  isLooped$: ValueSubject<boolean>;
50
48
  isLive$: ValueSubject<boolean | undefined>;
49
+ isLiveEnded$: ValueSubject<boolean | null>;
51
50
  canChangePlaybackSpeed$: ValueSubject<boolean | undefined>;
52
51
  atLiveEdge$: ValueSubject<boolean | undefined>;
53
52
  atLiveDurationEdge$: ValueSubject<boolean | undefined>;
@@ -113,7 +112,6 @@ export default class Player implements IPlayer {
113
112
  getCurrentTime$: ValueSubject<null>;
114
113
  };
115
114
  constructor(tuning?: IOptionalTuningConfig, tracer?: ITracer);
116
- private createProviderContainer;
117
115
  initVideo(config: IConfig): IPlayer;
118
116
  destroy(): void;
119
117
  prepare(): IPlayer;
@@ -189,8 +187,7 @@ export default class Player implements IPlayer {
189
187
  private initStartingVideoTrack;
190
188
  private setStartingVideoTrack;
191
189
  private initLogs;
192
- private initBasicDebugTelemetry;
193
- private initProviderDebugTelemetry;
190
+ private initDebugTelemetry;
194
191
  private initTracerSubscription;
195
192
  private initWakeLock;
196
193
  private setVideoTrackIdByQuality;
@@ -310,6 +310,10 @@ export interface IPlayerInfo {
310
310
  * Бесконечный ли стрим
311
311
  */
312
312
  isLive$: IValueObservable<boolean | undefined>;
313
+ /**
314
+ * Был ли завершен бесконечный стрим
315
+ */
316
+ isLiveEnded$: IValueObservable<boolean | null>;
313
317
  /**
314
318
  * Доступно ли ускоренное воспроизведении в лайв трансляции
315
319
  */
@@ -5,7 +5,6 @@ import { TrackHistory } from '../../utils/autoSelectTrack';
5
5
  import { IStateMachine } from '../../utils/StateMachine/types';
6
6
  import { ISubscription, Milliseconds, ITracer } from '@vkontakte/videoplayer-shared';
7
7
  import { Player } from './lib/player';
8
- import { ILiveOffset } from '../utils/LiveOffset/types';
9
8
  import { Scene3D } from '../../utils/3d/Scene3D';
10
9
  import DroppedFramesManager from '../../providers/utils/HTMLVideoElement/DroppedFramesManager';
11
10
  import TextTrackManager from '../../providers/utils/HTMLVideoElement/TextTrackManager';
@@ -42,7 +41,6 @@ export default abstract class BaseDashProvider implements IProvider {
42
41
  protected audioStreamsMap: Map<Stream, IAudioTrack[]>;
43
42
  protected videoTrackSwitchHistory: TrackHistory<IVideoTrack>;
44
43
  protected audioTrackSwitchHistory: TrackHistory<import("../../player/types").IBaseTrack>;
45
- protected liveOffset?: ILiveOffset;
46
44
  constructor(params: IParams);
47
45
  protected abstract seek(position: Milliseconds, forcePrecise: boolean): void;
48
46
  protected getProviderSubscriptionInfo(): IProviderSubscriptionInfo;
@@ -1,3 +1,3 @@
1
1
  export declare const DASH_LIVE_UPDATE_INTERVAL_MS = 1000;
2
2
  export declare const DASH_STALL_UPDATE_INTERVAL_MS = 50;
3
- export declare const DASH_LIVE_STALL_REINIT_INTERVAL_MS = 5000;
3
+ export declare const DASH_LIVE_STALL_REINIT_INTERVAL_MS = 2000;
@@ -1,9 +1,9 @@
1
1
  import { HttpConnectionType } from '../../../player/types';
2
- import { CommonInit, Manifest, Representation, StreamKind, TextRepresentation } from './types';
2
+ import { CommonInit, LiveStreamStatus, Manifest, Representation, StreamKind, TextRepresentation } from './types';
3
3
  import StateMachine from '../../../utils/StateMachine/StateMachine';
4
4
  import type ThroughputEstimator from '../../../utils/ThroughputEstimator';
5
5
  import { ITuningConfig } from '../../../utils/tuningConfig';
6
- import { IError, ISubject, ITracer, IValueSubject, Milliseconds, Seconds, Subject } from '@vkontakte/videoplayer-shared';
6
+ import { IError, ISubject, ITracer, IValueSubject, Milliseconds, Subject } from '@vkontakte/videoplayer-shared';
7
7
  export declare enum State {
8
8
  NONE = "none",
9
9
  MANIFEST_READY = "manifest_ready",
@@ -46,7 +46,9 @@ export declare class Player {
46
46
  isActiveLive$: IValueSubject<boolean>;
47
47
  isLowLatency$: IValueSubject<boolean>;
48
48
  liveDuration$: IValueSubject<Milliseconds>;
49
- liveAvailabilityStartTime$: IValueSubject<Seconds | undefined>;
49
+ liveSeekableDuration$: IValueSubject<Milliseconds>;
50
+ liveAvailabilityStartTime$: IValueSubject<Milliseconds>;
51
+ liveStreamStatus$: IValueSubject<LiveStreamStatus | undefined>;
50
52
  bufferLength$: IValueSubject<Milliseconds>;
51
53
  liveLatency$: IValueSubject<Milliseconds | undefined>;
52
54
  liveLoadBufferLength$: IValueSubject<Milliseconds>;
@@ -55,14 +57,15 @@ export declare class Player {
55
57
  videoLastDataObtainedTimestamp$: IValueSubject<Milliseconds>;
56
58
  fetcherRecoverableError$: Subject<IError>;
57
59
  fetcherError$: Subject<IError>;
60
+ private liveStreamEndTimestamp;
58
61
  private liveBuffer;
59
62
  private isUpdatingLive;
60
63
  private isJumpGapAfterSeekLive;
61
- private liveLastSeekOffset;
62
64
  private forceEnded$;
63
65
  private gapWatchdogActive;
64
66
  private gapWatchdogSubscription;
65
67
  private stallWatchdogSubscription;
68
+ private livePauseWatchdogSubscription;
66
69
  private destroyController;
67
70
  constructor(params: Params);
68
71
  initManifest: (param_0: HTMLVideoElement, param_1: string, param_2: number) => Promise<void | undefined>;
@@ -13,6 +13,11 @@ export declare enum LiveStatus {
13
13
  LiveForwardBuffering = "live_forward_buffering",
14
14
  None = "none"
15
15
  }
16
+ export declare enum LiveStreamStatus {
17
+ Active = "active",
18
+ UnexpectedlyDown = "unexpectedly_down",// Стрим в сети, но трансляция оборвалась из-за тех. проблем
19
+ Unpublished = "unpublished"
20
+ }
16
21
  export declare enum Profile {
17
22
  WEBM_AS_IN_SPEC = "urn:mpeg:dash:profile:webm-on-demand:2012",// Такой указан в спеке
18
23
  WEBM_AS_IN_FFMPEG = "urn:webm:dash:profile:webm-on-demand:2012"
@@ -99,14 +104,20 @@ export interface Stream {
99
104
  mime: string;
100
105
  representations: Representation[];
101
106
  }
107
+ export interface LiveMetadata {
108
+ availabilityStartTime: Milliseconds;
109
+ publishTime: Milliseconds;
110
+ latestSegmentPublishTime: Milliseconds;
111
+ streamIsAlive: boolean;
112
+ streamIsUnpublished: boolean;
113
+ }
102
114
  export interface Manifest {
103
- dynamic: boolean;
104
- liveAvailabilityStartTime: Milliseconds | undefined;
105
115
  duration: Milliseconds | undefined;
106
116
  streams: {
107
117
  [key in StreamKind]: Stream[];
108
118
  };
109
119
  baseUrls: string[];
120
+ live?: LiveMetadata;
110
121
  }
111
122
  export declare enum ProjectionType {
112
123
  RECTANGULAR = 0,
@@ -67,6 +67,7 @@ export interface IProviderOutput {
67
67
  currentBuffer$: IValueSubject<IRange<Seconds> | undefined>;
68
68
  isBuffering$: IValueSubject<boolean>;
69
69
  isLive$: IValueSubject<boolean | undefined>;
70
+ isLiveEnded$: IValueSubject<boolean | null>;
70
71
  isLowLatency$: IValueSubject<boolean | undefined>;
71
72
  liveTime$: IValueSubject<Milliseconds | undefined>;
72
73
  liveBufferTime$: IValueSubject<Milliseconds | undefined>;
@@ -198,7 +198,6 @@ export type ITuningConfig = {
198
198
  * Отключает яндексовскую магию с пипом.
199
199
  */
200
200
  disableYandexPiP?: boolean;
201
- useLazyInit?: boolean;
202
201
  };
203
202
  export type IOptionalTuningConfig = RecursivePartial<ITuningConfig> & {
204
203
  configName: ITuningConfig['configName'];
@@ -1,15 +0,0 @@
1
- import { ValueSubject } from '@vkontakte/videoplayer-shared';
2
- export declare class PlayerGroupManager {
3
- private readonly ownerId;
4
- private readonly channel;
5
- private readonly listeners;
6
- private other;
7
- private tmt;
8
- private start;
9
- isBlocked: ValueSubject<boolean>;
10
- constructor(ownerId: string);
11
- destroy(): void;
12
- private postMessage;
13
- private readonly handleMessage;
14
- private debug;
15
- }
@@ -1 +0,0 @@
1
- export declare const CHANNEL_NAME = "vk_vp_channel";
@@ -1 +0,0 @@
1
- export { PlayerGroupManager } from './PlayerGroupManager';
@@ -1,15 +0,0 @@
1
- type JSONValue = string | number | boolean | JSONObject | JSONArray;
2
- interface JSONObject {
3
- [key: string]: JSONValue;
4
- }
5
- type JSONArray = JSONValue[];
6
- export type PlayerBroadcastMessageDetails = JSONValue;
7
- export type PlayerBroadcastMessageType = 'register' | 'wait' | 'unregister';
8
- export interface PlayerBroadcastMessage {
9
- type: PlayerBroadcastMessageType;
10
- from: string;
11
- to?: string;
12
- details?: PlayerBroadcastMessageDetails;
13
- }
14
- export type MessageHandler = (data: PlayerBroadcastMessage) => void;
15
- export {};