@glomex/integration-react 1.1299.0 → 1.1299.1
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 +30 -10
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/integration-react.d.ts +1 -1
- package/build/integration-react.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -16,14 +16,15 @@ Our ecosystem is designed to create value for all participants:
|
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
|
-
### Loading & integrating the player
|
|
19
|
+
### Loading & integrating the player (TypeScript)
|
|
20
20
|
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
import {
|
|
21
|
+
```tsx
|
|
22
|
+
// example: player.tsx
|
|
23
|
+
import { useEffect, useRef, type ComponentProps, type ComponentRef } from 'react';
|
|
24
|
+
import { Integration, IntegrationEvent } from '@glomex/integration-react';
|
|
24
25
|
|
|
25
|
-
const
|
|
26
|
-
const integrationRef = useRef<
|
|
26
|
+
const Player = (props: ComponentProps<typeof Integration>) => {
|
|
27
|
+
const integrationRef = useRef<ComponentRef<typeof Integration>>(null);
|
|
27
28
|
|
|
28
29
|
const handlePlay = () => {
|
|
29
30
|
integrationRef.current?.play();
|
|
@@ -48,10 +49,9 @@ const MyApp = () => {
|
|
|
48
49
|
|
|
49
50
|
return (
|
|
50
51
|
<div>
|
|
51
|
-
<
|
|
52
|
+
<Integration
|
|
52
53
|
ref={integrationRef}
|
|
53
|
-
|
|
54
|
-
playlistId="FILL_IN_PLAYLIST_ID"
|
|
54
|
+
{...props}
|
|
55
55
|
/>
|
|
56
56
|
<button type="button" onClick={handlePlay}>
|
|
57
57
|
Play
|
|
@@ -60,5 +60,25 @@ const MyApp = () => {
|
|
|
60
60
|
);
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
export default
|
|
63
|
+
export default Player;
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Usage** in your component:
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
// example: app.tsx
|
|
70
|
+
import Player from "./player"
|
|
71
|
+
|
|
72
|
+
export default async function MyApp(props) {
|
|
73
|
+
const params = await props.params
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<div>
|
|
77
|
+
<Player
|
|
78
|
+
integrationId="REPLACE_WITH_INTEGRATION_ID"
|
|
79
|
+
playlistId="REPLACE_WITH_PLAYLIST_ID"
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
64
84
|
```
|
package/build/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Integration } from './integration-react';
|
|
2
2
|
export * from '@glomex/integration-web-component';
|
package/build/index.js
CHANGED
|
@@ -17,7 +17,7 @@ declare global {
|
|
|
17
17
|
*
|
|
18
18
|
* @see {@link IntegrationElementEventMap} for all available events.
|
|
19
19
|
*/
|
|
20
|
-
export declare const
|
|
20
|
+
export declare const Integration: import("react").ForwardRefExoticComponent<IntegrationProperties & {
|
|
21
21
|
id?: string;
|
|
22
22
|
mediaItems?: (string | {
|
|
23
23
|
id: string;
|
|
@@ -8,7 +8,7 @@ import { GlomexMediaItemReact } from './glomex-media-item-react';
|
|
|
8
8
|
*
|
|
9
9
|
* @see {@link IntegrationElementEventMap} for all available events.
|
|
10
10
|
*/
|
|
11
|
-
export const
|
|
11
|
+
export const Integration = forwardRef((props, ref) => {
|
|
12
12
|
const { children, integrationId, playlistId, index, hidden, topLevelIframe, placement, mediaItems, configs, preventLoadIntegration, ...rest } = props;
|
|
13
13
|
const elementRef = useRef(null);
|
|
14
14
|
if (mediaItems && playlistId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glomex/integration-react",
|
|
3
|
-
"version": "1.1299.
|
|
3
|
+
"version": "1.1299.1",
|
|
4
4
|
"description": "React component to integrate the glomex player",
|
|
5
5
|
"documentation": "https://docs.glomex.com",
|
|
6
6
|
"homepage": "https://glomex.com",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"watch": "tsc --build --watch"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@glomex/integration-web-component": "^1.1299.
|
|
30
|
+
"@glomex/integration-web-component": "^1.1299.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": ">=16.8.0",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "0b2882778fc671fc3f7a6af073f51477db717270"
|
|
44
44
|
}
|