@brightcove/components-embed-code-modal 1.0.7 → 1.0.8
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/.eslintignore +7 -0
- package/.eslintrc +23 -0
- package/.github/workflows/ci.yml +23 -0
- package/.husky/pre-commit +4 -0
- package/.nvmrc +1 -0
- package/.prettierignore +7 -0
- package/.prettierrc +5 -0
- package/.release-it.json +40 -0
- package/.whitesource +3 -0
- package/CHANGELOG.md +387 -0
- package/CODEOWNERS +37 -0
- package/PULL_REQUEST_TEMPLATE.md +17 -0
- package/__tests__/EmbedCode.test.tsx +51 -0
- package/__tests__/InteractivityProject.test.tsx +50 -0
- package/__tests__/PlayerPreview.test.tsx +23 -0
- package/__tests__/TabsHeader.test.tsx +19 -0
- package/__tests__/TabsSection.test.tsx +46 -0
- package/__tests__/TitleWithTooltip.test.tsx +45 -0
- package/__tests__/VideoPlayer.test.tsx +38 -0
- package/__tests__/embedCodeGenerator.test.ts +111 -0
- package/__tests__/util.test.ts +89 -0
- package/babel.config.json +17 -0
- package/build/README.md +109 -0
- package/build/package.json +100 -0
- package/etc/wildcard.brightcove.com.key +27 -0
- package/etc/wildcard.brightcove.com.pem +96 -0
- package/jest/jest.setup.js +62 -0
- package/jest/jest.stub.js +4 -0
- package/jest.config.js +24 -0
- package/package.json +15 -5
- package/scripts/create-dist-pkg-prod.js +18 -0
- package/src/index.ts +17 -0
- package/src/js/EmbedCodeModal.tsx +105 -0
- package/src/js/components/CustomSettingsDropdown.tsx +184 -0
- package/src/js/components/EmbedCopySection.tsx +130 -0
- package/src/js/components/ModalContainer.tsx +367 -0
- package/src/js/components/NoPlayerModal.tsx +42 -0
- package/src/js/components/PlayerPreview.tsx +116 -0
- package/src/js/components/TabsHeader.tsx +31 -0
- package/src/js/components/TabsSection.tsx +74 -0
- package/src/js/components/TitleWithTooltip.tsx +39 -0
- package/src/js/components/VideoLinks.tsx +83 -0
- package/src/js/components/VideoPlayer.tsx +324 -0
- package/src/js/components/index.ts +9 -0
- package/src/js/components/prism/PrismLiveModal.tsx +162 -0
- package/src/js/components/prism/PrismPlayerControls.tsx +343 -0
- package/src/js/components/prism/PrismPlayerPreview.tsx +98 -0
- package/src/js/components/prism/index.ts +3 -0
- package/src/js/constants/baseUrls.ts +4 -0
- package/src/js/constants/embed.ts +12 -0
- package/src/js/constants/player.ts +32 -0
- package/src/js/constants/pluginsRegistry.ts +30 -0
- package/src/js/hooks/useGetPlayers.ts +12 -0
- package/src/js/i18n.ts +43 -0
- package/src/js/services/players-api.ts +26 -0
- package/src/js/services/url-shortener.ts +10 -0
- package/src/js/types/EmbedCodeModalProps.ts +72 -0
- package/src/js/types/EmbedCodeProps.ts +13 -0
- package/src/js/types/brightcoveEmbedCode.d.ts +18 -0
- package/src/js/types/players.ts +64 -0
- package/src/js/types/react-i18next.d.ts +8 -0
- package/src/js/types/studioModule.ts +7 -0
- package/src/js/utils/addPluginsDataToPlayers.ts +59 -0
- package/src/js/utils/call.ts +31 -0
- package/src/js/utils/dimensions.ts +53 -0
- package/src/js/utils/embedCodeGenerator.ts +120 -0
- package/src/js/utils/featureSwitches.ts +16 -0
- package/src/js/utils/util.ts +153 -0
- package/src/module.tsx +280 -0
- package/src/styles/CustomSettingsDropdown.sass +42 -0
- package/src/styles/EmbedCode.sass +30 -0
- package/src/styles/EmbedCodeModal.sass +76 -0
- package/src/styles/base.sass +1 -0
- package/src/styles/prism/PrismLiveModal.sass +155 -0
- package/src/styles/theme.sass +11 -0
- package/src/styles/typings.td.ts +9 -0
- package/src/translations/en.json +61 -0
- package/src/translations/es.json +61 -0
- package/src/translations/fr.json +61 -0
- package/src/translations/ja.json +61 -0
- package/src/translations/ko.json +61 -0
- package/src/translations/zh.json +61 -0
- package/src/types/studio.ts +197 -0
- package/tsconfig.json +34 -0
- package/webpack.config.js +117 -0
- /package/{__tests__ → build/__tests__}/EmbedCode.test.d.ts +0 -0
- /package/{__tests__ → build/__tests__}/EmbedCode.test.d.ts.map +0 -0
- /package/{__tests__ → build/__tests__}/InteractivityProject.test.d.ts +0 -0
- /package/{__tests__ → build/__tests__}/InteractivityProject.test.d.ts.map +0 -0
- /package/{__tests__ → build/__tests__}/PlayerPreview.test.d.ts +0 -0
- /package/{__tests__ → build/__tests__}/PlayerPreview.test.d.ts.map +0 -0
- /package/{__tests__ → build/__tests__}/TabsHeader.test.d.ts +0 -0
- /package/{__tests__ → build/__tests__}/TabsHeader.test.d.ts.map +0 -0
- /package/{__tests__ → build/__tests__}/TabsSection.test.d.ts +0 -0
- /package/{__tests__ → build/__tests__}/TabsSection.test.d.ts.map +0 -0
- /package/{__tests__ → build/__tests__}/TitleWithTooltip.test.d.ts +0 -0
- /package/{__tests__ → build/__tests__}/TitleWithTooltip.test.d.ts.map +0 -0
- /package/{__tests__ → build/__tests__}/VideoPlayer.test.d.ts +0 -0
- /package/{__tests__ → build/__tests__}/VideoPlayer.test.d.ts.map +0 -0
- /package/{__tests__ → build/__tests__}/embedCodeGenerator.test.d.ts +0 -0
- /package/{__tests__ → build/__tests__}/embedCodeGenerator.test.d.ts.map +0 -0
- /package/{__tests__ → build/__tests__}/util.test.d.ts +0 -0
- /package/{__tests__ → build/__tests__}/util.test.d.ts.map +0 -0
- /package/{index.js → build/index.js} +0 -0
- /package/{index.js.map → build/index.js.map} +0 -0
- /package/{src → build/src}/index.d.ts +0 -0
- /package/{src → build/src}/index.d.ts.map +0 -0
- /package/{src → build/src}/js/EmbedCodeModal.d.ts +0 -0
- /package/{src → build/src}/js/EmbedCodeModal.d.ts.map +0 -0
- /package/{src → build/src}/js/components/CustomSettingsDropdown.d.ts +0 -0
- /package/{src → build/src}/js/components/CustomSettingsDropdown.d.ts.map +0 -0
- /package/{src → build/src}/js/components/EmbedCopySection.d.ts +0 -0
- /package/{src → build/src}/js/components/EmbedCopySection.d.ts.map +0 -0
- /package/{src → build/src}/js/components/ModalContainer.d.ts +0 -0
- /package/{src → build/src}/js/components/ModalContainer.d.ts.map +0 -0
- /package/{src → build/src}/js/components/NoPlayerModal.d.ts +0 -0
- /package/{src → build/src}/js/components/NoPlayerModal.d.ts.map +0 -0
- /package/{src → build/src}/js/components/PlayerPreview.d.ts +0 -0
- /package/{src → build/src}/js/components/PlayerPreview.d.ts.map +0 -0
- /package/{src → build/src}/js/components/TabsHeader.d.ts +0 -0
- /package/{src → build/src}/js/components/TabsHeader.d.ts.map +0 -0
- /package/{src → build/src}/js/components/TabsSection.d.ts +0 -0
- /package/{src → build/src}/js/components/TabsSection.d.ts.map +0 -0
- /package/{src → build/src}/js/components/TitleWithTooltip.d.ts +0 -0
- /package/{src → build/src}/js/components/TitleWithTooltip.d.ts.map +0 -0
- /package/{src → build/src}/js/components/VideoLinks.d.ts +0 -0
- /package/{src → build/src}/js/components/VideoLinks.d.ts.map +0 -0
- /package/{src → build/src}/js/components/VideoPlayer.d.ts +0 -0
- /package/{src → build/src}/js/components/VideoPlayer.d.ts.map +0 -0
- /package/{src → build/src}/js/components/index.d.ts +0 -0
- /package/{src → build/src}/js/components/index.d.ts.map +0 -0
- /package/{src → build/src}/js/components/prism/PrismLiveModal.d.ts +0 -0
- /package/{src → build/src}/js/components/prism/PrismLiveModal.d.ts.map +0 -0
- /package/{src → build/src}/js/components/prism/PrismPlayerControls.d.ts +0 -0
- /package/{src → build/src}/js/components/prism/PrismPlayerControls.d.ts.map +0 -0
- /package/{src → build/src}/js/components/prism/PrismPlayerPreview.d.ts +0 -0
- /package/{src → build/src}/js/components/prism/PrismPlayerPreview.d.ts.map +0 -0
- /package/{src → build/src}/js/components/prism/index.d.ts +0 -0
- /package/{src → build/src}/js/components/prism/index.d.ts.map +0 -0
- /package/{src → build/src}/js/constants/baseUrls.d.ts +0 -0
- /package/{src → build/src}/js/constants/baseUrls.d.ts.map +0 -0
- /package/{src → build/src}/js/constants/embed.d.ts +0 -0
- /package/{src → build/src}/js/constants/embed.d.ts.map +0 -0
- /package/{src → build/src}/js/constants/player.d.ts +0 -0
- /package/{src → build/src}/js/constants/player.d.ts.map +0 -0
- /package/{src → build/src}/js/constants/pluginsRegistry.d.ts +0 -0
- /package/{src → build/src}/js/constants/pluginsRegistry.d.ts.map +0 -0
- /package/{src → build/src}/js/hooks/useGetPlayers.d.ts +0 -0
- /package/{src → build/src}/js/hooks/useGetPlayers.d.ts.map +0 -0
- /package/{src → build/src}/js/i18n.d.ts +0 -0
- /package/{src → build/src}/js/i18n.d.ts.map +0 -0
- /package/{src → build/src}/js/services/players-api.d.ts +0 -0
- /package/{src → build/src}/js/services/players-api.d.ts.map +0 -0
- /package/{src → build/src}/js/services/url-shortener.d.ts +0 -0
- /package/{src → build/src}/js/services/url-shortener.d.ts.map +0 -0
- /package/{src → build/src}/js/types/EmbedCodeModalProps.d.ts +0 -0
- /package/{src → build/src}/js/types/EmbedCodeModalProps.d.ts.map +0 -0
- /package/{src → build/src}/js/types/EmbedCodeProps.d.ts +0 -0
- /package/{src → build/src}/js/types/EmbedCodeProps.d.ts.map +0 -0
- /package/{src → build/src}/js/types/players.d.ts +0 -0
- /package/{src → build/src}/js/types/players.d.ts.map +0 -0
- /package/{src → build/src}/js/types/studioModule.d.ts +0 -0
- /package/{src → build/src}/js/types/studioModule.d.ts.map +0 -0
- /package/{src → build/src}/js/utils/addPluginsDataToPlayers.d.ts +0 -0
- /package/{src → build/src}/js/utils/addPluginsDataToPlayers.d.ts.map +0 -0
- /package/{src → build/src}/js/utils/call.d.ts +0 -0
- /package/{src → build/src}/js/utils/call.d.ts.map +0 -0
- /package/{src → build/src}/js/utils/dimensions.d.ts +0 -0
- /package/{src → build/src}/js/utils/dimensions.d.ts.map +0 -0
- /package/{src → build/src}/js/utils/embedCodeGenerator.d.ts +0 -0
- /package/{src → build/src}/js/utils/embedCodeGenerator.d.ts.map +0 -0
- /package/{src → build/src}/js/utils/featureSwitches.d.ts +0 -0
- /package/{src → build/src}/js/utils/featureSwitches.d.ts.map +0 -0
- /package/{src → build/src}/js/utils/util.d.ts +0 -0
- /package/{src → build/src}/js/utils/util.d.ts.map +0 -0
- /package/{src → build/src}/module.d.ts +0 -0
- /package/{src → build/src}/module.d.ts.map +0 -0
- /package/{src → build/src}/styles/typings.td.d.ts +0 -0
- /package/{src → build/src}/styles/typings.td.d.ts.map +0 -0
- /package/{src → build/src}/types/studio.d.ts +0 -0
- /package/{src → build/src}/types/studio.d.ts.map +0 -0
package/src/module.tsx
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
initialize,
|
|
6
|
+
Button,
|
|
7
|
+
Select,
|
|
8
|
+
Input,
|
|
9
|
+
Flex,
|
|
10
|
+
Checkbox,
|
|
11
|
+
} from '@brightcove/studio-components';
|
|
12
|
+
|
|
13
|
+
import { StudioModule } from 'types/studio';
|
|
14
|
+
import { EmbedCodeModal } from './index';
|
|
15
|
+
import {
|
|
16
|
+
VideoPayload,
|
|
17
|
+
EmbedCodeModalTypes,
|
|
18
|
+
EmbedCodeUnits,
|
|
19
|
+
EmbedCodeAspectRatio,
|
|
20
|
+
} from 'js/types/EmbedCodeModalProps';
|
|
21
|
+
import { EmbedCodeModalProps } from 'js/EmbedCodeModal';
|
|
22
|
+
|
|
23
|
+
const videoObj: VideoPayload = {
|
|
24
|
+
videoId: '70709819045202', // string
|
|
25
|
+
videoName: 'Media Title', // string
|
|
26
|
+
accountId: '70712710456202', // string
|
|
27
|
+
posterUrl: 'http://...', // string
|
|
28
|
+
duration: 120, // number (in seconds)
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type LangType = 'en' | 'es' | 'fr' | 'ja' | 'ko' | 'zh';
|
|
32
|
+
type ThemeType = 'blueSteel' | 'prism';
|
|
33
|
+
|
|
34
|
+
const appNode = document.getElementById('bc-content');
|
|
35
|
+
let root: ReturnType<typeof createRoot> | null = null;
|
|
36
|
+
|
|
37
|
+
const App = () => {
|
|
38
|
+
const [language, setLanguage] = useState<LangType>('en');
|
|
39
|
+
const [theme, setTheme] = useState<ThemeType>('blueSteel');
|
|
40
|
+
const [accountId, setAccountId] = useState('70713602761202');
|
|
41
|
+
const [videoId, setVideoId] = useState('70716855695113');
|
|
42
|
+
const [interactivityProjectId, setInteractivityProjectId] = useState(
|
|
43
|
+
'63ed6c0cf2b60d00179ec101',
|
|
44
|
+
);
|
|
45
|
+
const [embedProperties, setEmbedProperties] = useState({
|
|
46
|
+
units: EmbedCodeUnits.PX,
|
|
47
|
+
responsive: false,
|
|
48
|
+
width: 0,
|
|
49
|
+
height: 0,
|
|
50
|
+
aspectRatio: EmbedCodeAspectRatio.FLUID,
|
|
51
|
+
});
|
|
52
|
+
const [embedVideoObj, setEmbedVideoObj] = useState<EmbedCodeModalProps>();
|
|
53
|
+
const [showDVR, setShowDVR] = useState(false);
|
|
54
|
+
const [showLowLatency, setShowLowLatency] = useState(false);
|
|
55
|
+
const [showSSAI, setShowSSAI] = useState(false);
|
|
56
|
+
|
|
57
|
+
const handlePropertiesUpdate = (name: string, value: string) => {
|
|
58
|
+
setEmbedProperties({
|
|
59
|
+
...embedProperties,
|
|
60
|
+
[name]: value,
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<div style={{ padding: 20 }}>
|
|
66
|
+
<h1> Embed Code Sandbox demo </h1>
|
|
67
|
+
<h5>
|
|
68
|
+
{' '}
|
|
69
|
+
Use the url params to select environment. Ex. `env=production`. <br />{' '}
|
|
70
|
+
Default is `qa`
|
|
71
|
+
</h5>
|
|
72
|
+
<h5> Select component`s language </h5>
|
|
73
|
+
<Select
|
|
74
|
+
value={language}
|
|
75
|
+
options={[
|
|
76
|
+
{ label: 'English', value: 'en' },
|
|
77
|
+
{ label: 'Spanish', value: 'es' },
|
|
78
|
+
{ label: 'French', value: 'fr' },
|
|
79
|
+
{ label: 'Japanese', value: 'ja' },
|
|
80
|
+
{ label: 'Korean', value: 'ko' },
|
|
81
|
+
{ label: 'Chinese', value: 'zh' },
|
|
82
|
+
]}
|
|
83
|
+
onChange={(value: LangType) => {
|
|
84
|
+
setLanguage(value);
|
|
85
|
+
}}
|
|
86
|
+
/>
|
|
87
|
+
<h5> Select theme </h5>
|
|
88
|
+
<Select
|
|
89
|
+
value={theme}
|
|
90
|
+
options={[
|
|
91
|
+
{ label: 'Blue Steel', value: 'blueSteel' },
|
|
92
|
+
{ label: 'Prism', value: 'prism' },
|
|
93
|
+
]}
|
|
94
|
+
onChange={(value: ThemeType) => {
|
|
95
|
+
setTheme(value);
|
|
96
|
+
}}
|
|
97
|
+
/>
|
|
98
|
+
<h5>
|
|
99
|
+
Enter a valid account ID and video ID. Keep in mind the environment
|
|
100
|
+
</h5>
|
|
101
|
+
<Flex gap='sm'>
|
|
102
|
+
<Input
|
|
103
|
+
label='BC account ID'
|
|
104
|
+
value={accountId}
|
|
105
|
+
onChange={(value: string) => {
|
|
106
|
+
setAccountId(value);
|
|
107
|
+
}}
|
|
108
|
+
/>
|
|
109
|
+
<Input
|
|
110
|
+
label='Video ID'
|
|
111
|
+
value={videoId}
|
|
112
|
+
onChange={(value: string) => {
|
|
113
|
+
setVideoId(value);
|
|
114
|
+
}}
|
|
115
|
+
/>
|
|
116
|
+
<Input
|
|
117
|
+
label='Project ID'
|
|
118
|
+
value={interactivityProjectId}
|
|
119
|
+
onChange={(value: string) => {
|
|
120
|
+
setInteractivityProjectId(value);
|
|
121
|
+
}}
|
|
122
|
+
/>
|
|
123
|
+
</Flex>
|
|
124
|
+
<h4>Optional properties for the embed code</h4>
|
|
125
|
+
<br />
|
|
126
|
+
<Flex gap='sm' alignItems='center'>
|
|
127
|
+
<Select
|
|
128
|
+
label='Units'
|
|
129
|
+
value={embedProperties.units}
|
|
130
|
+
options={[
|
|
131
|
+
{ label: 'px', value: EmbedCodeUnits.PX },
|
|
132
|
+
{ label: 'em', value: EmbedCodeUnits.EM },
|
|
133
|
+
{ label: '%', value: EmbedCodeUnits.PERCENT },
|
|
134
|
+
]}
|
|
135
|
+
onChange={(value: string) => handlePropertiesUpdate('units', value)}
|
|
136
|
+
/>
|
|
137
|
+
<Input
|
|
138
|
+
label='Width'
|
|
139
|
+
type='number'
|
|
140
|
+
value={embedProperties.width}
|
|
141
|
+
onChange={(value: string) => handlePropertiesUpdate('width', value)}
|
|
142
|
+
/>
|
|
143
|
+
<Input
|
|
144
|
+
label='Height'
|
|
145
|
+
type='number'
|
|
146
|
+
value={embedProperties.height}
|
|
147
|
+
onChange={(value: string) => handlePropertiesUpdate('height', value)}
|
|
148
|
+
/>
|
|
149
|
+
<Select
|
|
150
|
+
label='Aspect ratio'
|
|
151
|
+
value={embedProperties.aspectRatio}
|
|
152
|
+
options={[
|
|
153
|
+
{ label: 'fluid', value: EmbedCodeAspectRatio.FLUID },
|
|
154
|
+
{ label: '1:1', value: EmbedCodeAspectRatio.ONE_ONE },
|
|
155
|
+
{ label: '4:3', value: EmbedCodeAspectRatio.FOUR_THREE },
|
|
156
|
+
{ label: '16:9', value: EmbedCodeAspectRatio.SIXTEEN_NINE },
|
|
157
|
+
{ label: '9:16', value: EmbedCodeAspectRatio.NINE_SIXTEEN },
|
|
158
|
+
]}
|
|
159
|
+
onChange={(value: string) =>
|
|
160
|
+
handlePropertiesUpdate('aspectRatio', value)
|
|
161
|
+
}
|
|
162
|
+
/>
|
|
163
|
+
<Checkbox onChange={setShowDVR} checked={showDVR}>
|
|
164
|
+
<strong>Show DVR</strong>
|
|
165
|
+
</Checkbox>
|
|
166
|
+
<Checkbox onChange={setShowLowLatency} checked={showLowLatency}>
|
|
167
|
+
<strong>Show Low Latency</strong>
|
|
168
|
+
</Checkbox>
|
|
169
|
+
<Checkbox onChange={setShowSSAI} checked={showSSAI}>
|
|
170
|
+
<strong>Show Ad Configuration</strong>
|
|
171
|
+
</Checkbox>
|
|
172
|
+
</Flex>
|
|
173
|
+
<Button
|
|
174
|
+
text='Show Modal Video'
|
|
175
|
+
onClick={() => {
|
|
176
|
+
setEmbedVideoObj({
|
|
177
|
+
data: { ...videoObj, videoId, accountId },
|
|
178
|
+
embedCodeModalType: EmbedCodeModalTypes.VIDEO,
|
|
179
|
+
language,
|
|
180
|
+
theme,
|
|
181
|
+
});
|
|
182
|
+
}}
|
|
183
|
+
large
|
|
184
|
+
/>
|
|
185
|
+
<Button
|
|
186
|
+
text='Show Modal Player'
|
|
187
|
+
onClick={() => {
|
|
188
|
+
setEmbedVideoObj({
|
|
189
|
+
data: { id: 'default', accountId },
|
|
190
|
+
embedCodeModalType: EmbedCodeModalTypes.PLAYER,
|
|
191
|
+
language: language,
|
|
192
|
+
theme,
|
|
193
|
+
});
|
|
194
|
+
}}
|
|
195
|
+
large
|
|
196
|
+
/>
|
|
197
|
+
<Button
|
|
198
|
+
text='Show Modal Project'
|
|
199
|
+
onClick={() => {
|
|
200
|
+
setEmbedVideoObj({
|
|
201
|
+
data: {
|
|
202
|
+
accountId,
|
|
203
|
+
videoId,
|
|
204
|
+
interactivityProjectId,
|
|
205
|
+
interactivityProjectName: 'My Project Name',
|
|
206
|
+
},
|
|
207
|
+
embedCodeModalType: EmbedCodeModalTypes.PROJECT,
|
|
208
|
+
language: language,
|
|
209
|
+
theme,
|
|
210
|
+
});
|
|
211
|
+
}}
|
|
212
|
+
large
|
|
213
|
+
/>
|
|
214
|
+
<Button
|
|
215
|
+
text='Show Modal Live'
|
|
216
|
+
onClick={() => {
|
|
217
|
+
setEmbedVideoObj({
|
|
218
|
+
data: {
|
|
219
|
+
videoId,
|
|
220
|
+
accountId,
|
|
221
|
+
livePlaybackToken: 'live-playback-token-test',
|
|
222
|
+
adConfigId: 'ad-config-id-test',
|
|
223
|
+
},
|
|
224
|
+
embedCodeModalType: EmbedCodeModalTypes.LIVE,
|
|
225
|
+
showDVR,
|
|
226
|
+
dvrTime: 900,
|
|
227
|
+
language,
|
|
228
|
+
theme,
|
|
229
|
+
ssai: showSSAI,
|
|
230
|
+
adConfigOptions: [
|
|
231
|
+
{ label: 'Basic Ad Config', value: 'basic' },
|
|
232
|
+
{ label: 'Advanced Ad Config', value: 'advanced' },
|
|
233
|
+
{ label: 'Premium Ad Config', value: 'premium' },
|
|
234
|
+
],
|
|
235
|
+
onDVRClick: (newValue) => {
|
|
236
|
+
console.log('DVR clicked', newValue);
|
|
237
|
+
},
|
|
238
|
+
showLowLatency,
|
|
239
|
+
onLowLatencyClick: (newValue) => {
|
|
240
|
+
console.log('Low Latency clicked', newValue);
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
}}
|
|
244
|
+
large
|
|
245
|
+
/>
|
|
246
|
+
{embedVideoObj && (
|
|
247
|
+
<EmbedCodeModal
|
|
248
|
+
{...embedVideoObj}
|
|
249
|
+
language={language}
|
|
250
|
+
theme={theme}
|
|
251
|
+
embedCodeProperties={embedProperties}
|
|
252
|
+
/>
|
|
253
|
+
)}
|
|
254
|
+
</div>
|
|
255
|
+
);
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
const initBCAPI = (studioModule: StudioModule) => {
|
|
259
|
+
const onAuth = () => {
|
|
260
|
+
if (appNode) {
|
|
261
|
+
if (!root) {
|
|
262
|
+
root = createRoot(appNode);
|
|
263
|
+
}
|
|
264
|
+
root.render(<App />);
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
studioModule.once('auth', onAuth);
|
|
269
|
+
const { module, user } = studioModule.config;
|
|
270
|
+
const accountId = user.currentAccount.id;
|
|
271
|
+
const moduleId = module.id;
|
|
272
|
+
const moduleScope = module.scope;
|
|
273
|
+
const moduleBcApiConfig = module.bcApiConfig;
|
|
274
|
+
|
|
275
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
276
|
+
studioModule._initBCApi(accountId, moduleId, moduleScope, moduleBcApiConfig);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
initialize();
|
|
280
|
+
initBCAPI(window.StudioModule);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
@import './base.sass'
|
|
2
|
+
|
|
3
|
+
@include themed() using ($theme)
|
|
4
|
+
.featuresDropdown
|
|
5
|
+
background: white
|
|
6
|
+
margin-bottom: 10px
|
|
7
|
+
.topArea
|
|
8
|
+
border-top: 1px solid theme($theme, gray-30)
|
|
9
|
+
border-bottom: 1px solid theme($theme, gray-30)
|
|
10
|
+
background: white
|
|
11
|
+
display: flex
|
|
12
|
+
padding: 16px
|
|
13
|
+
justify-content: space-between
|
|
14
|
+
cursor: pointer
|
|
15
|
+
|
|
16
|
+
.title
|
|
17
|
+
font-weight: theme($theme, heading-weight)
|
|
18
|
+
color: black
|
|
19
|
+
|
|
20
|
+
.right
|
|
21
|
+
display: flex
|
|
22
|
+
.description
|
|
23
|
+
font-size: theme($theme, label-font-size)
|
|
24
|
+
margin-right: 30px
|
|
25
|
+
.icon
|
|
26
|
+
color: theme($theme, navy)
|
|
27
|
+
|
|
28
|
+
.hiddenArea
|
|
29
|
+
.hiddenAreaContainer
|
|
30
|
+
padding: 28px 16px
|
|
31
|
+
.aspectRatioSelect
|
|
32
|
+
span[class^="Select-wrapper"]
|
|
33
|
+
width: 343px
|
|
34
|
+
.sizeEdit
|
|
35
|
+
display: flex
|
|
36
|
+
gap: 16px
|
|
37
|
+
label
|
|
38
|
+
padding: 0
|
|
39
|
+
max-width: 110px
|
|
40
|
+
div[class^="InputGroup-labelRight-"]
|
|
41
|
+
display: none
|
|
42
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@import './base.sass'
|
|
2
|
+
|
|
3
|
+
@include themed() using ($theme)
|
|
4
|
+
// Override studio-components styles
|
|
5
|
+
.hint
|
|
6
|
+
padding-top: 2px
|
|
7
|
+
.input
|
|
8
|
+
margin: 0 !important
|
|
9
|
+
padding-bottom: 4px !important
|
|
10
|
+
.textArea
|
|
11
|
+
color: theme($theme, gray-35) !important
|
|
12
|
+
background-color: theme($theme, gray-20) !important
|
|
13
|
+
border: none !important
|
|
14
|
+
resize: none
|
|
15
|
+
.copyInput
|
|
16
|
+
margin: 0 !important
|
|
17
|
+
padding-bottom: 4px !important
|
|
18
|
+
.textAreaDimensions
|
|
19
|
+
height: 210px
|
|
20
|
+
width: 390px
|
|
21
|
+
span[class^="CopyField-copyIcon"]
|
|
22
|
+
margin-right: 10px
|
|
23
|
+
.helperText
|
|
24
|
+
color: theme($theme, gray-40)
|
|
25
|
+
font-size: 14px
|
|
26
|
+
a.copyLink
|
|
27
|
+
text-decoration: none
|
|
28
|
+
font-weight: theme($theme, body-small-weight-bold)
|
|
29
|
+
cursor: pointer
|
|
30
|
+
padding-left: 4px
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@import './base.sass'
|
|
2
|
+
|
|
3
|
+
@include themed() using ($theme)
|
|
4
|
+
.videoDetailsContainer
|
|
5
|
+
margin-bottom: 27px
|
|
6
|
+
.leftContent
|
|
7
|
+
width: 540px
|
|
8
|
+
margin-right: 34px
|
|
9
|
+
.timeInput input
|
|
10
|
+
width: 150px
|
|
11
|
+
.dvrCheckbox span
|
|
12
|
+
font-weight: theme($theme, label-font-weight)
|
|
13
|
+
.rightContent
|
|
14
|
+
flex-grow: 1
|
|
15
|
+
max-height: 468px
|
|
16
|
+
overflow-y: auto
|
|
17
|
+
.expandRightContent
|
|
18
|
+
max-height: 620px
|
|
19
|
+
.rightContentFullWidth
|
|
20
|
+
[class^="EmbedCode__copyInput"]
|
|
21
|
+
textarea
|
|
22
|
+
width: 100%
|
|
23
|
+
> div > div > div
|
|
24
|
+
flex: 1
|
|
25
|
+
.mediaData
|
|
26
|
+
margin-top: 23px
|
|
27
|
+
padding: 0
|
|
28
|
+
.redHelperText
|
|
29
|
+
color: theme($theme, red)
|
|
30
|
+
font-size: 14px
|
|
31
|
+
.tabPanelContent > div > div > div
|
|
32
|
+
display: block !important
|
|
33
|
+
.mediaTitle
|
|
34
|
+
color: theme($theme, text-primary-dark)
|
|
35
|
+
font-size: theme($theme, heading-xs-size)
|
|
36
|
+
font-weight: theme($theme, heading-weight)
|
|
37
|
+
line-height: theme($theme, heading-xs-line-height)
|
|
38
|
+
word-break: break-all
|
|
39
|
+
.text
|
|
40
|
+
color: theme($theme, gray-40)
|
|
41
|
+
font-size: theme($theme, body-small-text-size)
|
|
42
|
+
font-weight: theme($theme, body-small-weight-normal)
|
|
43
|
+
.playerSelectLabel
|
|
44
|
+
font-family: theme($theme, label-font)
|
|
45
|
+
font-size: theme($theme, label-font-size)
|
|
46
|
+
font-weight: theme($theme, label-font-weight)
|
|
47
|
+
line-height: theme($theme, label-line-height)
|
|
48
|
+
letter-spacing: theme($theme, label-letter-spacing)
|
|
49
|
+
color: theme($theme, label-color)
|
|
50
|
+
padding: 0 0 .4rem
|
|
51
|
+
.playerSelect
|
|
52
|
+
width: 100%
|
|
53
|
+
.getURLBtnContainer
|
|
54
|
+
display: inline-flex
|
|
55
|
+
.getURLBtnSpinner
|
|
56
|
+
left: -5px
|
|
57
|
+
position: relative
|
|
58
|
+
margin-right: 8px
|
|
59
|
+
.mediaId
|
|
60
|
+
@extend .text
|
|
61
|
+
margin-bottom: 25px
|
|
62
|
+
.tooltip
|
|
63
|
+
margin-left: theme($theme, padding-sm)
|
|
64
|
+
.customPluginNotice
|
|
65
|
+
font-size: 14px
|
|
66
|
+
.playerLoader
|
|
67
|
+
video-js
|
|
68
|
+
width: 539px !important
|
|
69
|
+
height: 303.2px !important
|
|
70
|
+
margin-bottom: theme($theme, padding-sm)
|
|
71
|
+
iframe
|
|
72
|
+
width: 539px !important
|
|
73
|
+
height: 303.2px !important
|
|
74
|
+
.previewButton
|
|
75
|
+
align-self: center
|
|
76
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'theme.sass'
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
@import "~@brightcove/prism-core/build/scss/tokens"
|
|
2
|
+
|
|
3
|
+
.prismLiveModal
|
|
4
|
+
width: 900px
|
|
5
|
+
max-width: 90vw
|
|
6
|
+
height: 700px
|
|
7
|
+
max-height: 90vh
|
|
8
|
+
|
|
9
|
+
div[class^='Modal-Modal__content']
|
|
10
|
+
position: static
|
|
11
|
+
|
|
12
|
+
.prismLiveModalContent
|
|
13
|
+
display: grid
|
|
14
|
+
grid-template-columns: 52% 48%
|
|
15
|
+
gap: 0
|
|
16
|
+
height: 100%
|
|
17
|
+
max-height: calc(700px - 120px)
|
|
18
|
+
overflow: hidden
|
|
19
|
+
|
|
20
|
+
.prismLeftColumn
|
|
21
|
+
padding: var(--spacing-5, 24px)
|
|
22
|
+
display: flex
|
|
23
|
+
flex-direction: column
|
|
24
|
+
gap: var(--spacing-3, 12px)
|
|
25
|
+
overflow-y: auto
|
|
26
|
+
border-right: 1px solid var(--stroke-tertiary-default, #f5f4f0)
|
|
27
|
+
background: var(--surface-primary-default, #ffffff)
|
|
28
|
+
|
|
29
|
+
/* Custom scrollbar */
|
|
30
|
+
&::-webkit-scrollbar
|
|
31
|
+
width: 6px
|
|
32
|
+
|
|
33
|
+
&::-webkit-scrollbar-track
|
|
34
|
+
background: transparent
|
|
35
|
+
|
|
36
|
+
&::-webkit-scrollbar-thumb
|
|
37
|
+
background: var(--stroke-tertiary-default, #f5f4f0)
|
|
38
|
+
border-radius: 3px
|
|
39
|
+
|
|
40
|
+
&::-webkit-scrollbar-thumb:hover
|
|
41
|
+
background: var(--stroke-secondary-default, #e8e6de)
|
|
42
|
+
|
|
43
|
+
.prismRightColumn
|
|
44
|
+
padding: var(--spacing-5, 24px)
|
|
45
|
+
display: flex
|
|
46
|
+
flex-direction: column
|
|
47
|
+
background: var(--surface-primary-default, #ffffff)
|
|
48
|
+
overflow: hidden
|
|
49
|
+
|
|
50
|
+
.prismInputGroup
|
|
51
|
+
display: flex
|
|
52
|
+
gap: var(--spacing-2, 8px)
|
|
53
|
+
align-items: flex-end
|
|
54
|
+
|
|
55
|
+
> *:first-child,
|
|
56
|
+
> *:last-child
|
|
57
|
+
flex: 0 0 auto
|
|
58
|
+
width: 44%
|
|
59
|
+
|
|
60
|
+
.prismLinkButton
|
|
61
|
+
margin-bottom: 8px
|
|
62
|
+
flex-shrink: 0
|
|
63
|
+
|
|
64
|
+
.prismCustomPluginNotice
|
|
65
|
+
padding: var(--spacing-2, 8px) var(--spacing-3, 12px)
|
|
66
|
+
background: var(--surface-warning-subdued, #fff4e5)
|
|
67
|
+
color: var(--text-warning-default, #b54708)
|
|
68
|
+
font-size: var(--font-size-4xs, 12px)
|
|
69
|
+
line-height: var(--font-line-height-5xs, 15px)
|
|
70
|
+
border-radius: var(--radius-2, 8px)
|
|
71
|
+
margin-top: var(--spacing-3, 12px)
|
|
72
|
+
|
|
73
|
+
// Bound the code card so the upstream PrismCodeCard's own scroll
|
|
74
|
+
// engages instead of overflowing the modal's left column. The upstream
|
|
75
|
+
// component doesn't expose a height-cap prop, so we cap its inner
|
|
76
|
+
// scroll element by class-name match. Re-verify on prism-core upgrades.
|
|
77
|
+
.prismCodeCard
|
|
78
|
+
flex: 0 0 auto
|
|
79
|
+
max-height: 280px
|
|
80
|
+
|
|
81
|
+
[class*='CodeCard__scroll']
|
|
82
|
+
max-height: 220px
|
|
83
|
+
overflow-y: auto
|
|
84
|
+
|
|
85
|
+
.prismFooter
|
|
86
|
+
display: flex
|
|
87
|
+
justify-content: flex-end
|
|
88
|
+
gap: var(--spacing-2, 8px)
|
|
89
|
+
padding: var(--spacing-4, 16px) var(--spacing-5, 24px)
|
|
90
|
+
border-top: 1px solid var(--stroke-tertiary-default, #f5f4f0)
|
|
91
|
+
background: var(--surface-primary-default, #ffffff)
|
|
92
|
+
|
|
93
|
+
// Player Preview Styles
|
|
94
|
+
.prismPlayerPreviewContainer
|
|
95
|
+
display: flex
|
|
96
|
+
flex-direction: column
|
|
97
|
+
height: 100%
|
|
98
|
+
gap: var(--spacing-3, 12px)
|
|
99
|
+
|
|
100
|
+
.prismPlayerActions
|
|
101
|
+
display: flex
|
|
102
|
+
gap: var(--spacing-2, 8px)
|
|
103
|
+
justify-content: flex-end
|
|
104
|
+
|
|
105
|
+
.prismPlayerWrapper
|
|
106
|
+
flex: 1
|
|
107
|
+
position: relative
|
|
108
|
+
border-radius: var(--radius-2, 8px)
|
|
109
|
+
overflow: hidden
|
|
110
|
+
display: flex
|
|
111
|
+
align-items: center
|
|
112
|
+
justify-content: center
|
|
113
|
+
|
|
114
|
+
video
|
|
115
|
+
width: 100%
|
|
116
|
+
height: auto
|
|
117
|
+
|
|
118
|
+
iframe
|
|
119
|
+
width: 100%
|
|
120
|
+
max-width: 100%
|
|
121
|
+
aspect-ratio: 16 / 9
|
|
122
|
+
border: none
|
|
123
|
+
border-radius: var(--radius-2, 8px)
|
|
124
|
+
|
|
125
|
+
.playerLoader
|
|
126
|
+
width: 100%
|
|
127
|
+
max-width: 100%
|
|
128
|
+
aspect-ratio: 16 / 9
|
|
129
|
+
display: flex
|
|
130
|
+
align-items: center
|
|
131
|
+
justify-content: center
|
|
132
|
+
|
|
133
|
+
video
|
|
134
|
+
width: 100%
|
|
135
|
+
height: 100%
|
|
136
|
+
object-fit: contain
|
|
137
|
+
|
|
138
|
+
// Responsive adjustments
|
|
139
|
+
@media (max-width: 768px)
|
|
140
|
+
.prismLiveModal
|
|
141
|
+
width: 100%
|
|
142
|
+
height: 100%
|
|
143
|
+
max-width: 100vw
|
|
144
|
+
max-height: 100vh
|
|
145
|
+
|
|
146
|
+
.prismLiveModalContent
|
|
147
|
+
grid-template-columns: 1fr
|
|
148
|
+
overflow-y: auto
|
|
149
|
+
|
|
150
|
+
.prismLeftColumn
|
|
151
|
+
border-right: none
|
|
152
|
+
border-bottom: 1px solid var(--stroke-tertiary-default, #f5f4f0)
|
|
153
|
+
|
|
154
|
+
.prismRightColumn
|
|
155
|
+
min-height: 400px
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@import "~@brightcove/studio-design-tokens/themes/blueSteel/index-map.sass"
|
|
2
|
+
@import "~@brightcove/studio-design-tokens/themes/classic/index-map.sass"
|
|
3
|
+
|
|
4
|
+
$themes: $classic $blueSteel
|
|
5
|
+
|
|
6
|
+
@function theme($theme, $property)
|
|
7
|
+
@return map-get($theme, $property)
|
|
8
|
+
|
|
9
|
+
=themed
|
|
10
|
+
@each $theme in $themes
|
|
11
|
+
@content($theme)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"modalHeader": "Embed on website",
|
|
3
|
+
"mediaNotice": "Will use your account’s default player",
|
|
4
|
+
"tooltipText": "Currently using the Brightcove Default Player. Player management coming soon.",
|
|
5
|
+
"tooltipTextNew": "Players determine the video playback experience such as styling, special configuration settings, and more.",
|
|
6
|
+
"tooltipLink": "Learn more about players",
|
|
7
|
+
"learnmore": "https://studio.support.brightcove.com/players/getting-started-players-module.html",
|
|
8
|
+
"previewButton": "Preview",
|
|
9
|
+
"player": "Player",
|
|
10
|
+
"getURL": "Get URL",
|
|
11
|
+
"tabs": {
|
|
12
|
+
"labels": {
|
|
13
|
+
"iframe": "iframe",
|
|
14
|
+
"javascript": "JavaScript"
|
|
15
|
+
},
|
|
16
|
+
"helperText": "Copy the HTML code and paste it on your website.",
|
|
17
|
+
"helperTextWarning": "This player is configured with the Campaign plugin. To ensure proper tracking, the JavaScript embed code should be used.",
|
|
18
|
+
"viewerIdTextWarning": "This player is configured with Viewer ID Tracking. To ensure proper tracking, the JavaScript embed code should be used.",
|
|
19
|
+
"bcMapTrackingTextWarning": "This player is configured with MAPs Tracking. To ensure proper tracking, the JavaScript embed code should be used."
|
|
20
|
+
},
|
|
21
|
+
"done": "Done",
|
|
22
|
+
"close": "Close",
|
|
23
|
+
"toasterTitle": "Success.",
|
|
24
|
+
"toasterMessage": "Code copied to clipboard",
|
|
25
|
+
"toasterGetURLSuccess": "URL copied to the clipboard",
|
|
26
|
+
"toasterErrorMessage": "Error while copying text to clipboard",
|
|
27
|
+
"toasterGetURLError": "URL cannot be generated",
|
|
28
|
+
"customPluginNotice": "Due to custom configurations, you may not be experiencing the full preview.",
|
|
29
|
+
"noPlayerModalHeader": "Create an Interactivity Player",
|
|
30
|
+
"noPlayerModalContent1": "To embed an Interactivity Project you must enable the interactivity feature.",
|
|
31
|
+
"noPlayerModalContent2": "Activate this feature on any existing player or create a new one.",
|
|
32
|
+
"toPlayersModuleLink": "Go to the Players module",
|
|
33
|
+
"cancel": "Cancel",
|
|
34
|
+
"createPlayerNow": "Create Player Now",
|
|
35
|
+
"createPlayerFailedTitle": "Failed to create the Interactivity-enabled Player.",
|
|
36
|
+
"createPlayerFailedMessage": "Please try again.",
|
|
37
|
+
"activateModal": "No Interactivity-enabled players",
|
|
38
|
+
"activateModalContent1": "An Interactivity-enabled player is required to embed a project. Currently, this account has no Interactivity-enabled players. To create one, use the ",
|
|
39
|
+
"activateModalContent2": "Players module",
|
|
40
|
+
"customSettings": {
|
|
41
|
+
"sizing": "Sizing",
|
|
42
|
+
"aspectRatio": "Aspect Ratio",
|
|
43
|
+
"playerWidth": "Player width",
|
|
44
|
+
"playerHeight": "Player height",
|
|
45
|
+
"units": "Units"
|
|
46
|
+
},
|
|
47
|
+
"lowLatency": "Low Latency",
|
|
48
|
+
"dvr": {
|
|
49
|
+
"allowDVR": "Allow DVR",
|
|
50
|
+
"inputLabel": "Time",
|
|
51
|
+
"inputDescription": "The time, in seconds, to keep in the live DVR manifest",
|
|
52
|
+
"unit": "sec"
|
|
53
|
+
},
|
|
54
|
+
"adConfiguration": "Ad Configuration",
|
|
55
|
+
"prism": {
|
|
56
|
+
"getURL": "URL",
|
|
57
|
+
"customSettings": {
|
|
58
|
+
"sizing": "Player Sizing"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|