@clickview/player 0.0.2 → 0.0.3-dev-us.2

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 (149) hide show
  1. package/.storybook/main.js +1 -0
  2. package/.storybook/stories/Base.stories.tsx +6 -5
  3. package/.storybook/stories/Interactives.stories.tsx +45 -49
  4. package/.storybook/stories/utils/mock-playerapi.ts +38 -12
  5. package/dist/en.json +733 -0
  6. package/dist/libs/analytics/src/constants/CountryRegionMapping.d.ts +1 -0
  7. package/dist/libs/analytics/src/constants/Regions.d.ts +1 -0
  8. package/dist/libs/analytics/src/enums/CountryCode.d.ts +2 -1
  9. package/dist/libs/analytics/src/enums/RegionName.d.ts +2 -1
  10. package/dist/libs/analytics/src/interfaces/AnalyticsTypes.d.ts +16 -7
  11. package/dist/libs/analytics/src/interfaces/Region.d.ts +0 -1
  12. package/dist/libs/common/src/backbone/core/AppLink.d.ts +1 -0
  13. package/dist/libs/common/src/backbone/core/LocationUtils.d.ts +1 -0
  14. package/dist/libs/common/src/backbone/enums/HttpStatus.d.ts +10 -0
  15. package/dist/libs/common/src/backbone/utils/LocalStorageHelper.d.ts +58 -0
  16. package/dist/libs/common/src/react/flight/FlightHelpers.d.ts +15 -0
  17. package/dist/libs/common/src/react/flight/FlightMiddleware.d.ts +11 -0
  18. package/dist/libs/common/src/react/flight/FlightReducer.d.ts +2 -0
  19. package/dist/libs/common/src/react/flight/FlightSimulator.d.ts +24 -0
  20. package/dist/libs/common/src/react/flight/constants/Actions.d.ts +7 -0
  21. package/dist/libs/common/src/react/flight/constants/index.d.ts +1 -0
  22. package/dist/libs/common/src/react/flight/data-layers/AjaxRequest.d.ts +2 -0
  23. package/dist/libs/common/src/react/flight/data-layers/index.d.ts +1 -0
  24. package/dist/libs/common/src/react/flight/index.d.ts +9 -0
  25. package/dist/libs/common/src/react/flight/interfaces/Action.d.ts +28 -0
  26. package/dist/libs/common/src/react/flight/interfaces/Dispatch.d.ts +3 -0
  27. package/dist/libs/common/src/react/flight/interfaces/HttpRequest.d.ts +27 -0
  28. package/dist/libs/common/src/react/flight/interfaces/NormalizedData.d.ts +7 -0
  29. package/dist/libs/common/src/react/flight/interfaces/Response.d.ts +9 -0
  30. package/dist/libs/common/src/react/flight/interfaces/index.d.ts +9 -0
  31. package/dist/libs/common/src/react/flight/normalizer/Denormalizer.d.ts +3 -0
  32. package/dist/libs/common/src/react/flight/normalizer/Normalizer.d.ts +8 -0
  33. package/dist/libs/common/src/react/flight/normalizer/index.d.ts +2 -0
  34. package/dist/libs/common/src/react/flight/utils/SimulatorHelper.d.ts +5 -0
  35. package/dist/libs/common/src/react/flight/utils/StateHelper.d.ts +11 -0
  36. package/dist/libs/common/src/react/flight/utils/index.d.ts +2 -0
  37. package/dist/libs/common/src/react/utils/ArrayHelper.d.ts +17 -1
  38. package/dist/libs/common/src/react/utils/ObjectHelper.d.ts +1 -0
  39. package/dist/libs/common/src/react/utils/TimeHelper.d.ts +8 -0
  40. package/dist/libs/shared/src/components/actions/Actions.d.ts +2 -2
  41. package/dist/libs/shared/src/components/actions/ActionsDropdown.d.ts +1 -1
  42. package/dist/libs/shared/src/components/app-link/AppLink.d.ts +8 -0
  43. package/dist/libs/shared/src/components/immersive-reader/ImmersiveReader.d.ts +14 -0
  44. package/dist/libs/shared/src/components/interactive-questions/InteractiveQuestions.d.ts +3 -1
  45. package/dist/libs/shared/src/components/text/Text.d.ts +13 -0
  46. package/dist/libs/shared/src/enums/CountryCode.d.ts +2 -1
  47. package/dist/libs/shared/src/enums/CurationStatus.d.ts +12 -0
  48. package/dist/libs/shared/src/enums/InteractionCorrectness.d.ts +8 -0
  49. package/dist/libs/shared/src/enums/InteractiveAnswerStatus.d.ts +5 -0
  50. package/dist/libs/shared/src/enums/ObjectStatus.d.ts +3 -3
  51. package/dist/libs/shared/src/enums/UserGroup.d.ts +3 -3
  52. package/dist/libs/shared/src/enums/UserRole.d.ts +4 -4
  53. package/dist/libs/shared/src/enums/WidgetContents.d.ts +3 -1
  54. package/dist/libs/shared/src/images/svg/ImportedSvgs.d.ts +4 -1
  55. package/dist/libs/shared/src/images/svg/objects/index.d.ts +3 -1
  56. package/dist/libs/shared/src/interfaces/VideoTypes.d.ts +2 -0
  57. package/dist/libs/shared/src/interfaces/app-variables/BaseSearchAppVariables.d.ts +1 -0
  58. package/dist/libs/shared/src/interfaces/index.d.ts +1 -0
  59. package/dist/libs/shared/src/interfaces/models/Classification.d.ts +0 -1
  60. package/dist/libs/shared/src/interfaces/models/Config.d.ts +8 -1
  61. package/dist/libs/shared/src/interfaces/models/Curriculum.d.ts +3 -1
  62. package/dist/libs/shared/src/interfaces/models/Customer.d.ts +2 -1
  63. package/dist/libs/shared/src/interfaces/models/InteractiveMetadata.d.ts +11 -3
  64. package/dist/libs/shared/src/interfaces/models/Library.d.ts +3 -0
  65. package/dist/libs/shared/src/interfaces/models/User.d.ts +38 -3
  66. package/dist/libs/shared/src/interfaces/models/Video.d.ts +2 -0
  67. package/dist/libs/shared/src/interfaces/models/index.d.ts +1 -0
  68. package/dist/libs/shared/src/interfaces/models/interactive-results/InteractiveResult.d.ts +5 -0
  69. package/dist/libs/shared/src/interfaces/models/interactive-results/InteractiveResultSet.d.ts +6 -0
  70. package/dist/libs/shared/src/interfaces/models/interactive-results/StudentAnswer.d.ts +9 -0
  71. package/dist/libs/shared/src/interfaces/models/interactive-results/StudentAttempt.d.ts +6 -0
  72. package/dist/libs/shared/src/interfaces/models/interactive-results/StudentResult.d.ts +6 -0
  73. package/dist/libs/shared/src/interfaces/models/interactive-results/index.d.ts +5 -0
  74. package/dist/libs/shared/src/interfaces/requests/CreateInteractiveMetadataRequest.d.ts +2 -0
  75. package/dist/libs/shared/src/interfaces/requests/CreateInteractiveRequest.d.ts +1 -0
  76. package/dist/libs/shared/src/interfaces/requests/EditInteractiveMetadataOriginRequest.d.ts +5 -0
  77. package/dist/libs/shared/src/interfaces/requests/EditInteractiveMetadataRequest.d.ts +2 -0
  78. package/dist/libs/shared/src/interfaces/requests/index.d.ts +1 -0
  79. package/dist/libs/shared/src/utils/interaction-type-helper/InteractionTypeHelper.d.ts +4 -0
  80. package/dist/player-app.css +387 -1694
  81. package/dist/player-app.js +1208 -5568
  82. package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-item.d.ts +1 -1
  83. package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-items.d.ts +1 -1
  84. package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-load-progress.d.ts +1 -1
  85. package/dist/projects/player/src/components/chapter-bar-items/chapter-bar-play-progress.d.ts +1 -1
  86. package/dist/projects/player/src/components/chapters-button/chapter-menu-item.d.ts +1 -1
  87. package/dist/projects/player/src/components/collapserator/collapserator.d.ts +1 -0
  88. package/dist/projects/player/src/components/player/player.d.ts +1 -1
  89. package/dist/projects/player/src/components/subs-caps-button/SubCapsMenuItem.d.ts +52 -0
  90. package/dist/projects/player/src/components/subs-caps-button/subtitle-size-menu-item.d.ts +53 -0
  91. package/dist/projects/player/src/components/subtitle-size-button/subtitle-size-button.d.ts +1 -0
  92. package/dist/projects/player/src/components/text-track-settings/text-track-settings.d.ts +56 -0
  93. package/dist/projects/player/src/components/thumbnail-display/thumbnail-display.d.ts +2 -1
  94. package/dist/projects/player/src/index.d.ts +0 -2
  95. package/dist/projects/player/src/interfaces/models/PlaybackObject.d.ts +8 -0
  96. package/dist/projects/player/src/players/base-player.d.ts +10 -0
  97. package/dist/projects/player/src/players/interactive-player.d.ts +6 -1
  98. package/dist/projects/player/src/players/player.d.ts +2 -1
  99. package/dist/projects/player/src/plugins/create-clip-plugin/components/clip-timepoint-selector/clip-timepoint-selector-handle.d.ts +1 -1
  100. package/dist/projects/player/src/plugins/create-clip-plugin/components/clip-timepoint-selector/clip-timepoint-selector.d.ts +1 -1
  101. package/dist/projects/player/src/plugins/interactive-plugin/components/continue-session/continue-session.d.ts +8 -0
  102. package/dist/projects/player/src/plugins/interactive-plugin/components/interaction-actions/interaction-actions.d.ts +4 -1
  103. package/dist/projects/player/src/plugins/interactive-plugin/components/interaction-footer/interaction-footer.d.ts +2 -2
  104. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/InteractiveSummaryWrapper.d.ts +18 -0
  105. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/interactions-bar/interactions-bar.d.ts +9 -0
  106. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/interactive-summary.d.ts +20 -0
  107. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/progress-summary/progress-summary.d.ts +12 -0
  108. package/dist/projects/player/src/plugins/interactive-plugin/components/interactive-summary/show-summary-button/show-summary-button.d.ts +13 -0
  109. package/dist/projects/player/src/plugins/interactive-plugin/components/move-timepoint/move-timepoint.d.ts +12 -0
  110. package/dist/projects/player/src/plugins/interactive-plugin/components/reorder-interactions/reorder-interactions.d.ts +9 -0
  111. package/dist/projects/player/src/plugins/interactive-plugin/components/seek-bar/interactive-bar-items.d.ts +1 -1
  112. package/dist/projects/player/src/plugins/interactive-plugin/components/sliding-timepoint/sliding-timepoints.d.ts +11 -0
  113. package/dist/projects/player/src/plugins/interactive-plugin/components/timepoint/timepoint-component.d.ts +28 -9
  114. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/interactive-immersive-reader/interactive-immersive-reader.d.ts +8 -0
  115. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/missing-word/missing-word-interaction.d.ts +2 -0
  116. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/multiple-choice/multiple-choice-interaction.d.ts +3 -0
  117. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/true-or-false/true-or-false-interaction.d.ts +3 -0
  118. package/dist/projects/player/src/plugins/interactive-plugin/components/view-components/view-components.d.ts +3 -0
  119. package/dist/projects/player/src/plugins/interactive-plugin/hooks/useInteractiveState.d.ts +10 -4
  120. package/dist/projects/player/src/plugins/interactive-plugin/hooks/useInteractiveTrack.d.ts +1 -0
  121. package/dist/projects/player/src/plugins/interactive-plugin/hooks/useLockPlayer.d.ts +2 -2
  122. package/dist/projects/player/src/plugins/interactive-plugin/hooks/useStateManager.d.ts +12 -4
  123. package/dist/projects/player/src/plugins/interactive-plugin/interactive-plugin.d.ts +47 -0
  124. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/InteractionProps.d.ts +1 -1
  125. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/InteractiveState.d.ts +5 -1
  126. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/LatestSession.d.ts +11 -0
  127. package/dist/projects/player/src/plugins/interactive-plugin/interfaces/index.d.ts +1 -0
  128. package/dist/projects/player/src/plugins/interactive-plugin/utils/InteractiveReducer.d.ts +2 -2
  129. package/dist/projects/player/src/plugins/interactive-plugin/utils/ResultsService.d.ts +4 -1
  130. package/dist/projects/player/src/plugins/interactive-plugin/utils/helpers.d.ts +1 -0
  131. package/dist/projects/player/src/plugins/interactive-plugin/utils/interactive-ajax.d.ts +1 -0
  132. package/dist/projects/player/src/plugins/next-video-plugin/next-video-plugin.d.ts +0 -8
  133. package/dist/projects/player/src/plugins/persist-quality-settings-plugin/persist-quality-settings-plugin.d.ts +33 -0
  134. package/dist/projects/player/src/plugins/persist-subtitle-settings-plugin/persist-subtitle-settings-plugin.d.ts +38 -0
  135. package/dist/projects/player/src/plugins/picture-in-picture-plugin/picture-in-picture-plugin.d.ts +5 -1
  136. package/dist/projects/player/src/plugins/progress-reporter-plugin/progress-reporter-plugin.d.ts +59 -0
  137. package/dist/projects/player/src/plugins/touch-controls-plugin/components/touch-controls/touch-controls.d.ts +1 -1
  138. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/drag-handle/drag-handle.d.ts +53 -0
  139. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/drag-targets/drag-targets.d.ts +54 -0
  140. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/whiteboard-mode-button/whiteboard-mode-button.d.ts +23 -0
  141. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/components/whiteboard-mode-button/whiteboard-mode-menu-item.d.ts +15 -0
  142. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/contants/WhiteboardSides.d.ts +5 -0
  143. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/interfaces/WhiteboardSide.d.ts +1 -0
  144. package/dist/projects/player/src/plugins/whiteboard-mode-plugin/whiteboard-mode-plugin.d.ts +34 -0
  145. package/dist/projects/player/src/react/InteractivePlayer.d.ts +1 -0
  146. package/dist/projects/player/src/react/Player.d.ts +1 -1
  147. package/dist/projects/player/src/utils/local-storage-helper.d.ts +6 -0
  148. package/package.json +8 -4
  149. package/typings/utils/imports.d.ts +1 -1
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
2
  import { Interaction } from 'libs/shared/interfaces';
3
3
  import { InteractionProps, ViewInteractionState, ViewSubmissionFunction } from 'projects/player/plugins/interactive-plugin//interfaces';
4
+ import { InteractionCorrectness } from 'libs/shared/enums/InteractionCorrectness';
4
5
  import './missing-word-interaction.scss';
5
6
  interface MissingWordState extends ViewInteractionState {
6
7
  [id: string]: string;
7
8
  }
9
+ export declare function IsMissingWordCorrect(state: MissingWordState, interaction: Interaction): InteractionCorrectness;
8
10
  export declare function IsViewMissingWordValid(state: MissingWordState, interaction: Interaction): string;
9
11
  export declare const SubmitViewMissingWord: ViewSubmissionFunction;
10
12
  export declare function MissingWordInteraction(props: InteractionProps<MissingWordState>): React.ReactElement;
@@ -1,9 +1,12 @@
1
1
  import React from 'react';
2
+ import { Interaction } from 'libs/shared/interfaces';
2
3
  import { InteractionProps, ViewInteractionState, ViewSubmissionFunction } from 'projects/player/plugins/interactive-plugin/interfaces';
3
4
  import './multiple-choice-interaction.scss';
5
+ import { InteractionCorrectness } from 'libs/shared/enums/InteractionCorrectness';
4
6
  interface MultipleChoiceState extends ViewInteractionState {
5
7
  [id: string]: string;
6
8
  }
9
+ export declare function IsMultipleChoiceCorrect(state: MultipleChoiceState, interaction: Interaction): InteractionCorrectness;
7
10
  export declare function IsViewMultipleChoiceValid(state: MultipleChoiceState): string;
8
11
  export declare const SubmitViewMultipleChoice: ViewSubmissionFunction;
9
12
  export declare function MultipleChoiceInteraction(props: InteractionProps<MultipleChoiceState>): React.ReactElement;
@@ -1,9 +1,12 @@
1
1
  import React from 'react';
2
+ import { Interaction } from 'libs/shared/interfaces';
2
3
  import { InteractionProps, ViewInteractionState, ViewSubmissionFunction } from 'projects/player/plugins/interactive-plugin/interfaces';
4
+ import { InteractionCorrectness } from 'libs/shared/enums/InteractionCorrectness';
3
5
  import './true-or-false-interaction.scss';
4
6
  interface MultipleChoiceState extends ViewInteractionState {
5
7
  [id: string]: string;
6
8
  }
9
+ export declare function IsTrueOrFalseCorrect(state: MultipleChoiceState, interaction: Interaction): InteractionCorrectness;
7
10
  export declare function IsViewTrueOrFalseValid(state: MultipleChoiceState): string;
8
11
  export declare const SubmitViewTrueOrFalse: ViewSubmissionFunction;
9
12
  export declare function TrueOrFalseInteraction(props: InteractionProps<MultipleChoiceState>): React.ReactElement;
@@ -1,9 +1,12 @@
1
1
  import { Interaction, InteractionTypeId } from 'libs/shared/interfaces';
2
2
  import { InteractionComponent, ViewInteractionState, ViewSubmissionFunction } from 'projects/player/plugins/interactive-plugin/interfaces';
3
+ import { InteractionCorrectness } from 'libs/shared/enums/InteractionCorrectness';
3
4
  declare type ShowFeedbackFunction = (interaction: Interaction) => boolean;
4
5
  export declare function getShouldShowFeedback(typeId: InteractionTypeId): ShowFeedbackFunction;
5
6
  export declare function getViewComponent(typeId: InteractionTypeId): InteractionComponent;
6
7
  declare type ViewValidationFunction = (state: ViewInteractionState, interaction: Interaction) => string;
7
8
  export declare function getViewValidation(typeId: InteractionTypeId): ViewValidationFunction;
8
9
  export declare function getViewSubmit(typeId: InteractionTypeId): ViewSubmissionFunction;
10
+ declare type IsCorrectFunction = (state: ViewInteractionState, interaction: Interaction) => InteractionCorrectness;
11
+ export declare function getViewIsCorrect(typeId: InteractionTypeId): IsCorrectFunction;
9
12
  export {};
@@ -1,20 +1,26 @@
1
1
  import { Timepoint } from 'libs/shared/interfaces';
2
- import { InteractionState, InteractiveMode, TimepointState } from 'projects/player/plugins/interactive-plugin/interfaces';
2
+ import { InteractionState, InteractiveMode, LatestSession, TimepointState } from 'projects/player/plugins/interactive-plugin/interfaces';
3
3
  interface UseInteractiveStateProps {
4
4
  mode: InteractiveMode;
5
5
  timepoint: Timepoint;
6
+ latestSession?: LatestSession;
6
7
  }
8
+ /**
9
+ * This should only be used inside of useStateManager
10
+ */
7
11
  export declare const useInteractiveState: (props: UseInteractiveStateProps) => {
8
- _doNotUse: import("../interfaces").InteractiveState;
12
+ state: import("../interfaces").InteractiveState;
9
13
  interaction: import("../../../../../../libs/shared/src/interfaces").Interaction;
10
14
  interactionState: InteractionState;
11
15
  timepointState: TimepointState;
16
+ nextInteraction: import("../../../../../../libs/shared/src/interfaces").Interaction;
17
+ nextInteractionState: InteractionState;
12
18
  getTimepointState: (id: string) => TimepointState;
13
19
  getInteractionState: (id: string) => InteractionState;
14
20
  updateTimepointState: (id: string, value: TimepointState) => void;
15
- updateInteractionState: (id: string, value: InteractionState) => void;
21
+ updateInteractionState: (id: string, value: InteractionState, clear?: boolean) => void;
16
22
  clearTimepointState: (id: string) => void;
17
23
  clearInteractionState: (id: string) => void;
18
- userUpdateInteractionState: (value: InteractionState) => void;
24
+ userUpdateInteractionState: (value: InteractionState, clear?: boolean) => void;
19
25
  };
20
26
  export {};
@@ -16,5 +16,6 @@ export declare const useInteractiveTrack: (options: useInteractiveOptions) => {
16
16
  updateCue: (oldTimepointId: string, timepointId: string) => void;
17
17
  addCue: (timepointId: string) => void;
18
18
  removeCue: (visibleAt: number) => void;
19
+ moveTimepoint: (newTime: number) => void;
19
20
  };
20
21
  export {};
@@ -1,14 +1,14 @@
1
1
  import { VideoJsPlayer } from 'video.js';
2
2
  import { Interaction, Timepoint } from 'libs/shared/interfaces';
3
3
  import { InteractiveMode } from 'projects/player/plugins/interactive-plugin/interfaces';
4
- import { InteractionState, InteractiveState } from 'projects/player/plugins/interactive-plugin/interfaces/InteractiveState';
4
+ import { InteractionState, TimepointState } from 'projects/player/plugins/interactive-plugin/interfaces/InteractiveState';
5
5
  interface UseLockNavProps {
6
6
  mode: InteractiveMode;
7
- state: InteractiveState;
8
7
  player: VideoJsPlayer;
9
8
  timepoint: Timepoint;
10
9
  interaction: Interaction;
11
10
  interactionState: InteractionState;
11
+ timepointState: TimepointState;
12
12
  discardChanges: (after?: () => void) => void;
13
13
  }
14
14
  export declare function useLockPlayer(props: UseLockNavProps): void;
@@ -1,6 +1,6 @@
1
1
  import { VideoJsPlayer } from 'video.js';
2
2
  import { Interaction, InteractionTypeId, Interactive, Timepoint } from 'libs/shared/interfaces';
3
- import { InteractiveMode } from 'projects/player/plugins/interactive-plugin/interfaces';
3
+ import { InteractiveMode, LatestSession } from 'projects/player/plugins/interactive-plugin/interfaces';
4
4
  import { ResultsService } from 'projects/player/plugins/interactive-plugin/utils/ResultsService';
5
5
  interface UseStateManagerProps {
6
6
  mode: InteractiveMode;
@@ -8,23 +8,27 @@ interface UseStateManagerProps {
8
8
  interactive: Interactive;
9
9
  player: VideoJsPlayer;
10
10
  resultsService?: ResultsService;
11
+ latestSession?: LatestSession;
11
12
  setOpen: (open: boolean) => void;
12
13
  addCue: (timepointId: string) => void;
13
14
  updateCue: (oldTimepointId: string, timepointId: string) => void;
14
15
  removeCue: (visibleAt: number) => void;
15
16
  continueInteractive: () => void;
17
+ moveTimepoint: (newTime: number) => void;
16
18
  }
17
19
  export declare const useStateManager: (props: UseStateManagerProps) => {
18
- _doNotUse: import("../interfaces").InteractiveState;
20
+ state: import("../interfaces").InteractiveState;
19
21
  interaction: Interaction;
20
22
  interactionState: import("../interfaces").InteractionState;
21
23
  timepointState: import("../interfaces").TimepointState;
24
+ nextInteraction: Interaction;
25
+ nextInteractionState: import("../interfaces").InteractionState;
22
26
  skip: () => void;
23
27
  cancel: () => Promise<void>;
24
28
  addAnotherQuestion: () => void;
25
29
  goToTimepoint: (timepointId: string, interactionId: string) => void;
26
30
  discardChanges: (afterDiscard?: () => void) => void;
27
- changeIndex: (interactionIndex: number) => void;
31
+ changeIndex: (interactionIndex: number, prompt?: boolean) => void;
28
32
  promptDelete: (interactionId: string) => void;
29
33
  showTypeSelector: () => void;
30
34
  cancelTypeSelector: () => void;
@@ -32,6 +36,10 @@ export declare const useStateManager: (props: UseStateManagerProps) => {
32
36
  saveInteraction: () => Promise<void>;
33
37
  addInteraction: (typeId: InteractionTypeId) => void;
34
38
  submitInteractionAnswer: () => Promise<void>;
35
- userUpdateInteractionState: (value: import("../interfaces").InteractionState) => void;
39
+ userUpdateInteractionState: (value: import("../interfaces").InteractionState, clear?: boolean) => void;
40
+ updateTimepointTime: (time: number) => void;
41
+ saveTimepoint: () => Promise<void>;
42
+ clearTimepointTimeState: (reset?: boolean) => void;
43
+ reOrderQuestions: (interactions: Interaction[]) => Promise<void>;
36
44
  };
37
45
  export {};
@@ -1,2 +1,49 @@
1
+ import videojs, { VideoJsPlayer } from 'video.js';
2
+ import { HtmlPortalNode } from 'react-reverse-portal';
3
+ import { CurrentUser, Interactive } from 'libs/shared/interfaces';
4
+ import { InteractiveMode, LatestSession } from 'projects/player/plugins/interactive-plugin/interfaces';
5
+ import { ResultsService } from 'projects/player/plugins/interactive-plugin/utils/ResultsService';
6
+ import { ProgressEvent } from 'projects/player/plugins/progress-reporter-plugin/progress-reporter-plugin';
1
7
  import 'projects/player/plugins/interactive-plugin/components/interactive/interactive-component';
8
+ import 'projects/player/plugins/interactive-plugin/components/continue-session/continue-session';
2
9
  import './interactive-plugin-styles.scss';
10
+ declare const Plugin: {
11
+ new (player: VideoJsPlayer, options?: any): videojs.Plugin;
12
+ prototype: videojs.Plugin;
13
+ BASE_PLUGIN_NAME: string;
14
+ deregisterPlugin(name: string): void;
15
+ getPlugin(name: string): any;
16
+ getPluginVersion(name: string): string;
17
+ getPlugins(names?: string[]): {
18
+ [name: string]: videojs.Plugin;
19
+ };
20
+ isBasic(plugin: string | (() => any)): boolean;
21
+ registerPlugin<T, K>(name: string, plugin: (this: VideoJsPlayer, ...options: K[]) => T): (...options: K[]) => T;
22
+ registerPlugin<T_1 extends any>(name: string, plugin: T_1): () => T_1;
23
+ };
24
+ interface InteractivePluginOptions {
25
+ currentUser?: CurrentUser;
26
+ interactive: Interactive;
27
+ mode?: InteractiveMode;
28
+ imageApi?: URL;
29
+ resultsService?: ResultsService;
30
+ questionListPortalNode?: HtmlPortalNode;
31
+ summaryPortalNode?: HtmlPortalNode;
32
+ progress?: ProgressEvent[];
33
+ latestSession?: LatestSession;
34
+ }
35
+ declare class InteractivePlugin extends Plugin {
36
+ private options;
37
+ private continueSession;
38
+ constructor(player: VideoJsPlayer, options: InteractivePluginOptions);
39
+ private initialize;
40
+ private startSession;
41
+ private onTrackLoaded;
42
+ private addChildren;
43
+ }
44
+ declare module 'video.js' {
45
+ interface VideoJsPlayer {
46
+ viewInteractivePlugin(options?: InteractivePluginOptions): InteractivePlugin;
47
+ }
48
+ }
49
+ export {};
@@ -3,7 +3,7 @@ import { CurrentUser, Interaction } from 'libs/shared/interfaces';
3
3
  export interface InteractionProps<T> {
4
4
  interaction: Interaction;
5
5
  state: T;
6
- setState: (value: T) => void;
6
+ setState: (value: T, clear?: boolean) => void;
7
7
  recalculateScroll?: () => void;
8
8
  showFeedback: boolean;
9
9
  optionsPortalNode?: HtmlPortalNode;
@@ -14,7 +14,11 @@ export interface ViewInteractionState extends Omit<InteractionState, 'hasChanges
14
14
  export interface CreateInteractionState extends Omit<InteractionState, 'hasChanges' | 'spinner' | 'submitted'> {
15
15
  }
16
16
  export interface TimepointState {
17
- interactionIndex: number;
17
+ interactionIndex?: number;
18
+ nextInteractionIndex?: number;
19
+ slideIn?: boolean;
20
+ originalVisibleAt?: number;
21
+ hasChanges?: boolean;
18
22
  }
19
23
  export interface InteractiveState {
20
24
  interactions: {
@@ -0,0 +1,11 @@
1
+ export interface LatestSession {
2
+ resultId: string;
3
+ actions: Action[];
4
+ }
5
+ interface Action {
6
+ data: string;
7
+ resultId: string;
8
+ interactionId: string;
9
+ actionableItemId: string;
10
+ }
11
+ export {};
@@ -5,3 +5,4 @@ export * from './SubmissionFunction';
5
5
  export * from './InteractionResult';
6
6
  export * from './ResultSubmission';
7
7
  export * from './InteractiveState';
8
+ export * from './LatestSession';
@@ -1,4 +1,4 @@
1
- import { InteractionState, InteractiveState, TimepointState } from 'projects/player/plugins/interactive-plugin/interfaces';
1
+ import { InteractionState, InteractiveState, LatestSession, TimepointState } from 'projects/player/plugins/interactive-plugin/interfaces';
2
2
  interface InteractionAction {
3
3
  type: 'interaction';
4
4
  id: string;
@@ -9,6 +9,6 @@ interface TimepointAction {
9
9
  id: string;
10
10
  value: TimepointState;
11
11
  }
12
- export declare const initialState: InteractiveState;
12
+ export declare function getInitialState(latestSession: LatestSession): InteractiveState;
13
13
  export declare function interactiveReducer(state: InteractiveState, action: InteractionAction | TimepointAction): InteractiveState;
14
14
  export {};
@@ -13,7 +13,10 @@ export declare class ResultsService {
13
13
  private isConnected;
14
14
  private retryCount;
15
15
  constructor(options: ResultsServiceOptions);
16
- start(): void;
16
+ /**
17
+ * @param resultId Allows you to continue an old interactive session
18
+ */
19
+ start(resultId?: string): void;
17
20
  stop(): Promise<void>;
18
21
  private log;
19
22
  private reconnect;
@@ -1 +1,2 @@
1
+ export declare const SLIDING_TIME = 600;
1
2
  export declare function isNewId(id: string): boolean;
@@ -3,6 +3,7 @@ declare class InteractiveAjaxSingleton {
3
3
  saveInteraction(interaction: Interaction): Promise<void>;
4
4
  deleteInteraction(id: string): Promise<void>;
5
5
  saveTimepoint(timepoint: Timepoint): Promise<void>;
6
+ updateTimepoint(timepoint: Timepoint): Promise<void>;
6
7
  deleteTimepoint(id: string): Promise<void>;
7
8
  }
8
9
  export declare const InteractiveAjax: InteractiveAjaxSingleton;
@@ -21,14 +21,6 @@ declare class NextVideoPlugin extends Plugin {
21
21
  private chapterTrack;
22
22
  private upNextRendered;
23
23
  private upNextTimepoint;
24
- /**
25
- * @Matt These values are intended to be used to render the up next widget
26
- * and to be called when the up next widget is clicked on
27
- * or the video ends.
28
- *
29
- * Note: Cam suggested we check if there is a chapter called "Credits"
30
- * and trigger the up next widget then, rather than in the last 5 seconds
31
- */
32
24
  private nextVideo;
33
25
  private callback;
34
26
  constructor(player: VideoJsPlayer);
@@ -0,0 +1,33 @@
1
+ import videojs, { VideoJsPlayer } from 'video.js';
2
+ declare const Plugin: {
3
+ new (player: VideoJsPlayer, options?: any): videojs.Plugin;
4
+ prototype: videojs.Plugin;
5
+ BASE_PLUGIN_NAME: string;
6
+ deregisterPlugin(name: string): void;
7
+ getPlugin(name: string): any;
8
+ getPluginVersion(name: string): string;
9
+ getPlugins(names?: string[]): {
10
+ [name: string]: videojs.Plugin;
11
+ };
12
+ isBasic(plugin: string | (() => any)): boolean;
13
+ registerPlugin<T, K>(name: string, plugin: (this: VideoJsPlayer, ...options: K[]) => T): (...options: K[]) => T;
14
+ registerPlugin<T_1 extends any>(name: string, plugin: T_1): () => T_1;
15
+ };
16
+ interface PersistQualitySettingsPluginOptions {
17
+ playbackProfile: string;
18
+ playbackProfileLocalCache: string;
19
+ }
20
+ declare class PersistQualitySettingsPlugin extends Plugin {
21
+ private options;
22
+ constructor(player: VideoJsPlayer, options: PersistQualitySettingsPluginOptions);
23
+ private initialize;
24
+ private onQualityLevelsChange;
25
+ private isLocalCacheActive;
26
+ private getStorageKey;
27
+ }
28
+ declare module 'video.js' {
29
+ interface VideoJsPlayer {
30
+ persistQualitySettingsPlugin(options: PersistQualitySettingsPluginOptions): PersistQualitySettingsPlugin;
31
+ }
32
+ }
33
+ export {};
@@ -0,0 +1,38 @@
1
+ import videojs, { VideoJsPlayer } from 'video.js';
2
+ import { SubtitleSizes } from 'projects/player/components/text-track-settings/text-track-settings';
3
+ declare const Plugin: {
4
+ new (player: VideoJsPlayer, options?: any): videojs.Plugin;
5
+ prototype: videojs.Plugin;
6
+ BASE_PLUGIN_NAME: string;
7
+ deregisterPlugin(name: string): void;
8
+ getPlugin(name: string): any;
9
+ getPluginVersion(name: string): string;
10
+ getPlugins(names?: string[]): {
11
+ [name: string]: videojs.Plugin;
12
+ };
13
+ isBasic(plugin: string | (() => any)): boolean;
14
+ registerPlugin<T, K>(name: string, plugin: (this: VideoJsPlayer, ...options: K[]) => T): (...options: K[]) => T;
15
+ registerPlugin<T_1 extends any>(name: string, plugin: T_1): () => T_1;
16
+ };
17
+ interface PersistSubtitleSettingsPluginOptions {
18
+ showSubtitles: boolean;
19
+ subtitleSize: SubtitleSizes;
20
+ }
21
+ declare class PersistSubtitleSettingsPlugin extends Plugin {
22
+ private options;
23
+ private trackGuess;
24
+ constructor(player: VideoJsPlayer, options: PersistSubtitleSettingsPluginOptions);
25
+ private initialize;
26
+ private safeGet;
27
+ private onSelectedLanguageChange;
28
+ private bindEventListeners;
29
+ private onChangeSubtitleSize;
30
+ private guessWhichTrack;
31
+ private getLanguageParts;
32
+ }
33
+ declare module 'video.js' {
34
+ interface VideoJsPlayer {
35
+ persistSubtitleSettingsPlugin(options?: PersistSubtitleSettingsPluginOptions): PersistSubtitleSettingsPlugin;
36
+ }
37
+ }
38
+ export {};
@@ -1,4 +1,5 @@
1
1
  import videojs, { VideoJsPlayer } from 'video.js';
2
+ import './picture-in-picture.scss';
2
3
  declare const Plugin: {
3
4
  new (player: VideoJsPlayer, options?: any): videojs.Plugin;
4
5
  prototype: videojs.Plugin;
@@ -19,15 +20,18 @@ interface PictureInPicturePluginOptions {
19
20
  }
20
21
  declare class PictureInPicturePlugin extends Plugin {
21
22
  private options;
22
- private pictureInPictureEnabled;
23
23
  private playerRequestPictureInPictureFn;
24
24
  private playerExitPictureInPictureFn;
25
+ private playToggle;
26
+ private pictureInPictureEnabled;
25
27
  constructor(player: VideoJsPlayer, options: PictureInPicturePluginOptions);
26
28
  private initialize;
27
29
  private bindFunctions;
28
30
  enablePictureInPicture(): void;
29
31
  disablePictureInPicture(): void;
30
32
  togglePictureInPicture(isInPictureInPicture: boolean): void;
33
+ private addPipStyles;
34
+ private removePipStyles;
31
35
  private requestPictureInPicture;
32
36
  private exitPictureInPicture;
33
37
  private getToggleParentComponent;
@@ -1,3 +1,18 @@
1
+ import videojs, { VideoJsPlayer } from 'video.js';
2
+ declare const Plugin: {
3
+ new (player: VideoJsPlayer, options?: any): videojs.Plugin;
4
+ prototype: videojs.Plugin;
5
+ BASE_PLUGIN_NAME: string;
6
+ deregisterPlugin(name: string): void;
7
+ getPlugin(name: string): any;
8
+ getPluginVersion(name: string): string;
9
+ getPlugins(names?: string[]): {
10
+ [name: string]: videojs.Plugin;
11
+ };
12
+ isBasic(plugin: string | (() => any)): boolean;
13
+ registerPlugin<T, K>(name: string, plugin: (this: VideoJsPlayer, ...options: K[]) => T): (...options: K[]) => T;
14
+ registerPlugin<T_1 extends any>(name: string, plugin: T_1): () => T_1;
15
+ };
1
16
  interface Event {
2
17
  time: number;
3
18
  type: string;
@@ -6,4 +21,48 @@ export interface ProgressEvent {
6
21
  start: Event;
7
22
  end: Event;
8
23
  }
24
+ interface ProgressReporterPluginOptions {
25
+ onFlush: (events: ProgressEvent[]) => void;
26
+ interval?: number;
27
+ }
28
+ declare class ProgressReporterPlugin extends Plugin {
29
+ private options;
30
+ private eventBuffer;
31
+ private latestTime;
32
+ /**
33
+ * Used to clean up data while flushing the buffer
34
+ * It's stored on the instance because it needs to maintain state
35
+ * between buffers.
36
+ */
37
+ private lastPlayingTime;
38
+ private previousLatestTime;
39
+ private isPlaying;
40
+ private isSeeking;
41
+ private hasEnded;
42
+ /**
43
+ * We use our timeupdate event instead of asking for
44
+ * a function to add a single event listener in our options.
45
+ */
46
+ private shouldLogPlayOnTimeUpdate;
47
+ private pauseTimeout;
48
+ constructor(player: VideoJsPlayer, options: ProgressReporterPluginOptions);
49
+ private initialize;
50
+ private validateOptions;
51
+ private bindListeners;
52
+ private startInterval;
53
+ private onPlay;
54
+ private onPause;
55
+ private onTimeUpdate;
56
+ private onSeeking;
57
+ private onEnded;
58
+ private logEvent;
59
+ private shouldUseCarriedOverTime;
60
+ private shouldClearCarriedOverTime;
61
+ private flushBuffer;
62
+ }
63
+ declare module 'video.js' {
64
+ interface VideoJsPlayer {
65
+ progressReporterPlugin(options?: ProgressReporterPluginOptions): ProgressReporterPlugin;
66
+ }
67
+ }
9
68
  export {};
@@ -35,7 +35,7 @@ declare const Component: {
35
35
  new (player: VideoJsPlayer, options?: videojs.ComponentOptions, ready?: videojs.Component.ReadyCallback): videojs.Spacer;
36
36
  prototype: videojs.Spacer;
37
37
  };
38
- getComponent(name: "player" | "Player"): {
38
+ getComponent(name: "Player" | "player"): {
39
39
  new (player: VideoJsPlayer, options?: import("video.js").VideoJsPlayerOptions): VideoJsPlayer;
40
40
  prototype: VideoJsPlayer;
41
41
  getTagSettings(tag: Element): any;
@@ -0,0 +1,53 @@
1
+ import videojs from 'video.js';
2
+ import './drag-handle.scss';
3
+ declare const Component: {
4
+ new (player: import("video.js").VideoJsPlayer, options?: videojs.ComponentOptions, ready?: videojs.Component.ReadyCallback): videojs.Component;
5
+ prototype: videojs.Component;
6
+ getComponent(name: "Button" | "button"): {
7
+ new (player: import("video.js").VideoJsPlayer, options?: videojs.ComponentOptions): videojs.Button;
8
+ prototype: videojs.Button;
9
+ };
10
+ getComponent(name: "ClickableComponent" | "clickablecomponent"): {
11
+ new (player: import("video.js").VideoJsPlayer, options?: videojs.ComponentOptions): videojs.ClickableComponent;
12
+ prototype: videojs.ClickableComponent;
13
+ };
14
+ getComponent(name: "ModalDialog" | "modaldialog"): {
15
+ new (player: import("video.js").VideoJsPlayer, options?: videojs.ModalDialogOptions): videojs.ModalDialog;
16
+ prototype: videojs.ModalDialog;
17
+ };
18
+ getComponent(name: "Menu" | "menu"): {
19
+ new (player: import("video.js").VideoJsPlayer, options?: videojs.MenuOptions): videojs.Menu;
20
+ prototype: videojs.Menu;
21
+ };
22
+ getComponent(name: "MenuButton" | "menubutton"): {
23
+ new (player: import("video.js").VideoJsPlayer, options?: videojs.MenuButtonOptions): videojs.MenuButton;
24
+ prototype: videojs.MenuButton;
25
+ };
26
+ getComponent(name: "MenuItem" | "menuitem"): {
27
+ new (player: import("video.js").VideoJsPlayer, options?: videojs.MenuItemOptions): videojs.MenuItem;
28
+ prototype: videojs.MenuItem;
29
+ };
30
+ getComponent(name: "MouseTimeDisplay" | "mouseTimeDisplay"): {
31
+ new (player: import("video.js").VideoJsPlayer, options?: videojs.ComponentOptions): videojs.MouseTimeDisplay;
32
+ prototype: videojs.MouseTimeDisplay;
33
+ };
34
+ getComponent(name: "Spacer" | "spacer"): {
35
+ new (player: import("video.js").VideoJsPlayer, options?: videojs.ComponentOptions, ready?: videojs.Component.ReadyCallback): videojs.Spacer;
36
+ prototype: videojs.Spacer;
37
+ };
38
+ getComponent(name: "Player" | "player"): {
39
+ new (player: import("video.js").VideoJsPlayer, options?: import("video.js").VideoJsPlayerOptions): import("video.js").VideoJsPlayer;
40
+ prototype: import("video.js").VideoJsPlayer;
41
+ getTagSettings(tag: Element): any;
42
+ };
43
+ getComponent(name: "timeTooltip" | "TimeTooltip"): {
44
+ new (player: import("video.js").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 DragHandle extends Component {
51
+ createEl(): HTMLButtonElement;
52
+ }
53
+ export {};
@@ -0,0 +1,54 @@
1
+ import videojs, { VideoJsPlayer } from 'video.js';
2
+ import './drag-targets.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 DragTargets extends Component {
51
+ constructor(player: VideoJsPlayer, options?: videojs.ComponentOptions);
52
+ private addChildren;
53
+ }
54
+ export {};
@@ -0,0 +1,23 @@
1
+ import { CollapsibleComponent } from 'projects/player/interfaces/CollapsibleComponent';
2
+ import videojs from 'video.js';
3
+ import { WhiteboardModeMenuItem } from './whiteboard-mode-menu-item';
4
+ declare const MenuButton: {
5
+ new (player: import("video.js").VideoJsPlayer, options?: videojs.MenuButtonOptions): videojs.MenuButton;
6
+ prototype: videojs.MenuButton;
7
+ };
8
+ export declare class WhiteboardModeButton extends MenuButton implements CollapsibleComponent {
9
+ createItems(): WhiteboardModeMenuItem[];
10
+ buildWrapperCSSClass(): string;
11
+ /**
12
+ * CollapsibileComponent interface implementation
13
+ * from here onward
14
+ */
15
+ alwaysCollapsed: boolean;
16
+ isCollapsed: boolean;
17
+ isCollabsible: boolean;
18
+ getCollabsibleName(): string;
19
+ getCollabsibleValue(): string;
20
+ showInCollabsibleMenu(): boolean;
21
+ showCollapsibleMenu(): void;
22
+ }
23
+ export {};
@@ -0,0 +1,15 @@
1
+ import videojs, { VideoJsPlayer } from 'video.js';
2
+ import { WhiteboardSide } from '../../interfaces/WhiteboardSide';
3
+ declare const MenuItem: {
4
+ new (player: VideoJsPlayer, options?: videojs.MenuItemOptions): videojs.MenuItem;
5
+ prototype: videojs.MenuItem;
6
+ };
7
+ interface WhiteboardModeMenuItemOptions extends videojs.MenuItemOptions {
8
+ side: WhiteboardSide;
9
+ }
10
+ export declare class WhiteboardModeMenuItem extends MenuItem {
11
+ options_: WhiteboardModeMenuItemOptions;
12
+ constructor(player: VideoJsPlayer, options: WhiteboardModeMenuItemOptions);
13
+ handleClick(): void;
14
+ }
15
+ export {};
@@ -0,0 +1,5 @@
1
+ import { WhiteboardSide } from '../interfaces/WhiteboardSide';
2
+ export declare const WhiteboardSides: WhiteboardSide[];
3
+ export declare const WhiteboardSideNames: {
4
+ [key in WhiteboardSide]: string;
5
+ };