Skip to content

Commit 57efaac

Browse files
committed
added support for enabled_player_controls
1 parent 0db22fd commit 57efaac

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class Example extends Component {
5959
| facebook_pixel_id `String` | Facebook pixel ID to be used to send data about playback | null |
6060
| ga_tracking_id `String` | Google pixel ID to be used to send data about playback | null |
6161
| t `Integer` | The playback instant in seconds to start the video at | null |
62+
| enabled_player_control `Array`| Only allow thes eplayer controls to be visible | null |
6263

6364

6465
Methods

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gumlet/react-embed-player",
3-
"version": "2.0.17",
3+
"version": "2.0.18",
44
"description": "Gumlet React Embed Player",
55
"main": "./dist/index.cjs",
66
"module": "./dist/index.mjs",

src/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ interface GumletPlayerProps {
1818
iframeStyle?: CSSProperties;
1919
schemaOrgVideoObject?: Record<string, any>;
2020
version?: string;
21+
enabled_player_control?: [];
2122

2223
// Optional player event handlers
2324
onReady?: () => void;
@@ -69,6 +70,7 @@ export const GumletPlayer = forwardRef<GumletPlayerHandle, GumletPlayerProps>(
6970
schemaOrgVideoObject = {},
7071
iframeStyle = { border: 'none', position: 'absolute', top: 0, left: 0, height: '100%', width: '100%' },
7172
isLive = false,
73+
enabled_player_control = [],
7274
...props
7375
},
7476
ref
@@ -159,7 +161,12 @@ export const GumletPlayer = forwardRef<GumletPlayerHandle, GumletPlayerProps>(
159161

160162
for (const [key, value] of Object.entries(props)) {
161163
if (value != null) {
162-
srcURL.searchParams.append(key, value);
164+
// check if value is an array then append the same key multiple times
165+
if (Array.isArray(value)) {
166+
value.forEach((item) => srcURL.searchParams.append(key, item));
167+
} else {
168+
srcURL.searchParams.append(key, value);
169+
}
163170
}
164171
}
165172

0 commit comments

Comments
 (0)