@byomakase/omakase-player 0.8.2 → 0.8.3

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.
Files changed (80) hide show
  1. package/dist/api/audio-api.d.ts +3 -3
  2. package/dist/api/marker-lane-api.d.ts +6 -6
  3. package/dist/api/omakase-player-api.d.ts +12 -12
  4. package/dist/api/subtitles-api.d.ts +4 -4
  5. package/dist/api/timeline-api.d.ts +16 -11
  6. package/dist/api/video-api.d.ts +5 -5
  7. package/dist/audio/audio-controller.d.ts +4 -4
  8. package/dist/chart/chart-file.d.ts +12 -0
  9. package/dist/common/component.d.ts +5 -5
  10. package/dist/common/style-adapter.d.ts +1 -1
  11. package/dist/common/styles-provider.d.ts +2 -2
  12. package/dist/constants.d.ts +3 -1
  13. package/dist/dom/fullscreen.d.ts +19 -19
  14. package/dist/http.d.ts +1 -1
  15. package/dist/images/help.svg +17 -16
  16. package/dist/images/loading.svg +30 -29
  17. package/dist/images/pause.svg +19 -18
  18. package/dist/images/play.svg +20 -18
  19. package/dist/images/replay.svg +24 -22
  20. package/dist/index.d.ts +3 -3
  21. package/dist/omakase-player.cjs.js +30 -30
  22. package/dist/omakase-player.cjs.js.map +1 -1
  23. package/dist/omakase-player.d.ts +13 -11
  24. package/dist/omakase-player.es.js +3674 -3087
  25. package/dist/omakase-player.es.js.map +1 -1
  26. package/dist/omakase-player.umd.js +30 -30
  27. package/dist/omakase-player.umd.js.map +1 -1
  28. package/dist/subtitles/subtitles-controller.d.ts +5 -5
  29. package/dist/timeline/audio-track/audio-track-lane-item.d.ts +4 -6
  30. package/dist/timeline/audio-track/audio-track-lane.d.ts +5 -6
  31. package/dist/timeline/chart-track/bar-chart-lane-item.d.ts +50 -0
  32. package/dist/timeline/chart-track/bar-chart-lane.d.ts +64 -0
  33. package/dist/timeline/chart-track/index.d.ts +17 -0
  34. package/dist/timeline/chart-track/og-chart-lane-item.d.ts +51 -0
  35. package/dist/timeline/chart-track/og-chart-lane.d.ts +64 -0
  36. package/dist/timeline/index.d.ts +5 -4
  37. package/dist/timeline/marker/index.d.ts +4 -4
  38. package/dist/timeline/marker/marker-handle.d.ts +6 -6
  39. package/dist/timeline/marker/marker-lane.d.ts +9 -9
  40. package/dist/timeline/marker/marker.d.ts +7 -7
  41. package/dist/timeline/marker/moment-marker.d.ts +7 -7
  42. package/dist/timeline/marker/period-marker.d.ts +7 -7
  43. package/dist/timeline/playhead-hover.d.ts +5 -5
  44. package/dist/timeline/playhead.d.ts +5 -5
  45. package/dist/timeline/scrollbar.d.ts +5 -5
  46. package/dist/timeline/scrubber-lane.d.ts +7 -7
  47. package/dist/timeline/subtitles/subtitles-lane-item.d.ts +6 -6
  48. package/dist/timeline/subtitles/subtitles-lane.d.ts +7 -7
  49. package/dist/timeline/thumbnail/thumbnail-lane.d.ts +8 -8
  50. package/dist/timeline/thumbnail/thumbnail.d.ts +5 -5
  51. package/dist/timeline/timecode-display.d.ts +5 -5
  52. package/dist/timeline/timeline-lane.d.ts +8 -8
  53. package/dist/timeline/timeline.d.ts +31 -19
  54. package/dist/track/audio-vtt-file.d.ts +4 -4
  55. package/dist/track/subtitles-vtt-file.d.ts +4 -4
  56. package/dist/track/subtitles-vtt-track.d.ts +2 -2
  57. package/dist/track/thumbnail-vtt-file.d.ts +4 -4
  58. package/dist/track/track.d.ts +1 -1
  59. package/dist/track/vtt-file.d.ts +3 -3
  60. package/dist/types/chart.d.ts +43 -0
  61. package/dist/types/events.d.ts +7 -7
  62. package/dist/types/index.d.ts +7 -5
  63. package/dist/types/types.d.ts +1 -1
  64. package/dist/types/vtt.d.ts +1 -1
  65. package/dist/util/animation-util.d.ts +2 -2
  66. package/dist/util/array-util.d.ts +3 -0
  67. package/dist/util/color-util.d.ts +1 -0
  68. package/dist/util/destroy-util.d.ts +1 -1
  69. package/dist/util/error-util.d.ts +1 -1
  70. package/dist/util/frame-util.d.ts +1 -1
  71. package/dist/util/image-util.d.ts +2 -2
  72. package/dist/util/observable-util.d.ts +1 -1
  73. package/dist/util/shape-util.d.ts +1 -1
  74. package/dist/util/timestamp-util.d.ts +5 -4
  75. package/dist/video/playback-state.d.ts +1 -1
  76. package/dist/video/video-controller-api.d.ts +6 -6
  77. package/dist/video/video-controller.d.ts +14 -10
  78. package/dist/video/video-dom-controller.d.ts +3 -3
  79. package/dist/video/video-hls-controller.d.ts +9 -5
  80. package/package.json +2 -2
@@ -13,11 +13,11 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { BaseComponent, ComponentConfig, ComponentConfigStyleComposed } from "../common/component";
17
- import Konva from "konva";
18
- import { HasRectMeasurement, OnMeasurementsChange, Position, RectMeasurement } from "../common/measurement";
19
- import { StylesProvider } from "../common/styles-provider";
20
- import { VideoControllerApi } from "../video/video-controller-api";
16
+ import { BaseComponent, ComponentConfig, ComponentConfigStyleComposed } from '../common/component';
17
+ import Konva from 'konva';
18
+ import { HasRectMeasurement, OnMeasurementsChange, Position, RectMeasurement } from '../common/measurement';
19
+ import { StylesProvider } from '../common/styles-provider';
20
+ import { VideoControllerApi } from '../video/video-controller-api';
21
21
  export interface TimecodeDisplayStyle {
22
22
  x: number;
23
23
  y: number;
@@ -13,19 +13,19 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { BaseComponent, Component, ComponentConfig } from "../common/component";
17
- import Konva from "konva";
18
- import { Dimension, OnMeasurementsChange, Position, RectMeasurement } from "../common/measurement";
19
- import { Timeline } from "./timeline";
20
- import { StylesProvider } from "../common/styles-provider";
21
- import { VideoController } from "../video/video-controller";
22
- import { VideoControllerApi } from "../video/video-controller-api";
16
+ import { BaseComponent, Component, ComponentConfig } from '../common/component';
17
+ import Konva from 'konva';
18
+ import { Dimension, OnMeasurementsChange, Position, RectMeasurement } from '../common/measurement';
19
+ import { Timeline } from './timeline';
20
+ import { StylesProvider } from '../common/styles-provider';
21
+ import { VideoController } from '../video/video-controller';
22
+ import { VideoControllerApi } from '../video/video-controller-api';
23
23
  export interface TimelineLaneStyle {
24
24
  height: number;
25
25
  backgroundFill: string;
26
26
  backgroundOpacity: number;
27
27
  descriptionTextFill: string;
28
- descriptionFontSize: number;
28
+ descriptionTextFontSize: number;
29
29
  leftBackgroundFill: string;
30
30
  leftBackgroundOpacity: number;
31
31
  }
@@ -13,31 +13,36 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { BaseComponent, ComponentConfig, ComponentConfigStyleComposed } from "../common/component";
17
- import Konva from "konva";
18
- import { ScrollableHorizontally, Scrollbar } from "./scrollbar";
19
- import { Dimension, HasRectMeasurement, HorizontalMeasurement, OnMeasurementsChange, Position, RectMeasurement } from "../common/measurement";
20
- import { Observable, Subject } from "rxjs";
21
- import { TimelineScrollEvent, TimelineZoomEvent } from "../types";
22
- import { ThumbnailVttFile } from "../track/thumbnail-vtt-file";
23
- import { GenericTimelaneLane } from "./timeline-lane";
24
- import { ScrubberLane } from "./scrubber-lane";
25
- import { TimelineApi } from "../api/timeline-api";
26
- import { MarkerLane } from "./marker";
27
- import { ThumbnailLane } from "./thumbnail";
28
- import { SubtitlesLane } from "./subtitles";
29
- import { AudioTrackLane } from "./audio-track";
30
- import { MarkerLaneConfig } from "./marker/marker-lane";
31
- import { ThumbnailLaneConfig } from "./thumbnail/thumbnail-lane";
32
- import { SubtitlesLaneConfig } from "./subtitles/subtitles-lane";
33
- import { AxiosRequestConfig } from "axios";
34
- import { VideoControllerApi } from "../video/video-controller-api";
16
+ import { BaseComponent, ComponentConfig, ComponentConfigStyleComposed } from '../common/component';
17
+ import Konva from 'konva';
18
+ import { ScrollableHorizontally, Scrollbar } from './scrollbar';
19
+ import { Dimension, HasRectMeasurement, HorizontalMeasurement, OnMeasurementsChange, Position, RectMeasurement } from '../common/measurement';
20
+ import { Observable, Subject } from 'rxjs';
21
+ import { TimelineScrollEvent, TimelineZoomEvent } from '../types';
22
+ import { ThumbnailVttFile } from '../track/thumbnail-vtt-file';
23
+ import { GenericTimelaneLane } from './timeline-lane';
24
+ import { ScrubberLane } from './scrubber-lane';
25
+ import { TimelineApi } from '../api/timeline-api';
26
+ import { MarkerLane } from './marker';
27
+ import { ThumbnailLane } from './thumbnail';
28
+ import { SubtitlesLane } from './subtitles';
29
+ import { AudioTrackLane } from './audio-track';
30
+ import { MarkerLaneConfig } from './marker/marker-lane';
31
+ import { ThumbnailLaneConfig } from './thumbnail/thumbnail-lane';
32
+ import { SubtitlesLaneConfig } from './subtitles/subtitles-lane';
33
+ import { AxiosRequestConfig } from 'axios';
34
+ import { VideoControllerApi } from '../video/video-controller-api';
35
35
  export interface TimelineStyle {
36
36
  stageMinWidth: number;
37
37
  backgroundFill: string;
38
38
  headerBackgroundFill: string;
39
39
  footerBackgroundFill: string;
40
40
  scrollbarHeight: number;
41
+ scrollbarBackgroundFill: string;
42
+ scrollbarBackgroundFillOpacity: number;
43
+ scrollbarHandleBarFill: string;
44
+ scrollbarHandleBarOpacity: number;
45
+ scrollbarHandleOpacity: number;
41
46
  thumbnailHoverWidth: number;
42
47
  thumbnailHoverStroke: string;
43
48
  thumbnailHoverStrokeWidth: number;
@@ -59,6 +64,10 @@ export interface TimelineStyle {
59
64
  playheadPlayProgressOpacity: number;
60
65
  playheadBufferedFill: string;
61
66
  playheadBufferedOpacity: number;
67
+ playheadHoverVisible: boolean;
68
+ playheadHoverFill: string;
69
+ playheadHoverLineWidth: number;
70
+ playheadHoverSymbolHeight: number;
62
71
  }
63
72
  export interface TimelineConfig extends ComponentConfig<TimelineStyle> {
64
73
  thumbnailVttUrl?: string;
@@ -97,6 +106,7 @@ export declare class Timeline extends BaseComponent<TimelineConfig, TimelineStyl
97
106
  private timecodedThumbnailsGroup;
98
107
  private timecodedSubtitlesGroup;
99
108
  private timecodedAudioGroup;
109
+ private timecodedChartGroup;
100
110
  private timecodedMarkersGroup;
101
111
  private timecodedSurfaceGroup;
102
112
  private timecodedBackground;
@@ -179,6 +189,7 @@ export declare class Timeline extends BaseComponent<TimelineConfig, TimelineStyl
179
189
  private onVideoLoadedEvent;
180
190
  private fireVideoEventBreaker;
181
191
  setThumbnailVttFile(thumbnailVttFile: ThumbnailVttFile): void;
192
+ getThumbnailVttFile(): ThumbnailVttFile;
182
193
  private syncVideoMetadata;
183
194
  addLane(timelaneLane: GenericTimelaneLane): void;
184
195
  removeLane(id: string): void;
@@ -201,6 +212,7 @@ export declare class Timeline extends BaseComponent<TimelineConfig, TimelineStyl
201
212
  addToTimecodedThumbnailsGroup(node: Konva.Group | Konva.Shape): void;
202
213
  addToTimecodedSubtitlesGroup(node: Konva.Group | Konva.Shape): void;
203
214
  addToTimecodedAudioGroup(node: Konva.Group | Konva.Shape): void;
215
+ addToTimecodedChartGroup(node: Konva.Group | Konva.Shape): void;
204
216
  constrainTimelinePosition(x: number): number;
205
217
  timelinePositionToTime(xOnTimeline: number): number;
206
218
  timelinePositionToTimeRelativeToTimecoded(xOnTimeline: number): number;
@@ -13,10 +13,10 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { BaseOmakaseVttFile, VttCueParsed } from "./vtt-file";
17
- import { AudioVttCue } from "../types";
18
- import { Observable } from "rxjs";
19
- import { AxiosRequestConfig } from "axios";
16
+ import { BaseOmakaseVttFile, VttCueParsed } from './vtt-file';
17
+ import { AudioVttCue } from '../types';
18
+ import { Observable } from 'rxjs';
19
+ import { AxiosRequestConfig } from 'axios';
20
20
  export declare class AudioVttFile extends BaseOmakaseVttFile<AudioVttCue> {
21
21
  protected constructor(url: string, axiosConfig?: AxiosRequestConfig);
22
22
  static create(url: string, axiosConfig?: AxiosRequestConfig): Observable<AudioVttFile>;
@@ -13,10 +13,10 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { BaseOmakaseVttFile, VttCueParsed } from "./vtt-file";
17
- import { SubtitlesVttCue } from "../types";
18
- import { Observable } from "rxjs";
19
- import { AxiosRequestConfig } from "axios";
16
+ import { BaseOmakaseVttFile, VttCueParsed } from './vtt-file';
17
+ import { SubtitlesVttCue } from '../types';
18
+ import { Observable } from 'rxjs';
19
+ import { AxiosRequestConfig } from 'axios';
20
20
  export declare class SubtitlesVttFile extends BaseOmakaseVttFile<SubtitlesVttCue> {
21
21
  protected constructor(url: string, axiosConfig?: AxiosRequestConfig);
22
22
  static create(url: string, axiosConfig?: AxiosRequestConfig): Observable<SubtitlesVttFile>;
@@ -13,8 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { BaseOmakaseTrack } from "./track";
17
- import { SubtitlesVttCue, SubtitlesVttTrackConfig } from "../types";
16
+ import { BaseOmakaseTrack } from './track';
17
+ import { SubtitlesVttCue, SubtitlesVttTrackConfig } from '../types';
18
18
  export declare class SubtitlesVttTrack extends BaseOmakaseTrack<SubtitlesVttCue> {
19
19
  constructor(config: SubtitlesVttTrackConfig);
20
20
  }
@@ -13,10 +13,10 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { BaseOmakaseVttFile, VttCueParsed } from "./vtt-file";
17
- import { ThumbnailVttCue } from "../types";
18
- import { Observable } from "rxjs";
19
- import { AxiosRequestConfig } from "axios";
16
+ import { BaseOmakaseVttFile, VttCueParsed } from './vtt-file';
17
+ import { ThumbnailVttCue } from '../types';
18
+ import { Observable } from 'rxjs';
19
+ import { AxiosRequestConfig } from 'axios';
20
20
  export declare class ThumbnailVttFile extends BaseOmakaseVttFile<ThumbnailVttCue> {
21
21
  protected constructor(url: string, axiosConfig?: AxiosRequestConfig);
22
22
  static create(url: string, axiosConfig?: AxiosRequestConfig): Observable<ThumbnailVttFile>;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { OmakaseTextTrack, OmakaseTextTrackCue, OmakaseTrackConfig } from "../types";
16
+ import { OmakaseTextTrack, OmakaseTextTrackCue, OmakaseTrackConfig } from '../types';
17
17
  export declare abstract class BaseOmakaseTrack<T extends OmakaseTextTrackCue> implements OmakaseTextTrack<T> {
18
18
  id: string;
19
19
  src: string;
@@ -13,9 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Observable } from "rxjs";
17
- import { OmakaseVttCue, OmakaseVttFile } from "../types";
18
- import { AxiosRequestConfig } from "axios";
16
+ import { Observable } from 'rxjs';
17
+ import { OmakaseVttCue, OmakaseVttFile } from '../types';
18
+ import { AxiosRequestConfig } from 'axios';
19
19
  export interface VttCueParsed {
20
20
  identifier: string;
21
21
  start: number;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Copyright 2023 ByOmakase, LLC (https://byomakase.org)
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export interface OmakaseChartCue {
17
+ id: string;
18
+ /**
19
+ * Seconds
20
+ */
21
+ startTime: number;
22
+ /**
23
+ * Seconds
24
+ */
25
+ endTime: number;
26
+ }
27
+ export interface OmakaseChart<T extends OmakaseChartCue> {
28
+ cues: T[];
29
+ }
30
+ export interface OmakaseChartFile<T extends OmakaseChart<any>> {
31
+ getCues(): T['cues'];
32
+ findCue(time: number): T['cues'][0];
33
+ findCues(startTime: number, endTime: number): T['cues'];
34
+ }
35
+ export interface BarChartCue extends OmakaseChartCue {
36
+ value: number;
37
+ }
38
+ export interface OgChartCue extends BarChartCue {
39
+ }
40
+ export interface OgChart extends OmakaseChart<OgChartCue> {
41
+ }
42
+ export interface BarChart extends OmakaseChart<BarChartCue> {
43
+ }
@@ -13,13 +13,13 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Position } from "../common/measurement";
17
- import { MomentObservation, PeriodObservation } from "./model";
18
- import { Thumbnail } from "../timeline/thumbnail/thumbnail";
19
- import { Video } from "../video/video";
20
- import { CamelToSnakeCase } from "./types";
21
- import { OmakaseTextTrack, OmakaseTextTrackCue } from "./track";
22
- import { GenericMarker } from "../timeline/marker/marker";
16
+ import { Position } from '../common/measurement';
17
+ import { MomentObservation, PeriodObservation } from './model';
18
+ import { Thumbnail } from '../timeline/thumbnail/thumbnail';
19
+ import { Video } from '../video/video';
20
+ import { CamelToSnakeCase } from './types';
21
+ import { OmakaseTextTrack, OmakaseTextTrackCue } from './track';
22
+ import { GenericMarker } from '../timeline/marker/marker';
23
23
  export declare const OmakasePlayerEvents: OmakasePlayerEventsType;
24
24
  export type OmakasePlayerEventsType = OmakasePlayerEventsMappingType<OmakasePlayerEventMap>;
25
25
  export type OmakasePlayerEventsMappingType<T> = {
@@ -13,8 +13,10 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export * from "./common";
17
- export * from "./events";
18
- export * from "./model";
19
- export * from "./track";
20
- export * from "./vtt";
16
+ export * from './common';
17
+ export * from './events';
18
+ export * from './model';
19
+ export * from './track';
20
+ export * from './vtt';
21
+ export * from './chart';
22
+ export * from './types';
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Capitalize<T> ? "_" : ""}${Lowercase<T>}${CamelToSnakeCase<U>}` : S;
16
+ export type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Capitalize<T> ? '_' : ''}${Lowercase<T>}${CamelToSnakeCase<U>}` : S;
17
17
  export type PartialRecord<K extends keyof any, T> = Partial<Record<K, T>>;
18
18
  export type WithOptionalPartial<T, K extends keyof T> = Omit<T, K> & PartialRecord<K, Partial<T[K]>>;
19
19
  export type AtLeastOne<T, U = {
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { OmakaseTextTrackCue, OmakaseTrackConfig } from "./track";
16
+ import { OmakaseTextTrackCue, OmakaseTrackConfig } from './track';
17
17
  export interface OmakaseVttFile<T extends OmakaseVttCue> {
18
18
  getCues(): T[];
19
19
  findCue(time: number): T;
@@ -13,8 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import Konva from "konva";
17
- import { IFrame } from "konva/lib/types";
16
+ import Konva from 'konva';
17
+ import { IFrame } from 'konva/lib/types';
18
18
  export interface AnimateConf {
19
19
  layer: Konva.Layer;
20
20
  duration: number;
@@ -0,0 +1,3 @@
1
+ export declare class ArrayUtil {
2
+ static groupConsecutiveNumbers(arr: number[]): number[][];
3
+ }
@@ -15,4 +15,5 @@
15
15
  */
16
16
  export declare class ColorUtil {
17
17
  static randomHexColor(): string;
18
+ static inverseFillGradient(gradient: (string | number)[]): (string | number)[];
18
19
  }
@@ -1,4 +1,4 @@
1
- import { Destroyable } from "../types";
1
+ import { Destroyable } from '../types';
2
2
  export declare class DestroyUtil {
3
3
  static destroy(...destroyables: Destroyable[]): void;
4
4
  }
@@ -13,6 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { ParseParams } from "zod/lib/helpers/parseUtil";
16
+ import { ParseParams } from 'zod/lib/helpers/parseUtil';
17
17
  export declare function parseErrorMessage(error: string | Error): string;
18
18
  export declare function zodErrorMapOverload(message: string): Partial<ParseParams>;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import Decimal from "decimal.js";
16
+ import Decimal from 'decimal.js';
17
17
  export declare class FrameUtil {
18
18
  /***
19
19
  * Returns frame number
@@ -13,8 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import Konva from "konva";
17
- import { Observable } from "rxjs";
16
+ import Konva from 'konva';
17
+ import { Observable } from 'rxjs';
18
18
  export declare class ImageUtil {
19
19
  static createKonvaImage(url: string): Observable<Konva.Image>;
20
20
  static createKonvaImageSizedByWidth(url: string, width: number): Observable<Konva.Image>;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Subject } from "rxjs";
16
+ import { Subject } from 'rxjs';
17
17
  export declare function nextCompleteVoidSubject(subject: Subject<void>): void;
18
18
  export declare function nextCompleteVoidSubjects(...subjects: Subject<void>[]): void;
19
19
  export declare function completeSubject(subject: Subject<any>): void;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import Konva from "konva";
16
+ import Konva from 'konva';
17
17
  export declare class ShapeUtil {
18
18
  static createGoldenRatioWedge(config: {
19
19
  x: number;
@@ -13,10 +13,11 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import Decimal from "decimal.js";
16
+ import Decimal from 'decimal.js';
17
17
  export declare class TimestampUtil {
18
- static readonly VIDEO_ZERO_TIMESTAMP: string;
19
- static formatVideoTimestamp(time: number, frameRateDecimal: Decimal): string;
20
- static formattedTimestampToFrame(timestamp: string, frameRateDecimal: Decimal): number;
18
+ static readonly HOUR_MINUTE_SECOND_FRAME_FORMATTED_ZERO: string;
19
+ static formatHourMinuteSecondFrame(time: number, frameRateDecimal: Decimal): string;
20
+ static calculateFramesFromHourMinuteSecondFrameFormatted(timestamp: string, frameRateDecimal: Decimal): number;
21
+ static formatHourMinuteSecondMillisecond(time: number, frameRateDecimal: Decimal): string;
21
22
  private static padZero;
22
23
  }
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Subject } from "rxjs";
16
+ import { Subject } from 'rxjs';
17
17
  export interface PlaybackState {
18
18
  playing: boolean;
19
19
  paused: boolean;
@@ -1,9 +1,9 @@
1
- import { Observable } from "rxjs";
2
- import { Video } from "./video";
3
- import { VideoApi } from "../api/video-api";
4
- import { PlaybackState } from "./playback-state";
5
- import { Destroyable, OmakaseTextTrack, OmakaseTextTrackCue, VideoLoadingEvent } from "../types";
6
- import { BufferedTimespan } from "./video-controller";
1
+ import { Observable } from 'rxjs';
2
+ import { Video } from './video';
3
+ import { VideoApi } from '../api/video-api';
4
+ import { PlaybackState } from './playback-state';
5
+ import { Destroyable, OmakaseTextTrack, OmakaseTextTrackCue, VideoLoadingEvent } from '../types';
6
+ import { BufferedTimespan } from './video-controller';
7
7
  export interface VideoControllerApi extends VideoApi, Destroyable {
8
8
  onHelpMenuChange$: Observable<void>;
9
9
  onPlaybackState$: Observable<PlaybackState>;
@@ -13,15 +13,14 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import Decimal from "decimal.js";
17
- import { AudioEvent, VideoBufferingEvent, VideoEndedEvent, VideoErrorEvent, VideoLoadedEvent, VideoLoadingEvent, VideoPlayEvent, VideoSeekedEvent, VideoSeekingEvent, VideoTimeChangeEvent } from "../types/events";
18
- import { BehaviorSubject, Observable, Subject } from "rxjs";
19
- import { Video } from "./video";
20
- import { VideoDomController } from "./video-dom-controller";
21
- import { PlaybackState, PlaybackStateMachine } from "./playback-state";
22
- import Hls from "hls.js";
23
- import { Destroyable, HelpMenuGroup, OmakaseTextTrack, OmakaseTextTrackCue } from "../types";
24
- import { VideoControllerApi } from "./video-controller-api";
16
+ import Decimal from 'decimal.js';
17
+ import { AudioEvent, Destroyable, HelpMenuGroup, OmakaseTextTrack, OmakaseTextTrackCue, VideoBufferingEvent, VideoEndedEvent, VideoErrorEvent, VideoLoadedEvent, VideoLoadingEvent, VideoPlayEvent, VideoSeekedEvent, VideoSeekingEvent, VideoTimeChangeEvent } from '../types';
18
+ import { BehaviorSubject, Observable, Subject } from 'rxjs';
19
+ import { Video } from './video';
20
+ import { VideoDomController } from './video-dom-controller';
21
+ import { PlaybackState, PlaybackStateMachine } from './playback-state';
22
+ import Hls from 'hls.js';
23
+ import { VideoControllerApi } from './video-controller-api';
25
24
  export declare const HTMLVideoElementEventKeys: {
26
25
  PAUSE: string;
27
26
  WAITING: string;
@@ -42,6 +41,11 @@ interface VideoFrameCallbackData {
42
41
  now: DOMHighResTimeStamp;
43
42
  metadata: VideoFrameCallbackMetadata;
44
43
  }
44
+ export interface VideoControllerConfig {
45
+ playerHTMLElementId: string;
46
+ crossorigin: 'anonymous' | 'use-credentials';
47
+ }
48
+ export declare const VIDEO_CONTROLLER_CONFIG_DEFAULT: VideoControllerConfig;
45
49
  export declare abstract class VideoController implements VideoControllerApi, Destroyable {
46
50
  protected videoDomController: VideoDomController;
47
51
  protected helpMenuGroups: HelpMenuGroup[];
@@ -81,7 +85,7 @@ export declare abstract class VideoController implements VideoControllerApi, Des
81
85
  readonly onPlaybackState$: Subject<PlaybackState>;
82
86
  readonly onHelpMenuChange$: Subject<void>;
83
87
  readonly onVideoError$: Subject<VideoErrorEvent>;
84
- protected constructor(playerHTMLElementId: string, crossorigin: 'anonymous' | 'use-credentials');
88
+ protected constructor(config: VideoControllerConfig);
85
89
  loadVideo(sourceUrl: string, frameRate: number, duration: number): Observable<Video>;
86
90
  protected abstract videoLoad(sourceUrl: string, frameRate: number, duration: number): Observable<Video>;
87
91
  get videoElement(): HTMLVideoElement;
@@ -14,9 +14,9 @@
14
14
  * limitations under the License.
15
15
  *
16
16
  */
17
- import { Observable } from "rxjs";
18
- import { Destroyable, OmakaseTextTrack, OmakaseTextTrackCue } from "../types";
19
- import { VideoControllerApi } from "./video-controller-api";
17
+ import { Observable } from 'rxjs';
18
+ import { Destroyable, OmakaseTextTrack, OmakaseTextTrackCue } from '../types';
19
+ import { VideoControllerApi } from './video-controller-api';
20
20
  export declare class VideoDomController implements Destroyable {
21
21
  private readonly _playerHTMLElementId;
22
22
  private _videoElement;
@@ -13,13 +13,17 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { VideoController } from "./video-controller";
17
- import Hls, { MediaPlaylist } from "hls.js";
18
- import { Observable } from "rxjs";
19
- import { Video } from "./video";
16
+ import { VideoController, VideoControllerConfig } from './video-controller';
17
+ import Hls, { HlsConfig, MediaPlaylist } from 'hls.js';
18
+ import { Observable } from 'rxjs';
19
+ import { Video } from './video';
20
+ export interface VideoHlsControllerConfig extends VideoControllerConfig {
21
+ hls: Partial<HlsConfig>;
22
+ }
23
+ export declare const VIDEO_HLS_CONTROLLER_CONFIG_DEFAULT: VideoHlsControllerConfig;
20
24
  export declare class VideoHlsController extends VideoController {
21
25
  protected hls: Hls;
22
- constructor(playerHTMLElementId: string, crossorigin: 'anonymous' | 'use-credentials');
26
+ constructor(videoHlsControllerConfig: Partial<VideoHlsControllerConfig>);
23
27
  videoLoad(sourceUrl: string, frameRate: number, duration: number): Observable<Video>;
24
28
  protected initEventHandlers(): void;
25
29
  getAudioTracks(): MediaPlaylist[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byomakase/omakase-player",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
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",
@@ -32,7 +32,7 @@
32
32
  "axios": "1.3.3",
33
33
  "decimal.js": "10.4.3",
34
34
  "eventemitter3": "5.0.0",
35
- "hls.js": "1.3.3",
35
+ "hls.js": "1.4.14",
36
36
  "konva": "8.3.14",
37
37
  "node-webvtt": "1.9.4",
38
38
  "rxjs": "7.8.0",