@instructure/studio-player 1.5.2 → 1.5.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.
package/README.md CHANGED
@@ -170,3 +170,12 @@ In order to use the YouTube Education Player, you need to provide an encrypted p
170
170
  YoutubeEducationEncryptor.encrypt_embed_config(media)
171
171
  ```
172
172
  4. Copy the generated encrypted payload and set it as `STORYBOOK_YOUTUBE_ENCRYPTED_PAYLOAD` in your `.env` file.
173
+
174
+ ### Playback directly from Notorious
175
+ 1. First you need to obtain the media id. You can either directly get it from Notorious SiteAdmin or use the Expose Media ID extension in the browser.
176
+ 2. Once you have the media id, you can generate a playback url by running the following command in notorious web rails console:
177
+ ```ruby
178
+ media = Media.find_by_public_guid("<MEDIA_ID>")
179
+ media.original.transcodings.first.drm_playback_url
180
+ ```
181
+ 3. Use the generated playback url as the `src`.
@@ -1,2 +1,2 @@
1
1
  import { StudioPlayerProps } from './StudioPlayer.types';
2
- export declare function StudioPlayer({ title, playerRef, src, captions, thumbnail, hideFullScreen, comments, locale, annotations, quizMarkers, interactive, onAnnotationClick, onQuizMarkerClick, onQuizMarkerShow, onInteractivePinClick, onPlayerSizeChange, onCaptionsDelete, interactiveMenuElements, kebabMenuElements, darkMode, autoLoadCaptionSrc, forceComments, disableCaptionSettings, disableStorage, startAt, crossOrigin, captionOffsetOverride, disableInteractivePinRanges, customOverlay, controlsLayout, hideQuizMarkers, ytPfEduEncryptedPayload, enableSidebar, lockSpeed, tabs, openSidebar, emptyTranscriptsComponent, rollingTranscriptElement, transcriptMenuElements, }: StudioPlayerProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function StudioPlayer({ title, playerRef, src, captions, thumbnail, hideFullScreen, comments, locale, annotations, quizMarkers, interactive, onAnnotationClick, onQuizMarkerClick, onQuizMarkerShow, onInteractivePinClick, onPlayerSizeChange, onCaptionsDelete, interactiveMenuElements, kebabMenuElements, darkMode, autoLoadCaptionSrc, forceComments, disableCaptionSettings, disableStorage, startAt, crossOrigin, captionOffsetOverride, disableInteractivePinRanges, customOverlay, controlsLayout, hideQuizMarkers, ytPfEduEncryptedPayload, enableSidebar, lockSpeed, tabs, openSidebar, emptyTranscriptsComponent, rollingTranscriptElement, transcriptMenuElements, displayAsrCaptions, }: StudioPlayerProps): import("react/jsx-runtime").JSX.Element;
@@ -52,4 +52,5 @@ export type StudioPlayerProps = {
52
52
  emptyTranscriptsComponent?: ReactNode;
53
53
  rollingTranscriptElement?: string | HTMLElement | null;
54
54
  transcriptMenuElements?: TranscriptMenuElement[];
55
+ displayAsrCaptions?: boolean;
55
56
  };
@@ -0,0 +1,13 @@
1
+ import { MediaPlayerProps } from '@vidstack/react';
2
+ import { CaptionMetaData } from '../../types';
3
+ type UseCaptionsProps = {
4
+ src: MediaPlayerProps['src'];
5
+ captions: CaptionMetaData[];
6
+ locale: string;
7
+ displayAsrCaptions: boolean;
8
+ };
9
+ export declare function useCaptions({ src, captions, locale, displayAsrCaptions, }: UseCaptionsProps): {
10
+ allCaptions: CaptionMetaData[];
11
+ setDynamicYoutubeCaptions: import('react').Dispatch<import('react').SetStateAction<CaptionMetaData[]>>;
12
+ };
13
+ export {};
@@ -0,0 +1,5 @@
1
+ import { MediaPlayerProps } from '@vidstack/react';
2
+ import { CaptionMetaData } from '../../../types';
3
+ type TranslationFunction = (key: string, params?: Record<string, unknown>) => string;
4
+ export declare const extractNotoriousCaptionsFromMediaSource: (src: MediaPlayerProps["src"], locale: string, i18n: TranslationFunction) => CaptionMetaData[];
5
+ export {};
@@ -0,0 +1,151 @@
1
+ const t = "Action", n = "Add annotation at {{time}}", o = "Add question at {{time}}", e = "Annotations", s = "Auto", c = "Auto ({{quality}})", E = "Back", A = "Captions", a = "Disable Captions", T = "Enable Captions", O = "Caption Language", _ = "Manage Captions", S = "Delete {{language}}", N = "Font Size", C = "Caption Language: {{language}}", P = "{{language}} (automatic)", L = "Clear Search", i = "Close", I = "Comments", R = "Continue", r = "Decrease Playback Speed", u = "Decrease Volume by {{percent}}%", U = "Down Arrow", l = "Enable Autoscroll", p = "Enter Fullscreen", D = "Exit Fullscreen", g = "Increase Playback Speed", M = "Increase Volume by {{percent}}%", d = "Invert Colors", G = "Jump to specific percentage (1-10%, 2-20%, etc)", m = "Jump to Start", B = "Actions for {{title}}", b = "Keyboard Shortcuts", y = "Language", V = "Left Arrow", K = "Main Menu", Y = "Mute", k = "Muted", F = "Next Caption Language", H = "Next Hit", Q = "Off", f = "On Top", w = "Open annotation at {{time}}", W = "Open completed quiz at {{time}}", h = "Open quiz at {{time}}", x = "Pause", q = "Play", v = "Playback Speed", J = "Playback Speed: {{speed}}x", z = "Previous Caption Language", X = "Previous Hit", Z = "Quality", j = "Quality Menu", $ = "Replay", tt = "Reset Playback Speed", nt = "Right Arrow", ot = "Search in transcript", et = "Seek backward: {{seconds}} seconds", st = "Seek forward: {{seconds}} seconds", ct = "Settings", Et = "Shortcut", At = "Close Sidebar", at = "Open Sidebar", Tt = "Space", Ot = "Playback speed menu", _t = "Toggle Captions", St = "Toggle Muted", Nt = "Toggle Play/Pause", Ct = "Transcript Options", Pt = "Up Arrow", Lt = "Video Settings", it = "Volume", It = "Volume: {{volume}}%", Rt = {
2
+ ACTION: t,
3
+ ADD_ANNOTATION_AT: n,
4
+ ADD_QUESTION_AT: o,
5
+ ANNOTATIONS: e,
6
+ AUTO: s,
7
+ AUTO_QUALITY: c,
8
+ BACK: E,
9
+ CAPTIONS: A,
10
+ CAPTIONS_DISABLE: a,
11
+ CAPTIONS_ENABLE: T,
12
+ CAPTIONS_LANGUAGE: O,
13
+ CAPTIONS_MANAGE: _,
14
+ CAPTION_DELETE: S,
15
+ CAPTION_FONT_SIZE: N,
16
+ CAPTION_LANGUAGE: C,
17
+ CAPTION_LANGUAGE_AUTOMATIC: P,
18
+ CLEAR_SEARCH: L,
19
+ CLOSE: i,
20
+ COMMENTS: I,
21
+ CONTINUE: R,
22
+ DECREASE_PLAYBACK_SPEED: r,
23
+ DECREASE_VOLUME: u,
24
+ DOWN_ARROW: U,
25
+ ENABLE_AUTOSCROLL: l,
26
+ ENTER_FULLSCREEN: p,
27
+ EXIT_FULLSCREEN: D,
28
+ INCREASE_PLAYBACK_SPEED: g,
29
+ INCREASE_VOLUME: M,
30
+ INVERT_COLORS: d,
31
+ JUMP_TO_PERCENTAGE: G,
32
+ JUMP_TO_START: m,
33
+ KEBAB_MENU: B,
34
+ KEYBOARD_SHORTCUTS: b,
35
+ LANGUAGE: y,
36
+ LEFT_ARROW: V,
37
+ MAIN_MENU: K,
38
+ MUTE: Y,
39
+ MUTED: k,
40
+ NEXT_CAPTION_LANGUAGE: F,
41
+ NEXT_HIT: H,
42
+ OFF: Q,
43
+ ON_TOP: f,
44
+ OPEN_ANNOTATION_AT: w,
45
+ OPEN_COMPLETED_QUIZ_AT: W,
46
+ OPEN_QUIZ_AT: h,
47
+ PAUSE: x,
48
+ PLAY: q,
49
+ PLAYBACK_SPEED: v,
50
+ PLAYBACK_SPEED_MESSAGE: J,
51
+ PREVIOUS_CAPTION_LANGUAGE: z,
52
+ PREVIOUS_HIT: X,
53
+ QUALITY: Z,
54
+ QUALITY_MENU: j,
55
+ REPLAY: $,
56
+ RESET_PLAYBACK_SPEED: tt,
57
+ RIGHT_ARROW: nt,
58
+ SEARCH_TRANSCRIPT_PLACEHOLDER: ot,
59
+ SEEK_BACKWARD: et,
60
+ SEEK_FORWARD: st,
61
+ SETTINGS: ct,
62
+ SHORTCUT: Et,
63
+ SIDEBAR_CLOSE: At,
64
+ SIDEBAR_OPEN: at,
65
+ SPACE: Tt,
66
+ SPEED_MENU: Ot,
67
+ TOGGLE_CAPTIONS: _t,
68
+ TOGGLE_MUTED: St,
69
+ TOGGLE_PLAY_PAUSE: Nt,
70
+ TRANSCRIPT_OPTIONS: Ct,
71
+ UP_ARROW: Pt,
72
+ VIDEO_SETTINGS: Lt,
73
+ VOLUME: it,
74
+ VOLUME_VALUE: It
75
+ };
76
+ export {
77
+ t as ACTION,
78
+ n as ADD_ANNOTATION_AT,
79
+ o as ADD_QUESTION_AT,
80
+ e as ANNOTATIONS,
81
+ s as AUTO,
82
+ c as AUTO_QUALITY,
83
+ E as BACK,
84
+ A as CAPTIONS,
85
+ a as CAPTIONS_DISABLE,
86
+ T as CAPTIONS_ENABLE,
87
+ O as CAPTIONS_LANGUAGE,
88
+ _ as CAPTIONS_MANAGE,
89
+ S as CAPTION_DELETE,
90
+ N as CAPTION_FONT_SIZE,
91
+ C as CAPTION_LANGUAGE,
92
+ P as CAPTION_LANGUAGE_AUTOMATIC,
93
+ L as CLEAR_SEARCH,
94
+ i as CLOSE,
95
+ I as COMMENTS,
96
+ R as CONTINUE,
97
+ r as DECREASE_PLAYBACK_SPEED,
98
+ u as DECREASE_VOLUME,
99
+ U as DOWN_ARROW,
100
+ l as ENABLE_AUTOSCROLL,
101
+ p as ENTER_FULLSCREEN,
102
+ D as EXIT_FULLSCREEN,
103
+ g as INCREASE_PLAYBACK_SPEED,
104
+ M as INCREASE_VOLUME,
105
+ d as INVERT_COLORS,
106
+ G as JUMP_TO_PERCENTAGE,
107
+ m as JUMP_TO_START,
108
+ B as KEBAB_MENU,
109
+ b as KEYBOARD_SHORTCUTS,
110
+ y as LANGUAGE,
111
+ V as LEFT_ARROW,
112
+ K as MAIN_MENU,
113
+ Y as MUTE,
114
+ k as MUTED,
115
+ F as NEXT_CAPTION_LANGUAGE,
116
+ H as NEXT_HIT,
117
+ Q as OFF,
118
+ f as ON_TOP,
119
+ w as OPEN_ANNOTATION_AT,
120
+ W as OPEN_COMPLETED_QUIZ_AT,
121
+ h as OPEN_QUIZ_AT,
122
+ x as PAUSE,
123
+ q as PLAY,
124
+ v as PLAYBACK_SPEED,
125
+ J as PLAYBACK_SPEED_MESSAGE,
126
+ z as PREVIOUS_CAPTION_LANGUAGE,
127
+ X as PREVIOUS_HIT,
128
+ Z as QUALITY,
129
+ j as QUALITY_MENU,
130
+ $ as REPLAY,
131
+ tt as RESET_PLAYBACK_SPEED,
132
+ nt as RIGHT_ARROW,
133
+ ot as SEARCH_TRANSCRIPT_PLACEHOLDER,
134
+ et as SEEK_BACKWARD,
135
+ st as SEEK_FORWARD,
136
+ ct as SETTINGS,
137
+ Et as SHORTCUT,
138
+ At as SIDEBAR_CLOSE,
139
+ at as SIDEBAR_OPEN,
140
+ Tt as SPACE,
141
+ Ot as SPEED_MENU,
142
+ _t as TOGGLE_CAPTIONS,
143
+ St as TOGGLE_MUTED,
144
+ Nt as TOGGLE_PLAY_PAUSE,
145
+ Ct as TRANSCRIPT_OPTIONS,
146
+ Pt as UP_ARROW,
147
+ Lt as VIDEO_SETTINGS,
148
+ it as VOLUME,
149
+ It as VOLUME_VALUE,
150
+ Rt as default
151
+ };