@vkontakte/videoplayer-core 2.0.126-dev.3f94cfc5.0 → 2.0.126-dev.4eb5c2dc.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.126-dev.3f94cfc5.0",
3
+ "version": "2.0.126-dev.4eb5c2dc.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.54-dev.94e7ac0b.0",
52
+ "@vkontakte/videoplayer-shared": "^1.0.53",
53
53
  "hls.js": "~1.4.7"
54
54
  }
55
55
  }
@@ -46,6 +46,7 @@ export default class Player implements IPlayer {
46
46
  isEnded$: ValueSubject<boolean>;
47
47
  isLooped$: ValueSubject<boolean>;
48
48
  isLive$: ValueSubject<boolean | undefined>;
49
+ isLiveEnded$: ValueSubject<boolean | null>;
49
50
  canChangePlaybackSpeed$: ValueSubject<boolean | undefined>;
50
51
  atLiveEdge$: ValueSubject<boolean | undefined>;
51
52
  atLiveDurationEdge$: ValueSubject<boolean | undefined>;
@@ -302,6 +302,10 @@ export interface IPlayerInfo {
302
302
  * Бесконечный ли стрим
303
303
  */
304
304
  isLive$: IValueObservable<boolean | undefined>;
305
+ /**
306
+ * Был ли завершен бесконечный стрим
307
+ */
308
+ isLiveEnded$: IValueObservable<boolean | null>;
305
309
  /**
306
310
  * Доступно ли ускоренное воспроизведении в лайв трансляции
307
311
  */
@@ -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 } from '@vkontakte/videoplayer-shared';
6
+ import { IError, ISubject, ITracer, IValueSubject, Milliseconds } from '@vkontakte/videoplayer-shared';
7
7
  export declare enum State {
8
8
  NONE = "none",
9
9
  MANIFEST_READY = "manifest_ready",
@@ -46,21 +46,24 @@ 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>;
53
55
  livePositionFromPlayer$: IValueSubject<number>;
54
56
  currentStallDuration$: IValueSubject<Milliseconds>;
55
57
  videoLastDataObtainedTimestamp$: IValueSubject<Milliseconds>;
58
+ private liveStreamEndTimestamp;
56
59
  private liveBuffer;
57
60
  private isUpdatingLive;
58
61
  private isJumpGapAfterSeekLive;
59
- private liveLastSeekOffset;
60
62
  private forceEnded$;
61
63
  private gapWatchdogActive;
62
64
  private gapWatchdogSubscription;
63
65
  private stallWatchdogSubscription;
66
+ private livePauseWatchdogSubscription;
64
67
  private destroyController;
65
68
  constructor(params: Params);
66
69
  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>;