@byomakase/omakase-player 0.2.5 → 0.3.1

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.
@@ -18,11 +18,11 @@
18
18
  * <https://github.com/ReactiveX/rxjs/blob/master/LICENSE.txt>
19
19
  */
20
20
  import { SubtitlesVttTrack } from "../track/subtitles-vtt-track";
21
- import { OmakaseTextTrack, OmakaseTextTrackCue, SubtitlesCreateEvent, SubtitlesEvent, SubtitlesVttTrackConfig } from "../types";
21
+ import { Destroyable, OmakaseTextTrack, OmakaseTextTrackCue, SubtitlesCreateEvent, SubtitlesEvent, SubtitlesVttTrackConfig } from "../types";
22
22
  import { Observable, Subject } from "rxjs";
23
23
  import { VideoController } from "../video/video-controller";
24
24
  import { SubtitlesApi } from "../api/subtitles-api";
25
- export declare class SubtitlesController implements SubtitlesApi {
25
+ export declare class SubtitlesController implements SubtitlesApi, Destroyable {
26
26
  protected currentTrack: OmakaseTextTrack<OmakaseTextTrackCue>;
27
27
  protected videoController: VideoController;
28
28
  protected subtitlesTracks: Map<string, OmakaseTextTrack<OmakaseTextTrackCue>>;
@@ -35,4 +35,5 @@ export declare class AudioTrackLaneItem extends BaseComponent<AudioTrackLaneItem
35
35
  getRect(): RectMeasurement;
36
36
  getAudioVttCue(): AudioVttCue;
37
37
  setAudioVttCue(audioVttCue: AudioVttCue): void;
38
+ destroy(): void;
38
39
  }
@@ -43,4 +43,5 @@ export declare class AudioTrackLane extends BaseTimelineLane<AudioTrackLaneConfi
43
43
  private isVttLoaded;
44
44
  get audioVttFileUrl(): string;
45
45
  set audioVttFileUrl(value: string);
46
+ destroy(): void;
46
47
  }
@@ -37,4 +37,5 @@ export declare class SubtitlesLaneItem extends BaseComponent<SubtitlesLaneItemCo
37
37
  getTextTrackCue(): OmakaseTextTrackCue;
38
38
  setTextTrackCue(textTrackCue: OmakaseTextTrackCue): void;
39
39
  compareTo(o: SubtitlesLaneItem): number;
40
+ destroy(): void;
40
41
  }
@@ -67,4 +67,5 @@ export declare abstract class BaseTimelineLane<C extends TimelaneLaneConfig<S>,
67
67
  getDescription(): string;
68
68
  setTimelinePosition(position: Position): void;
69
69
  getTimelinePosition(): Position;
70
+ destroy(): void;
70
71
  }
@@ -91,8 +91,8 @@ export declare class Timeline extends BaseComponent<TimelineConfig, TimelineStyl
91
91
  private scrollbar;
92
92
  private playheadHover;
93
93
  private playhead;
94
- private timelaneLanes;
95
- private timelaneLanesMap;
94
+ private timelineLanes;
95
+ private timelineLanesMap;
96
96
  private scrubberLane;
97
97
  private thumbnailHover;
98
98
  private headerTimecodeDisplay;
@@ -222,4 +222,5 @@ export declare class Timeline extends BaseComponent<TimelineConfig, TimelineStyl
222
222
  private fetchThumbnailVttFile;
223
223
  toggleLeftPanelVisible(visible: boolean): void;
224
224
  clearContent(): void;
225
+ destroy(): void;
225
226
  }
@@ -1,6 +1,6 @@
1
1
  export interface Comparable<T> {
2
2
  compareTo(o: T): number;
3
3
  }
4
- export type AtLeastOne<T, U = {
5
- [K in keyof T]: Pick<T, K>;
6
- }> = Partial<T> & U[keyof U];
4
+ export interface Destroyable {
5
+ destroy(): void;
6
+ }
@@ -1,3 +1,6 @@
1
1
  export type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Capitalize<T> ? "_" : ""}${Lowercase<T>}${CamelToSnakeCase<U>}` : S;
2
2
  export type PartialRecord<K extends keyof any, T> = Partial<Record<K, T>>;
3
3
  export type WithOptionalPartial<T, K extends keyof T> = Omit<T, K> & PartialRecord<K, Partial<T[K]>>;
4
+ export type AtLeastOne<T, U = {
5
+ [K in keyof T]: Pick<T, K>;
6
+ }> = Partial<T> & U[keyof U];
@@ -0,0 +1 @@
1
+ export declare function isNullOrUndefined(value: any): boolean;
@@ -1,2 +1,7 @@
1
1
  import { Subject } from "rxjs";
2
- export declare function completeSubject(subject: Subject<void>): void;
2
+ export declare function nextCompleteVoidSubject(subject: Subject<void>): void;
3
+ export declare function nextCompleteVoidSubjects(...subjects: Subject<void>[]): void;
4
+ export declare function completeSubject(subject: Subject<any>): void;
5
+ export declare function completeSubjects(...subjects: Subject<any>[]): void;
6
+ export declare function unsubscribeSubjects(...subjects: Subject<any>[]): void;
7
+ export declare function unsubscribeSubject(subject: Subject<any>): void;
@@ -7,7 +7,7 @@ import { Video } from "./video";
7
7
  import { DomController } from "../dom/dom-controller";
8
8
  import { PlaybackState, PlaybackStateMachine } from "./playback-state";
9
9
  import Hls from "hls.js";
10
- import { HelpMenuGroup } from "../types";
10
+ import { Destroyable, HelpMenuGroup } from "../types";
11
11
  export declare const HTMLVideoElementEventKeys: {
12
12
  PAUSE: string;
13
13
  WAITING: string;
@@ -29,7 +29,7 @@ interface VideoFrameCallbackData {
29
29
  now: DOMHighResTimeStamp;
30
30
  metadata: VideoFrameCallbackMetadata;
31
31
  }
32
- export declare abstract class VideoController implements VideoApi {
32
+ export declare abstract class VideoController implements VideoApi, Destroyable {
33
33
  protected browserProvider: BrowserProvider;
34
34
  protected domController: DomController;
35
35
  protected crossorigin: HTMLVideoElementCrossorigin;
@@ -80,6 +80,7 @@ export declare abstract class VideoController implements VideoApi {
80
80
  private detachVideoEventListeners;
81
81
  private syncVideoFrames;
82
82
  private seekTimeAndSync;
83
+ private seekTimeWithoutSync;
83
84
  private _seekTimeFireAndForget;
84
85
  private _seekTimeAndSyncNoEmitEvents;
85
86
  /***
@@ -116,6 +117,7 @@ export declare abstract class VideoController implements VideoApi {
116
117
  * return Video duration in seconds
117
118
  */
118
119
  getDuration(): number;
120
+ getCorrectedDuration(): number;
119
121
  getFrameRate(): number;
120
122
  getTotalFrames(): number;
121
123
  getCurrentFrame(): number;
@@ -9,6 +9,13 @@ export declare class Video {
9
9
  * @private
10
10
  */
11
11
  private readonly _frameDuration;
12
+ /**
13
+ * Corrected duration field will be updated once when last video fragment gets loaded
14
+ * and calculated duration get shorter than initially set duration
15
+ *
16
+ * @private correctedDuration
17
+ */
18
+ private _correctedDuration;
12
19
  constructor(element: HTMLVideoElement, sourceUrl: string, frameRate: number, duration: number);
13
20
  get element(): HTMLVideoElement;
14
21
  get sourceUrl(): string;
@@ -16,4 +23,6 @@ export declare class Video {
16
23
  get duration(): number;
17
24
  get totalFrames(): number;
18
25
  get frameDuration(): number;
26
+ get correctedDuration(): number;
27
+ setCorrectedDuration(value: number): void;
19
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byomakase/omakase-player",
3
- "version": "0.2.5",
3
+ "version": "0.3.1",
4
4
  "description": "## Omakase Player - Open source JavaScript framework for building frame accurate video experiences",
5
5
  "author": "ByOmakase",
6
6
  "homepage": "https://player.byomakase.org",