@clickview/player 0.0.0-dev.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.
Files changed (190) hide show
  1. package/.eslintrc.json +3 -0
  2. package/.storybook/main.js +21 -0
  3. package/.storybook/preview-head.html +3 -0
  4. package/.storybook/stories/Base.stories.tsx +115 -0
  5. package/.storybook/stories/Clips.stories.tsx +64 -0
  6. package/.storybook/stories/Interactives.stories.tsx +65 -0
  7. package/.storybook/stories/Subtitles.stories.tsx +22 -0
  8. package/.storybook/stories/assets/chapters.vtt +19 -0
  9. package/.storybook/stories/assets/en.vtt +8 -0
  10. package/.storybook/stories/assets/es.vtt +8 -0
  11. package/.storybook/stories/assets/fr.vtt +8 -0
  12. package/.storybook/stories/assets/interactive.json +451 -0
  13. package/.storybook/stories/assets/sample_1280x720.mp4.jpg +0 -0
  14. package/.storybook/stories/assets/sample_1280x720.mp4.vtx +0 -0
  15. package/.storybook/stories/assets/thumbnails.vtt +62 -0
  16. package/.storybook/stories/assets/vertical.mp4 +0 -0
  17. package/.storybook/stories/utils/Wrap.tsx +18 -0
  18. package/.storybook/stories/utils/mock-playerapi.ts +181 -0
  19. package/.storybook/stories/utils/mock-setup.ts +23 -0
  20. package/README.md +1 -0
  21. package/dist/bundle.js +1 -0
  22. package/dist/font.scss +59 -0
  23. package/dist/libs/analytics/src/clients/CollectionApiClient.d.ts +48 -0
  24. package/dist/libs/analytics/src/constants/CountryRegionMapping.d.ts +7 -0
  25. package/dist/libs/analytics/src/constants/Regions.d.ts +6 -0
  26. package/dist/libs/analytics/src/enums/CountryCode.d.ts +5 -0
  27. package/dist/libs/analytics/src/enums/RegionName.d.ts +5 -0
  28. package/dist/libs/analytics/src/interfaces/AnalyticsTypes.d.ts +316 -0
  29. package/dist/libs/analytics/src/interfaces/Config.d.ts +3 -0
  30. package/dist/libs/analytics/src/interfaces/Folder.d.ts +3 -0
  31. package/dist/libs/analytics/src/interfaces/HashObject.d.ts +3 -0
  32. package/dist/libs/analytics/src/interfaces/Owner.d.ts +3 -0
  33. package/dist/libs/analytics/src/interfaces/Playlist.d.ts +3 -0
  34. package/dist/libs/analytics/src/interfaces/Rating.d.ts +4 -0
  35. package/dist/libs/analytics/src/interfaces/Region.d.ts +5 -0
  36. package/dist/libs/analytics/src/interfaces/RegionalUrl.d.ts +5 -0
  37. package/dist/libs/analytics/src/interfaces/Resource.d.ts +5 -0
  38. package/dist/libs/analytics/src/interfaces/Series.d.ts +3 -0
  39. package/dist/libs/analytics/src/interfaces/Subtitle.d.ts +4 -0
  40. package/dist/libs/analytics/src/interfaces/User.d.ts +17 -0
  41. package/dist/libs/analytics/src/interfaces/VersionData.d.ts +4 -0
  42. package/dist/libs/analytics/src/interfaces/Video.d.ts +16 -0
  43. package/dist/libs/analytics/src/interfaces/index.d.ts +15 -0
  44. package/dist/libs/analytics/src/interfaces/primitives/BaseObject.d.ts +7 -0
  45. package/dist/libs/analytics/src/models/AnalyticsEvent.d.ts +49 -0
  46. package/dist/libs/analytics/src/models/CollectionEvent.d.ts +61 -0
  47. package/dist/libs/analytics/src/utils/CollectionApiClientHelper.d.ts +6 -0
  48. package/dist/libs/analytics/src/utils/DataFormatHelper.d.ts +14 -0
  49. package/dist/libs/analytics/src/utils/EventWhitelistHelper.d.ts +19 -0
  50. package/dist/libs/analytics/src/utils/TypeHelper.d.ts +4 -0
  51. package/dist/libs/analytics/src/utils/UploadDataFormatHelper.d.ts +10 -0
  52. package/dist/libs/analytics/src/utils/UrlHelper.d.ts +3 -0
  53. package/dist/libs/analytics/src/utils/UserAgentHelper.d.ts +10 -0
  54. package/dist/libs/analytics/src/utils/VideoDataFormatHelper.d.ts +42 -0
  55. package/dist/libs/common/src/backbone/constants/CommonChannels.d.ts +5 -0
  56. package/dist/libs/common/src/backbone/core/AppLink.d.ts +37 -0
  57. package/dist/libs/common/src/backbone/core/BaseAppRouter.d.ts +99 -0
  58. package/dist/libs/common/src/backbone/core/BaseApplication.d.ts +76 -0
  59. package/dist/libs/common/src/backbone/core/BaseBehavior.d.ts +6 -0
  60. package/dist/libs/common/src/backbone/core/BaseCollection.d.ts +7 -0
  61. package/dist/libs/common/src/backbone/core/BaseCollectionView.d.ts +16 -0
  62. package/dist/libs/common/src/backbone/core/BaseError.d.ts +18 -0
  63. package/dist/libs/common/src/backbone/core/BaseLayoutView.d.ts +11 -0
  64. package/dist/libs/common/src/backbone/core/BaseModel.d.ts +27 -0
  65. package/dist/libs/common/src/backbone/core/BaseNestedModel.d.ts +21 -0
  66. package/dist/libs/common/src/backbone/core/BaseService.d.ts +10 -0
  67. package/dist/libs/common/src/backbone/core/BaseView.d.ts +131 -0
  68. package/dist/libs/common/src/backbone/core/EventNames.d.ts +16 -0
  69. package/dist/libs/common/src/backbone/core/LayoutService.d.ts +31 -0
  70. package/dist/libs/common/src/backbone/core/ListenToRadio.d.ts +3 -0
  71. package/dist/libs/common/src/backbone/core/LocationUtils.d.ts +23 -0
  72. package/dist/libs/common/src/backbone/core/Middleware.d.ts +10 -0
  73. package/dist/libs/common/src/backbone/core/Shell.d.ts +79 -0
  74. package/dist/libs/common/src/backbone/core/Types.d.ts +12 -0
  75. package/dist/libs/common/src/backbone/core/index.d.ts +18 -0
  76. package/dist/libs/common/src/backbone/errors/DevError.d.ts +4 -0
  77. package/dist/libs/common/src/backbone/index.d.ts +2 -0
  78. package/dist/libs/common/src/backbone/interfaces/StickitBinding.d.ts +38 -0
  79. package/dist/libs/common/src/backbone/services/EnvironmentVariables.d.ts +13 -0
  80. package/dist/libs/common/src/react/interfaces/HashObject.d.ts +3 -0
  81. package/dist/libs/shared/src/interfaces/models/primitives/BaseObject.d.ts +7 -0
  82. package/dist/player-app.css +71 -0
  83. package/dist/player-app.js +52 -0
  84. package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-item.d.ts +79 -0
  85. package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-items.d.ts +55 -0
  86. package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-load-progress.d.ts +55 -0
  87. package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-play-progress.d.ts +55 -0
  88. package/dist/projects/player/src/components/chapter-seek-bar/chapter-seek-bar.d.ts +1 -0
  89. package/dist/projects/player/src/components/chapters-button/chapter-menu-item.d.ts +60 -0
  90. package/dist/projects/player/src/components/chapters-button/chapters-button.d.ts +1 -0
  91. package/dist/projects/player/src/components/cog-button/cog-button.d.ts +38 -0
  92. package/dist/projects/player/src/components/collapserator/collapserator.d.ts +4 -0
  93. package/dist/projects/player/src/components/mouse-time-display/mouse-time-display.d.ts +3 -0
  94. package/dist/projects/player/src/components/playback-rate-button/playback-rate-button.d.ts +1 -0
  95. package/dist/projects/player/src/components/progress-control/progress-control.d.ts +1 -0
  96. package/dist/projects/player/src/components/quality-selector/quality-button.d.ts +1 -0
  97. package/dist/projects/player/src/components/quality-selector/quality-menu-item.d.ts +17 -0
  98. package/dist/projects/player/src/components/subs-caps-button/subs-caps-button.d.ts +1 -0
  99. package/dist/projects/player/src/components/thumbnail-display/thumbnail-display.d.ts +66 -0
  100. package/dist/projects/player/src/components/time-tooltip/time-tooltip.d.ts +15 -0
  101. package/dist/projects/player/src/components/time-wrapper/time-wrapper.d.ts +1 -0
  102. package/dist/projects/player/src/index.d.ts +12 -0
  103. package/dist/projects/player/src/interfaces/CollapsibleComponent.d.ts +10 -0
  104. package/dist/projects/player/src/interfaces/models/ApiError.d.ts +4 -0
  105. package/dist/projects/player/src/interfaces/models/PlaybackObject.d.ts +32 -0
  106. package/dist/projects/player/src/players/base-player.d.ts +64 -0
  107. package/dist/projects/player/src/players/create-clip-player.d.ts +16 -0
  108. package/dist/projects/player/src/players/interactive-player.d.ts +11 -0
  109. package/dist/projects/player/src/players/player.d.ts +15 -0
  110. package/dist/projects/player/src/plugins/clip-plugin/clip-plugin.d.ts +50 -0
  111. package/dist/projects/player/src/plugins/create-clip-plugin/components/clip-timepoint-selector/clip-timepoint-selector-handle.d.ts +54 -0
  112. package/dist/projects/player/src/plugins/create-clip-plugin/components/clip-timepoint-selector/clip-timepoint-selector.d.ts +89 -0
  113. package/dist/projects/player/src/plugins/create-clip-plugin/components/create-clip-seek-bar/create-clip-seek-bar.d.ts +14 -0
  114. package/dist/projects/player/src/plugins/create-clip-plugin/create-clip-plugin.d.ts +14 -0
  115. package/dist/projects/player/src/plugins/example-plugin/components/example-button/example-button.d.ts +1 -0
  116. package/dist/projects/player/src/plugins/example-plugin/components/example-react-button/example-react-button.d.ts +1 -0
  117. package/dist/projects/player/src/plugins/example-plugin/example-plugin.d.ts +2 -0
  118. package/dist/projects/player/src/plugins/fullscreen-on-rotate-plugin/fullscreen-on-rotate-plugin.d.ts +1 -0
  119. package/dist/projects/player/src/plugins/interactive-plugin/components/create-components/create-components.d.ts +4 -0
  120. package/dist/projects/player/src/plugins/interactive-plugin/components/create-components/create-short-answer.ts/create-short-answer.d.ts +10 -0
  121. package/dist/projects/player/src/plugins/interactive-plugin/components/create-components/create-type-selector/create-type-selector.d.ts +8 -0
  122. package/dist/projects/player/src/plugins/interactive-plugin/components/feedback/feedback.d.ts +7 -0
  123. package/dist/projects/player/src/plugins/interactive-plugin/components/incomplete-alert/incomplete-alert.d.ts +2 -0
  124. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive/interactive-component.d.ts +1 -0
  125. package/dist/projects/player/src/plugins/interactive-plugin/components/seek-bar/interactive-bar-item.d.ts +21 -0
  126. package/dist/projects/player/src/plugins/interactive-plugin/components/seek-bar/interactive-bar-items.d.ts +66 -0
  127. package/dist/projects/player/src/plugins/interactive-plugin/components/timepoint/timepoint-component.d.ts +21 -0
  128. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/annotation/annotation-interaction.d.ts +3 -0
  129. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/image/image-interaction.d.ts +4 -0
  130. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/missing-word/missing-word-interaction.d.ts +9 -0
  131. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/multiple-choice/multiple-choice-interaction.d.ts +10 -0
  132. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/short-answer/short-answer-interaction.d.ts +9 -0
  133. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/view-components.d.ts +4 -0
  134. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/view-interaction-heading/view-interaction-heading.d.ts +8 -0
  135. package/dist/projects/player/src/plugins/interactive-plugin/interactive-plugin.d.ts +1 -0
  136. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/InteractionComponent.d.ts +3 -0
  137. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/InteractionProps.d.ts +8 -0
  138. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/InteractiveMode.d.ts +4 -0
  139. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/SubmissionFunction.d.ts +2 -0
  140. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/ValidationFunction.d.ts +2 -0
  141. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/index.d.ts +6 -0
  142. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/models/ActionableItem.d.ts +6 -0
  143. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/models/Interaction.d.ts +14 -0
  144. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/models/InteractionType.d.ts +7 -0
  145. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/models/InteractionTypeId.d.ts +8 -0
  146. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/models/Interactive.d.ts +7 -0
  147. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/models/Timepoint.d.ts +9 -0
  148. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/models/index.d.ts +6 -0
  149. package/dist/projects/player/src/plugins/interactive-plugin/utils/getInteractionComponents.d.ts +2 -0
  150. package/dist/projects/player/src/plugins/interactive-plugin/utils/getInteractionStateId.d.ts +2 -0
  151. package/dist/projects/player/src/plugins/interactive-plugin/utils/getSubmissionFunction.d.ts +2 -0
  152. package/dist/projects/player/src/plugins/interactive-plugin/utils/getTimepointStateId.d.ts +2 -0
  153. package/dist/projects/player/src/plugins/interactive-plugin/utils/getValidationFunction.d.ts +2 -0
  154. package/dist/projects/player/src/plugins/interactive-plugin/utils/useInteractiveTrack.d.ts +17 -0
  155. package/dist/projects/player/src/plugins/open-externally-plugin/components/open-externally-button.d.ts +1 -0
  156. package/dist/projects/player/src/plugins/open-externally-plugin/interfaces/ExternalLinkOptions.d.ts +3 -0
  157. package/dist/projects/player/src/plugins/open-externally-plugin/open-externally-plugin.d.ts +1 -0
  158. package/dist/projects/player/src/plugins/persist-volume-plugin/persist-volume-plugin.d.ts +1 -0
  159. package/dist/projects/player/src/plugins/persist-volume-plugin/persist-volume-plugin.test.d.ts +1 -0
  160. package/dist/projects/player/src/plugins/progress-reporter-plugin/progress-reporter-plugin.d.ts +9 -0
  161. package/dist/projects/player/src/plugins/progressive-files-plugin/ProgressiveFilesPluginOptions.d.ts +4 -0
  162. package/dist/projects/player/src/plugins/progressive-files-plugin/ProgressiveRepresentation.d.ts +10 -0
  163. package/dist/projects/player/src/plugins/progressive-files-plugin/interfaces/Source.d.ts +6 -0
  164. package/dist/projects/player/src/plugins/progressive-files-plugin/progressive-files-plugin.d.ts +38 -0
  165. package/dist/projects/player/src/plugins/touch-controls-plugin/components/touch-controls/touch-controls.d.ts +59 -0
  166. package/dist/projects/player/src/plugins/touch-controls-plugin/touch-controls-plugin.d.ts +1 -0
  167. package/dist/projects/player/src/react/CreateClipPlayer.d.ts +3 -0
  168. package/dist/projects/player/src/react/EmbeddedPlayer.d.ts +7 -0
  169. package/dist/projects/player/src/react/InteractivePlayer.d.ts +9 -0
  170. package/dist/projects/player/src/react/Player.d.ts +8 -0
  171. package/dist/projects/player/src/react/react-component.d.ts +56 -0
  172. package/dist/projects/player/src/services/analytics-service.d.ts +15 -0
  173. package/dist/projects/player/src/utils/ajax-helper.d.ts +6 -0
  174. package/dist/projects/player/src/utils/fn.d.ts +14 -0
  175. package/dist/projects/player/src/utils/formatTime.d.ts +5 -0
  176. package/dist/projects/player/src/utils/hotkeys.d.ts +5 -0
  177. package/dist/projects/player/src/utils/scrollbar-helper.d.ts +6 -0
  178. package/dist/projects/player/src/utils/track-helper.d.ts +7 -0
  179. package/dist/projects/player/test/players/test-player.d.ts +17 -0
  180. package/dist/projects/player/test/setupTests.d.ts +0 -0
  181. package/dist/projects/player/test/utils/test-helpers.d.ts +8 -0
  182. package/jest.config.js +13 -0
  183. package/package.json +58 -0
  184. package/test/players/test-player.ts +31 -0
  185. package/test/setupTests.ts +8 -0
  186. package/test/utils/test-helpers.ts +22 -0
  187. package/tooling/externals.js +56 -0
  188. package/tooling/font-webpack.config.js +44 -0
  189. package/typings/libs/videojs-contrib-quality-levels.d.ts +29 -0
  190. package/typings/utils/imports.d.ts +12 -0
@@ -0,0 +1 @@
1
+ import '../../plugins/persist-volume-plugin/persist-volume-plugin';
@@ -0,0 +1,9 @@
1
+ interface Event {
2
+ time: number;
3
+ type: string;
4
+ }
5
+ export interface ProgressEvent {
6
+ start: Event;
7
+ end: Event;
8
+ }
9
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Source } from "./interfaces/Source";
2
+ export interface ProgressiveFilesPluginOptions {
3
+ sources: Source[];
4
+ }
@@ -0,0 +1,10 @@
1
+ import { Representation } from 'videojs-contrib-quality-levels';
2
+ import { Source } from "./interfaces/Source";
3
+ import { ProgressiveFilesPlugin } from "./progressive-files-plugin";
4
+ export declare class ProgressiveRepresentation implements Representation {
5
+ id: string;
6
+ private plugin;
7
+ private source;
8
+ constructor(plugin: ProgressiveFilesPlugin, source: Source);
9
+ enabled(enabled: boolean): boolean;
10
+ }
@@ -0,0 +1,6 @@
1
+ export interface Source {
2
+ id: string;
3
+ url: string;
4
+ mimeType: string;
5
+ default: boolean;
6
+ }
@@ -0,0 +1,38 @@
1
+ import videojs, { VideoJsPlayer } from 'video.js';
2
+ import { Source } from "./interfaces/Source";
3
+ import { ProgressiveFilesPluginOptions } from "./ProgressiveFilesPluginOptions";
4
+ declare const Plugin: {
5
+ new (player: VideoJsPlayer, options?: any): videojs.Plugin;
6
+ prototype: videojs.Plugin;
7
+ BASE_PLUGIN_NAME: string;
8
+ deregisterPlugin(name: string): void;
9
+ getPlugin(name: string): any;
10
+ getPluginVersion(name: string): string;
11
+ getPlugins(names?: string[]): {
12
+ [name: string]: videojs.Plugin;
13
+ };
14
+ isBasic(plugin: string | (() => any)): boolean;
15
+ registerPlugin<T, K>(name: string, plugin: (this: VideoJsPlayer, ...options: K[]) => T): (...options: K[]) => T;
16
+ registerPlugin<T_1 extends any>(name: string, plugin: T_1): () => T_1;
17
+ };
18
+ export declare class ProgressiveFilesPlugin extends Plugin {
19
+ private sources;
20
+ private _currentSource;
21
+ private qualityLevels;
22
+ constructor(player: VideoJsPlayer, options: ProgressiveFilesPluginOptions);
23
+ get currentSource(): Source;
24
+ /**
25
+ * Sets the current player source. If the id cannot be found, the current source is returned
26
+ * @param id the id of the source to set
27
+ */
28
+ setSource(id: string): Source;
29
+ getSourceById(id: string): Source;
30
+ private populateSources;
31
+ private sourceChangeUpdateQualityLevels;
32
+ }
33
+ declare module 'video.js' {
34
+ interface VideoJsPlayer {
35
+ progressiveFiles(options: ProgressiveFilesPluginOptions): void;
36
+ }
37
+ }
38
+ export {};
@@ -0,0 +1,59 @@
1
+ import videojs, { VideoJsPlayer } from 'video.js';
2
+ import './touch-controls.scss';
3
+ declare const Component: {
4
+ new (player: VideoJsPlayer, options?: videojs.ComponentOptions, ready?: videojs.Component.ReadyCallback): videojs.Component;
5
+ prototype: videojs.Component;
6
+ getComponent(name: "button" | "Button"): {
7
+ new (player: VideoJsPlayer, options?: videojs.ComponentOptions): videojs.Button;
8
+ prototype: videojs.Button;
9
+ };
10
+ getComponent(name: "ClickableComponent" | "clickablecomponent"): {
11
+ new (player: VideoJsPlayer, options?: videojs.ComponentOptions): videojs.ClickableComponent;
12
+ prototype: videojs.ClickableComponent;
13
+ };
14
+ getComponent(name: "ModalDialog" | "modaldialog"): {
15
+ new (player: VideoJsPlayer, options?: videojs.ModalDialogOptions): videojs.ModalDialog;
16
+ prototype: videojs.ModalDialog;
17
+ };
18
+ getComponent(name: "menu" | "Menu"): {
19
+ new (player: VideoJsPlayer, options?: videojs.MenuOptions): videojs.Menu;
20
+ prototype: videojs.Menu;
21
+ };
22
+ getComponent(name: "MenuButton" | "menubutton"): {
23
+ new (player: VideoJsPlayer, options?: videojs.MenuButtonOptions): videojs.MenuButton;
24
+ prototype: videojs.MenuButton;
25
+ };
26
+ getComponent(name: "menuitem" | "MenuItem"): {
27
+ new (player: VideoJsPlayer, options?: videojs.MenuItemOptions): videojs.MenuItem;
28
+ prototype: videojs.MenuItem;
29
+ };
30
+ getComponent(name: "MouseTimeDisplay" | "mouseTimeDisplay"): {
31
+ new (player: VideoJsPlayer, options?: videojs.ComponentOptions): videojs.MouseTimeDisplay;
32
+ prototype: videojs.MouseTimeDisplay;
33
+ };
34
+ getComponent(name: "Spacer" | "spacer"): {
35
+ new (player: VideoJsPlayer, options?: videojs.ComponentOptions, ready?: videojs.Component.ReadyCallback): videojs.Spacer;
36
+ prototype: videojs.Spacer;
37
+ };
38
+ getComponent(name: "Player" | "player"): {
39
+ new (player: VideoJsPlayer, options?: import("video.js").VideoJsPlayerOptions): VideoJsPlayer;
40
+ prototype: VideoJsPlayer;
41
+ getTagSettings(tag: Element): any;
42
+ };
43
+ getComponent(name: "timeTooltip" | "TimeTooltip"): {
44
+ new (player: VideoJsPlayer, options?: videojs.ComponentOptions): videojs.TimeToolTip;
45
+ prototype: videojs.TimeToolTip;
46
+ };
47
+ getComponent(name: string): any;
48
+ registerComponent(name: string, ComponentToRegister: any): any;
49
+ };
50
+ export declare class TouchControls extends Component {
51
+ private el_;
52
+ private timeoutId;
53
+ constructor(player: VideoJsPlayer, options?: videojs.ComponentOptions);
54
+ buildCSSClass(): string;
55
+ createEl(tagName?: string, properties?: any, attributes?: any): Element;
56
+ setUi(amount: number, timeout: number): void;
57
+ removeText(): void;
58
+ }
59
+ export {};
@@ -0,0 +1 @@
1
+ import './components/touch-controls/touch-controls';
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { CreateClipPlayerOptions } from "../players/create-clip-player";
3
+ export declare function ClickViewCreateClipPlayer(props: CreateClipPlayerOptions): React.ReactElement;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { ClickViewPlayerProps } from "./Player";
3
+ import './embedded-player.scss';
4
+ interface EmbeddedPlayerProps extends Omit<ClickViewPlayerProps, 'embed'> {
5
+ }
6
+ export declare function EmbeddedPlayer(props: EmbeddedPlayerProps): JSX.Element;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { InteractiveMode } from "../plugins/interactive-plugin/interfaces";
3
+ import { InteractivePlayer, InteractivePlayerOptions } from "../players/interactive-player";
4
+ interface ClickViewInteractivePlayerProps {
5
+ onReady?: (player: InteractivePlayer) => void;
6
+ mode?: InteractiveMode;
7
+ }
8
+ export declare function ClickViewInteractivePlayer(props: InteractivePlayerOptions & ClickViewInteractivePlayerProps): React.ReactElement;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { PlayerOptions } from "../players/player";
3
+ export interface ClickViewPlayerProps extends Omit<PlayerOptions, 'playerApi'> {
4
+ playerApi?: string;
5
+ className?: string;
6
+ innerRef?: React.MutableRefObject<HTMLDivElement>;
7
+ }
8
+ export declare function ClickViewPlayer(props: ClickViewPlayerProps): React.ReactElement;
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+ import videojs, { VideoJsPlayer } from 'video.js';
3
+ declare const Component: {
4
+ new (player: VideoJsPlayer, options?: videojs.ComponentOptions, ready?: videojs.Component.ReadyCallback): videojs.Component;
5
+ prototype: videojs.Component;
6
+ getComponent(name: "button" | "Button"): {
7
+ new (player: VideoJsPlayer, options?: videojs.ComponentOptions): videojs.Button;
8
+ prototype: videojs.Button;
9
+ };
10
+ getComponent(name: "ClickableComponent" | "clickablecomponent"): {
11
+ new (player: VideoJsPlayer, options?: videojs.ComponentOptions): videojs.ClickableComponent;
12
+ prototype: videojs.ClickableComponent;
13
+ };
14
+ getComponent(name: "ModalDialog" | "modaldialog"): {
15
+ new (player: VideoJsPlayer, options?: videojs.ModalDialogOptions): videojs.ModalDialog;
16
+ prototype: videojs.ModalDialog;
17
+ };
18
+ getComponent(name: "menu" | "Menu"): {
19
+ new (player: VideoJsPlayer, options?: videojs.MenuOptions): videojs.Menu;
20
+ prototype: videojs.Menu;
21
+ };
22
+ getComponent(name: "MenuButton" | "menubutton"): {
23
+ new (player: VideoJsPlayer, options?: videojs.MenuButtonOptions): videojs.MenuButton;
24
+ prototype: videojs.MenuButton;
25
+ };
26
+ getComponent(name: "menuitem" | "MenuItem"): {
27
+ new (player: VideoJsPlayer, options?: videojs.MenuItemOptions): videojs.MenuItem;
28
+ prototype: videojs.MenuItem;
29
+ };
30
+ getComponent(name: "MouseTimeDisplay" | "mouseTimeDisplay"): {
31
+ new (player: VideoJsPlayer, options?: videojs.ComponentOptions): videojs.MouseTimeDisplay;
32
+ prototype: videojs.MouseTimeDisplay;
33
+ };
34
+ getComponent(name: "Spacer" | "spacer"): {
35
+ new (player: VideoJsPlayer, options?: videojs.ComponentOptions, ready?: videojs.Component.ReadyCallback): videojs.Spacer;
36
+ prototype: videojs.Spacer;
37
+ };
38
+ getComponent(name: "Player" | "player"): {
39
+ new (player: VideoJsPlayer, options?: import("video.js").VideoJsPlayerOptions): VideoJsPlayer;
40
+ prototype: VideoJsPlayer;
41
+ getTagSettings(tag: Element): any;
42
+ };
43
+ getComponent(name: "timeTooltip" | "TimeTooltip"): {
44
+ new (player: VideoJsPlayer, options?: videojs.ComponentOptions): videojs.TimeToolTip;
45
+ prototype: videojs.TimeToolTip;
46
+ };
47
+ getComponent(name: string): any;
48
+ registerComponent(name: string, ComponentToRegister: any): any;
49
+ };
50
+ interface RootNodeOptions {
51
+ tagName?: string;
52
+ properties?: any;
53
+ attributes?: any;
54
+ }
55
+ export declare function getReactComponent(componentCtor: (player: VideoJsPlayer, options?: any) => React.ReactElement, options?: RootNodeOptions): typeof Component;
56
+ export {};
@@ -0,0 +1,15 @@
1
+ import { ProgressEvent } from "../plugins/progress-reporter-plugin/progress-reporter-plugin";
2
+ declare class StaticAnalyticsService {
3
+ private static instance;
4
+ private collectionApiClient;
5
+ constructor();
6
+ static get Instance(): StaticAnalyticsService;
7
+ logStream(): void;
8
+ logVideoProgress(events: ProgressEvent[]): void;
9
+ private initialize;
10
+ private setupCollectionApiClient;
11
+ private getCurrentUser;
12
+ private getActionContext;
13
+ }
14
+ export declare const AnalyticsService: StaticAnalyticsService;
15
+ export {};
@@ -0,0 +1,6 @@
1
+ declare class StaticAjaxHelper {
2
+ get<T>(url: string): Promise<T>;
3
+ private parseResponse;
4
+ }
5
+ export declare const AjaxHelper: StaticAjaxHelper;
6
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Wraps the given function, `fn`, with a new function that only invokes `fn`
3
+ * at most once per every `wait` milliseconds.
4
+ *
5
+ * @function
6
+ * @param {Function} fn
7
+ * The function to be throttled.
8
+ *
9
+ * @param {number} wait
10
+ * The number of milliseconds by which to throttle.
11
+ *
12
+ * @return {Function}
13
+ */
14
+ export declare const throttle: (fn: any, wait: any) => any;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Direct copy from format-time.js within video.js
3
+ * Unfortunately video.js doesn't expose this
4
+ */
5
+ export declare function formatTime(seconds: number, guide?: number): string;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * handleHotKeys is to be used as userActions.hotkeys in VideoJsPlayerOptions.
3
+ * `this` will be a reference to the player.
4
+ */
5
+ export declare function handleHotKeys(event: KeyboardEvent): void;
@@ -0,0 +1,6 @@
1
+ import videojs from 'video.js';
2
+ export declare const ScrollbarHelper: {
3
+ initMenuScrollbar(component: videojs.MenuButton): void;
4
+ unMountScrollbar(component: videojs.MenuButton): void;
5
+ getMenuEl(component: videojs.MenuButton): HTMLElement;
6
+ };
@@ -0,0 +1,7 @@
1
+ import { VideoJsPlayer } from 'video.js';
2
+ declare type TrackKind = 'metadata' | 'chapters';
3
+ declare type TrackLabel = 'interactive' | 'thumbnails' | false;
4
+ export declare const TrackHelper: {
5
+ useTrack(player: VideoJsPlayer, kind: TrackKind, label: TrackLabel, callback: (track: TextTrack) => void): void;
6
+ };
7
+ export {};
@@ -0,0 +1,17 @@
1
+ import { VideoJsPlayer } from 'video.js';
2
+ import { BasePlayer, BasePlayerOptions } from '../../src/players/base-player';
3
+ export interface TestPlayerOptions extends BasePlayerOptions {
4
+ configurePlugins?: (player: VideoJsPlayer) => void;
5
+ }
6
+ export declare class TestPlayer extends BasePlayer {
7
+ protected options: TestPlayerOptions;
8
+ player: VideoJsPlayer;
9
+ constructor(id: string | Element, options: TestPlayerOptions);
10
+ /**
11
+ * TODO: Look at reimplementing this. At the moment it's causing
12
+ * problems because the test will dispose of the player before the
13
+ * fetch has completed.
14
+ */
15
+ protected fetch(): Promise<void>;
16
+ protected configurePlugins(): void;
17
+ }
File without changes
@@ -0,0 +1,8 @@
1
+ import { TestPlayer, TestPlayerOptions } from '../players/test-player';
2
+ interface PlayerOptions extends Omit<TestPlayerOptions, 'viewKey'> {
3
+ }
4
+ export declare const TestHelpers: {
5
+ makeEl(): HTMLElement;
6
+ makePlayer(playerOptions?: PlayerOptions, containerEl?: HTMLElement): TestPlayer;
7
+ };
8
+ export {};
package/jest.config.js ADDED
@@ -0,0 +1,13 @@
1
+ const getBaseConfig = require('../../libs/testing/jest.base.config');
2
+ const { compilerOptions } = require('./tsconfig');
3
+
4
+ const paths = { ...compilerOptions.paths };
5
+
6
+ delete paths['*'];
7
+
8
+ const baseConfig = getBaseConfig(paths);
9
+
10
+ module.exports = {
11
+ ...baseConfig,
12
+ setupFilesAfterEnv: [...baseConfig.setupFilesAfterEnv, './test/setupTests.ts'],
13
+ };
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@clickview/player",
3
+ "version": "0.0.0-dev.0",
4
+ "description": "ClickView Player",
5
+ "main": "dist/player-app.js",
6
+ "scripts": {
7
+ "start": "set NODE_ENV=development&& webpack --config ./tooling/font-webpack.config.js&& webpack -w --config ./tooling/webpack.config.js",
8
+ "build": "set NODE_ENV=production&& webpack --config ./tooling/font-webpack.config.js&& webpack --config ./tooling/webpack.config.js",
9
+ "build-font": "set NODE_ENV=development&& npm run start",
10
+ "dev-build": "set NODE_ENV=development&& webpack --config ./tooling/webpack.config.js",
11
+ "storybook": "webpack --config ./tooling/font-webpack.config.js&& start-storybook -s ./.storybook/stories/assets -p 6006",
12
+ "build-storybook": "build-storybook",
13
+ "test": "jest",
14
+ "test-watch": "jest --watch",
15
+ "webpack-dev-server": "set NODE_ENV=development&& webpack-dev-server --config ./tooling/webpack.config.js"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://gitlab.cvinternal.net/front-end/clickview"
20
+ },
21
+ "cv": {
22
+ "publishable": true,
23
+ "rebuildable": true
24
+ },
25
+ "author": "Matt Trengrove, Cameron Hill, Shale Kuzmanovski",
26
+ "license": "ISC",
27
+ "devDependencies": {
28
+ "@babel/core": "7.11.6",
29
+ "@clickview/eslint-config": "0.0.0-rc.0",
30
+ "@clickview/tooling": "0.0.19-dev.0",
31
+ "@storybook/react": "6.0.26",
32
+ "@types/simplebar": "5.1.1",
33
+ "@types/video.js": "7.3.11",
34
+ "jest": "26.1.0",
35
+ "ts-jest": "26.1.4",
36
+ "webfonts-loader": "7.1.0",
37
+ "webpack-dev-server": "3.11.0"
38
+ },
39
+ "dependencies": {
40
+ "@clickview/styles": "1.0.12-dev.0",
41
+ "keycode": "2.2.0",
42
+ "simplebar": "5.3.0",
43
+ "simplebar-react": "2.3.0",
44
+ "video.js": "7.8.4",
45
+ "videojs-contrib-quality-levels": "2.0.9"
46
+ },
47
+ "babel": {
48
+ "presets": [
49
+ [
50
+ "@babel/preset-env",
51
+ {
52
+ "corejs": 3,
53
+ "useBuiltIns": "entry"
54
+ }
55
+ ]
56
+ ]
57
+ }
58
+ }
@@ -0,0 +1,31 @@
1
+ import { VideoJsPlayer } from 'video.js';
2
+ import { BasePlayer, BasePlayerOptions } from '../../src/players/base-player';
3
+
4
+ export interface TestPlayerOptions extends BasePlayerOptions {
5
+ configurePlugins?: (player: VideoJsPlayer) => void;
6
+ }
7
+
8
+ export class TestPlayer extends BasePlayer {
9
+ protected options: TestPlayerOptions;
10
+
11
+ public player: VideoJsPlayer;
12
+
13
+ constructor(id: string | Element, options: TestPlayerOptions) {
14
+ super(id, options);
15
+ }
16
+
17
+ /**
18
+ * TODO: Look at reimplementing this. At the moment it's causing
19
+ * problems because the test will dispose of the player before the
20
+ * fetch has completed.
21
+ */
22
+ protected async fetch(): Promise<void> {
23
+ }
24
+
25
+ protected configurePlugins(): void {
26
+ if (!(typeof this.options.configurePlugins === 'function'))
27
+ return;
28
+
29
+ this.options.configurePlugins(this.player);
30
+ }
31
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Media playback isn't supported by the DOM provided by Jest
3
+ * so we mock the following functions.
4
+ */
5
+ window.HTMLMediaElement.prototype.load = () => { };
6
+ window.HTMLMediaElement.prototype.play = (() => { }) as any;
7
+ window.HTMLMediaElement.prototype.pause = () => { };
8
+ window.HTMLMediaElement.prototype.addTextTrack = (() => { }) as any;
@@ -0,0 +1,22 @@
1
+ import { TestPlayer, TestPlayerOptions } from '../players/test-player';
2
+
3
+ interface PlayerOptions extends Omit<TestPlayerOptions, 'viewKey'> { }
4
+
5
+ export const TestHelpers = {
6
+ makeEl(): HTMLElement {
7
+ const el = document.createElement('div');
8
+ el.id = 'test-player';
9
+ return el;
10
+ },
11
+
12
+ makePlayer(playerOptions?: PlayerOptions, containerEl?: HTMLElement): TestPlayer {
13
+ containerEl = containerEl || TestHelpers.makeEl();
14
+
15
+ document.body.innerHTML = '';
16
+ document.body.appendChild(containerEl);
17
+
18
+ playerOptions = playerOptions || {};
19
+
20
+ return new TestPlayer(containerEl, playerOptions as TestPlayerOptions);
21
+ }
22
+ };
@@ -0,0 +1,56 @@
1
+ const externalModules = {
2
+ // 'CVEvents': /^cvevents$/i,
3
+
4
+ /**
5
+ * Shared Dependencies
6
+ */
7
+ // 'FontAwesome': [ /^@fortawesome\/fontawesome$/i, /^fontawesome$/i ],
8
+ // 'ReactBootstrap': [ /^react-bootstrap$/i, /^reactbootstrap$/i ],
9
+ // 'SortableHOC': [ /^react-sortable-hoc$/i, /^sortablehoc$/i ],
10
+ // 'ReactTransitionGroup': [ /^react-transition-group$/i, /^reacttransitiongroup$/i ],
11
+ // 'ReactIntersectionObserver': [ /^react-intersection-observer$/i, /^reactintersectionobserver$/i ],
12
+ // 'Autosuggest': [ /^react-autosuggest$/i, /^autosuggest$/i ],
13
+ // 'Backbone.Validation': [ /^backbone-validation$/i, /^backbone\.validation$/i ],
14
+ // 'Bloodhound': /^bloodhound$/i,
15
+
16
+ /**
17
+ * Common Dependencies
18
+ */
19
+ // 'React': /^react$/i,
20
+ // 'ReactDOM': [ /^react-dom$/i, /^ReactDOM$/i ],
21
+ // '_': [ /^underscore$/i, /^_$/i ],
22
+ // 'Backbone': /^backbone$/i,
23
+ // 'Marionette': [ /^backbone\.marionette$/i, /^marionette$/i ],
24
+ // 'Handlebars': /^handlebars$/i,
25
+ // 'bootstrap': /^bootstrap$/i,
26
+ // 'Backbone.Radio': /^backbone\.radio$/i,
27
+ // 'signalR': /^signalr$/i,
28
+ // 'Redux': /^redux$/i,
29
+ // 'ReactRedux': [ /^react-redux$/i, /^reactredux$/i ],
30
+ // 'DOMPurify': /^dompurify$/i,
31
+ // '$': [ /^jquery$/i, /^\$/ ],
32
+ // 'Polyglot': [ /^node-polyglot$/i, /^polyglot$/i ],
33
+ // 'moment': /^moment$/i,
34
+ // 'linkify': [ /^linkifyjs$/i, /^linkify$/i ]
35
+ };//
36
+
37
+ exports.mapExternalModules = (context, request, callback) => {
38
+ for (var key in externalModules) {
39
+ if (!externalModules.hasOwnProperty(key))
40
+ continue;
41
+
42
+ let arr = externalModules[key];
43
+
44
+ if (!Array.isArray(arr))
45
+ arr = [arr];
46
+
47
+ for (var i = 0; i < arr.length; i++) {
48
+ if (arr[i].test(request)) {
49
+ return callback(null, key);
50
+
51
+ }
52
+ }
53
+ }
54
+
55
+ callback();
56
+ }
@@ -0,0 +1,44 @@
1
+ const path = require('path');
2
+ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3
+ const iconMap = require('../src/font/icon-map');
4
+
5
+ const assetsRoot = path.resolve(__dirname, '..');
6
+ const srcRoot = path.resolve(assetsRoot, 'src');
7
+ const outputRoot = path.resolve(assetsRoot, 'dist');
8
+
9
+ module.exports = {
10
+ entry: path.resolve(srcRoot, 'font/index.js'),
11
+ mode: process.env.NODE_ENV,
12
+ output: {
13
+ filename: 'bundle.js',
14
+ path: outputRoot
15
+ },
16
+ plugins: [
17
+ new MiniCssExtractPlugin({
18
+ filename: 'font.scss',
19
+ })
20
+ ],
21
+ module: {
22
+ rules: [{
23
+ test: /\.font\.js/,
24
+ use: [
25
+ MiniCssExtractPlugin.loader,
26
+ {
27
+ loader: 'css-loader',
28
+ options: {
29
+ url: false
30
+ }
31
+ },
32
+ {
33
+ loader: 'webfonts-loader',
34
+ options: {
35
+ embed: true,
36
+ css: true,
37
+ scssFile: true,
38
+ codepoints: iconMap
39
+ }
40
+ }
41
+ ]
42
+ }]
43
+ }
44
+ };
@@ -0,0 +1,29 @@
1
+ import videojs from 'video.js';
2
+
3
+ declare module 'video.js' {
4
+ export interface VideoJsPlayer {
5
+ qualityLevels(): QualityLevelList;
6
+ }
7
+ }
8
+
9
+ declare module 'videojs-contrib-quality-levels' {
10
+ export interface QualityLevelList extends videojs.EventTarget {
11
+ [id: string]: QualityLevel;
12
+ selectedIndex: number;
13
+ length: number;
14
+ addQualityLevel(representation: Representation): QualityLevel;
15
+ removeQualityLevel(qualityLevel: QualityLevel): QualityLevel;
16
+ getQualityLevelById(id: string): QualityLevel;
17
+ }
18
+
19
+ export interface QualityLevel {
20
+ id: string;
21
+ label: string;
22
+ enabled: boolean;
23
+ }
24
+
25
+ export interface Representation {
26
+ id: string;
27
+ enabled(enabled: boolean): boolean;
28
+ }
29
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Define our templates as a module so that we can use
3
+ * import statements just the same as we do for other
4
+ * ts/js code.
5
+ */
6
+ declare module '*.scss';
7
+ declare module '*.svg';
8
+
9
+ declare module "*.json" {
10
+ export const value: any;
11
+ export default value;
12
+ }