cafe-video-player 3.0.20 → 3.0.22

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
@@ -1,333 +1,329 @@
1
- # cafe-video-player
2
-
3
- ✔ Playing static and vod videos
4
-
5
- ## Installation
6
-
7
- ```
8
- $ npm install --save cafe-video-player
9
- $ yarn add cafe-video-player
10
-
11
- ```
12
-
13
- ## Example
14
-
15
- ✔ To play vod, follow the example below:
16
-
17
- ```jsx
18
- import { VideoPlayerLibrary } from "cafe-video-player";
19
-
20
- export default function HomePage() {
21
- const params = {
22
- type: "vod",
23
- id: "6623",
24
- banner: "image path", // (to display cover image from external url) optional
25
- subtitleUrl: "subtitle url", // (to display subtitle from external url) optional
26
- currentTime: 100, // (jump to second 100) optional
27
- onChangeCurrentTime: (currentTime: number) => console.log(currentTime), //optional, This function returns the current time value when clicking on the progress bar or the backward and forward buttons.
28
- subtitles = [{lang: "string", title: "string", url: "subtitle url"}] // optional
29
- /*
30
- subtitle example
31
- subtitles = [
32
- {lang: "fa", title: "فارسی", url: "https://hamrahi.cloud/subtitles/216-282790-6770242c63370b3aa9ce680b-sub_fa.srt"},
33
- {lang: "en", title: "انگلیسی", url: "https://hamrahi.cloud/subtitles/216-282790-6770242c63370b58ecce680d-sub_en.srt"},
34
- ]
35
- */
36
- onPlay: (currentTime: number) => console.log("Video started at:", currentTime),
37
- onSpeedChange: (oldSpeed: number, newSpeed: number) => console.log(`Playback speed changed from ${oldSpeed}x to ${newSpeed}x`),
38
- onFullscreenChange:(status: boolean) => console.log(`Fullscreen status:${status}`),
39
- onSubtitleStatusChange: (subtitle, status) => console.log("Subtitle status changed:", subtitle, "Enabled:", status),
40
- };
41
-
42
- return (
43
- <div>
44
- <VideoPlayerLibrary params={params} />
45
- </div>
46
- );
47
- }
48
- ```
49
-
50
- ## Example
51
-
52
- ✔ To play a video directly using stream_link, follow the example below:
53
-
54
- - If stream_link is provided, there is no need to pass id.
55
- - In this mode, the player will not send any request to fetch VOD data and will directly use the provided HLS link for playback.
56
- - If both id and stream_link are provided, id has priority.
57
-
58
- ```jsx
59
- import { VideoPlayerLibrary } from "cafe-video-player";
60
-
61
- export default function HomePage() {
62
- const params = {
63
- type: "static",
64
- stream_link: "https://example.com/video/playlist.m3u8", // direct HLS link
65
- banner: "image path", // (to display cover image from external url) optional
66
- onChangeCurrentTime: (currentTime: number) => console.log(currentTime), //optional, This function returns the current time value when clicking on the progress bar or the backward and forward buttons.
67
- subtitles = [{lang: "string", title: "string", url: "subtitle url"}] // optional
68
- /*
69
- subtitle example
70
- subtitles = [
71
- {lang: "fa", title: "فارسی", url: "https://hamrahi.cloud/subtitles/216-282790-6770242c63370b3aa9ce680b-sub_fa.srt"},
72
- {lang: "en", title: "انگلیسی", url: "https://hamrahi.cloud/subtitles/216-282790-6770242c63370b58ecce680d-sub_en.srt"},
73
- ]
74
- */
75
- onPlay: (currentTime: number) => console.log("Video started at:", currentTime),
76
- onSpeedChange: (oldSpeed: number, newSpeed: number) => console.log(`Playback speed changed from ${oldSpeed}x to ${newSpeed}x`),
77
- onFullscreenChange:(status: boolean) => console.log(`Fullscreen status:${status}`),
78
- onSubtitleStatusChange: (subtitle, status) => console.log("Subtitle status changed:", subtitle, "Enabled:", status),
79
- };
80
-
81
- return (
82
- <div>
83
- <VideoPlayerLibrary params={params} />
84
- </div>
85
- );
86
- }
87
- ```
88
-
89
- ## Example
90
-
91
- ✔ To play static videos, follow the example below:
92
-
93
- - id corresponds to the video link, which must be base64 format
94
- - banner corresponds to the cover link, which must be base64 format
95
-
96
- ```jsx
97
- import { VideoPlayerLibrary } from "cafe-video-player";
98
-
99
- export default function HomePage() {
100
- const params = {
101
- type: "static",
102
- id: "aHR0cHM6Ly9hYnJlaGFtcmFoaS5pci9vL3RXMHFONUQwWFB2R04wdGhJQUM1UUEv",
103
- banner: "image path", // (to display cover image from external url) optional
104
- onChangeCurrentTime: (currentTime: number) => console.log(currentTime), //optional, This function returns the current time value when clicking on the progress bar or the backward and forward buttons.
105
- subtitles = [{lang: "string", title: "string", url: "subtitle url"}] // optional
106
- /*
107
- subtitle example
108
- subtitles = [
109
- {lang: "fa", title: "فارسی", url: "https://hamrahi.cloud/subtitles/216-282790-6770242c63370b3aa9ce680b-sub_fa.srt"},
110
- {lang: "en", title: "انگلیسی", url: "https://hamrahi.cloud/subtitles/216-282790-6770242c63370b58ecce680d-sub_en.srt"},
111
- ]
112
- */
113
- onPlay: (currentTime: number) => console.log("Video started at:", currentTime),
114
- onSpeedChange: (oldSpeed: number, newSpeed: number) => console.log(`Playback speed changed from ${oldSpeed}x to ${newSpeed}x`),
115
- onFullscreenChange:(status: boolean) => console.log(`Fullscreen status:${status}`),
116
- onSubtitleStatusChange: (subtitle, status) => console.log("Subtitle status changed:", subtitle, "Enabled:", status),
117
- };
118
-
119
- return (
120
- <div>
121
- <VideoPlayerLibrary params={params} />
122
- </div>
123
- );
124
- }
125
- ```
126
-
127
- ## Example
128
-
129
- ✔ To use the mini-player feature, follow the example below:
130
-
131
- ```jsx
132
- import { MiniPlayerLibrary } from "cafe-video-player";
133
-
134
- export default function HomePage() {
135
- const params = {
136
- type: "vod",
137
- id: "6623",
138
- onClose: () => {},
139
- };
140
-
141
- return (
142
- <div>
143
- <MiniPlayerLibrary params={params} />
144
- </div>
145
- );
146
- }
147
- ```
148
-
149
- ## Example
150
-
151
- ✔ You can use bannerAlt props to set custom alt for video banner
152
-
153
- ```jsx
154
- import { VideoPlayerLibrary } from "cafe-video-player";
155
-
156
- export default function HomePage() {
157
- const params = {
158
- id: "6623",
159
- type: "vod",
160
- bannerAlt: "alt for video banner",
161
- };
162
-
163
- return (
164
- <div>
165
- <VideoPlayerLibrary params={params} />
166
- </div>
167
- );
168
- }
169
- ```
170
-
171
- ⚠️ Disable React StrictMode, as it may cause duplicate executions of effects and unexpected behavior during development.
172
-
173
- For the modals to work correctly, you need to add the following tag to the end of the body tag.
174
-
175
- ```jsx
176
- <div id="dialog-react-root-videoPlayer" />
177
- ```
178
-
179
- To display the player styles correctly, you need to import the `videoPlayerStyles.css` file, as shown in the example below.
180
-
181
- ```jsx
182
-
183
- @import "tailwindcss";
184
-
185
- @layer base {
186
- @import "cafe-video-player/videoPlayerStyles.css";
187
- }
188
-
189
- ```
190
-
191
- To display the images correctly, you must put the following configuration in the next.config.ts file.
192
-
193
- ```jsx
194
-
195
- images: {
196
- remotePatterns: [
197
- {
198
- protocol: "https",
199
- hostname: "**"
200
- }
201
- ]
202
- },
203
-
204
- ```
205
-
206
- # Video HighLighter Integration Guide
207
-
208
- This document explains how to integrate and use the **Video HighLighter** feature in a Next.js project.
209
-
210
- ## Overview
211
-
212
- The Video HighLighter enhances the video player with additional UI and state indicators during the download and preparation of video content. To enable it, several props must be passed to the player component.
213
-
214
- ## Props
215
-
216
- ### `vhl_status`
217
-
218
- Indicates the current state of the Video HighLighter process. Accepted values:
219
-
220
- - `skeleton`: Shows the skeleton loading state.
221
- - `waiting`: Indicates the waiting period before video download begins.
222
- - `download_start`: The download process has started.
223
- - `download_error`: An error occurred during the download.
224
- - `undefined`: Default value. Hides all Video HighLighter-related sections.
225
-
226
- ### `vhl_progress`
227
-
228
- A numeric value representing the percentage of the download progress.
229
-
230
- ### `vhl_duration`
231
-
232
- Total duration of the video in seconds (numeric value).
233
-
234
- ### `vhl_statusText`
235
-
236
- Text displayed under the progress bar while downloading the video.
237
- For greater flexibility (e.g., multiline messages), this prop should be passed as a JSX element.
238
-
239
- ### `vhl_onRetry`
240
-
241
- A callback function executed if a download error occurs.
242
-
243
- ### `banner`
244
-
245
- An image used as the banner for the video.
246
-
247
- ## Important Notes
248
-
249
- After the video has been successfully downloaded, make sure to:
250
-
251
- 1. Set the `vhl_status` to `undefined`.
252
- 2. Pass the video `id` using the `id` prop to the player to start playback and load video details.
253
-
254
- ---
255
-
256
- ## 🧪 Example Usage in a Next.js Component
257
-
258
- ```tsx
259
- import { VideoPlayerLibrary } from "cafe-video-player";
260
-
261
- export default function HomePage() {
262
- const params = {
263
- vhl_status="download_start"
264
- vhl_progress={42}
265
- vhl_duration={300}
266
- vhl_statusText={<p>Downloading highlights...<br />Please wait.</p>}
267
- vhl_onRetry={handleRetry}
268
- banner="/images/video-banner.jpg"
269
- id="abc123"
270
- };
271
-
272
- return (
273
- <div>
274
- <VideoPlayerLibrary params={params} />
275
- </div>
276
- );
277
- }
278
- ```
279
-
280
- # Advertisement Integration Guide
281
-
282
- This document explains how to integrate and use the **Advertisement** feature in a Next.js project with the `cafe-video-player`.
283
-
284
- ---
285
-
286
- ## Overview
287
-
288
- The Advertisement feature allows you to show video ads before playback.
289
- It supports skip functionality, clickable ads, and callback hooks for both skipping and ad completion.
290
-
291
- ---
292
-
293
- ## Props
294
-
295
- An object that must follow the `IAdvertisement` interface:
296
-
297
- ```ts
298
- export interface IAdvertisement {
299
- videoUrl: string; // The ad video source URL (static video, required)
300
- adText?: string; // Optional text for the ad button. Defaults to "اطلاعات بیشتر" if not provided
301
- skipDelay?: number; // Number of seconds before the skip button becomes clickable. If not provided or 0, the ad cannot be skipped
302
- onSkipAd?: (currentTime: number) => void; // Callback when the ad is skipped, receives the currentTime (optional)
303
- onEndAd?: (currentTime: number) => void; // Callback when the ad finishes, receives the currentTime (optional)
304
- onClickAd?: (currentTime: number) => void; // Callback when the ad button is clicked, receives the currentTime. If not defined, the ad button will not be shown (optional)
305
- }
306
- ```
307
-
308
- ## 🧪 Example Usage in a Next.js Component
309
-
310
- ```tsx
311
- import { VideoPlayerLibrary } from "cafe-video-player";
312
-
313
- export default function HomePage() {
314
- const params = {
315
- type: "vod",
316
- id: "6623",
317
- advertisement: {
318
- videoUrl: "https://example.com/ad.mp4",
319
- adText: "Visit our sponsor",
320
- skipDelay: 5,
321
- onSkipAd: (currentTime: number) => console.log("Ad skipped at:", currentTime),
322
- onEndAd: (currentTime: number) => console.log("Ad ended at:", currentTime),
323
- onClickAd: (currentTime: number) => console.log("Ad clicked at:", currentTime),
324
- },
325
- };
326
-
327
- return (
328
- <div>
329
- <VideoPlayerLibrary params={params} />
330
- </div>
331
- );
332
- }
333
- ```
1
+ # cafe-video-player
2
+
3
+ ✔ Playing static and vod videos
4
+
5
+ ## Installation
6
+
7
+ ```
8
+ $ npm install --save cafe-video-player
9
+ $ yarn add cafe-video-player
10
+
11
+ ```
12
+
13
+ ## Example
14
+
15
+ ✔ To play vod, follow the example below:
16
+
17
+ ```jsx
18
+ import { VideoPlayerLibrary } from "cafe-video-player";
19
+
20
+ export default function HomePage() {
21
+ const params = {
22
+ type: "vod",
23
+ id: "6623",
24
+ banner: "image path", // (to display cover image from external url) optional
25
+ subtitleUrl: "subtitle url", // (to display subtitle from external url) optional
26
+ currentTime: 100, // (jump to second 100) optional
27
+ onChangeCurrentTime: (currentTime: number) => console.log(currentTime), //optional, This function returns the current time value when clicking on the progress bar or the backward and forward buttons.
28
+ subtitles = [{lang: "string", title: "string", url: "subtitle url"}] // optional
29
+ /*
30
+ subtitle example
31
+ subtitles = [
32
+ {lang: "fa", title: "فارسی", url: "https://hamrahi.cloud/subtitles/216-282790-6770242c63370b3aa9ce680b-sub_fa.srt"},
33
+ {lang: "en", title: "انگلیسی", url: "https://hamrahi.cloud/subtitles/216-282790-6770242c63370b58ecce680d-sub_en.srt"},
34
+ ]
35
+ */
36
+ onPlay: (currentTime: number) => console.log("Video started at:", currentTime),
37
+ onSpeedChange: (oldSpeed: number, newSpeed: number) => console.log(`Playback speed changed from ${oldSpeed}x to ${newSpeed}x`),
38
+ onFullscreenChange:(status: boolean) => console.log(`Fullscreen status:${status}`),
39
+ onSubtitleStatusChange: (subtitle, status) => console.log("Subtitle status changed:", subtitle, "Enabled:", status),
40
+ };
41
+
42
+ return (
43
+ <div>
44
+ <VideoPlayerLibrary params={params} />
45
+ </div>
46
+ );
47
+ }
48
+ ```
49
+
50
+ ## Example
51
+
52
+ ✔ To play a video directly using stream_link, follow the example below:
53
+
54
+ - If stream_link is provided, there is no need to pass id.
55
+ - In this mode, the player will not send any request to fetch VOD data and will directly use the provided HLS link for playback.
56
+ - If both id and stream_link are provided, id has priority.
57
+
58
+ ```jsx
59
+ import { VideoPlayerLibrary } from "cafe-video-player";
60
+
61
+ export default function HomePage() {
62
+ const params = {
63
+ type: "static",
64
+ stream_link: "https://example.com/video/playlist.m3u8", // direct HLS link
65
+ banner: "image path", // (to display cover image from external url) optional
66
+ onChangeCurrentTime: (currentTime: number) => console.log(currentTime), //optional, This function returns the current time value when clicking on the progress bar or the backward and forward buttons.
67
+ subtitles = [{lang: "string", title: "string", url: "subtitle url"}] // optional
68
+ /*
69
+ subtitle example
70
+ subtitles = [
71
+ {lang: "fa", title: "فارسی", url: "https://hamrahi.cloud/subtitles/216-282790-6770242c63370b3aa9ce680b-sub_fa.srt"},
72
+ {lang: "en", title: "انگلیسی", url: "https://hamrahi.cloud/subtitles/216-282790-6770242c63370b58ecce680d-sub_en.srt"},
73
+ ]
74
+ */
75
+ onPlay: (currentTime: number) => console.log("Video started at:", currentTime),
76
+ onSpeedChange: (oldSpeed: number, newSpeed: number) => console.log(`Playback speed changed from ${oldSpeed}x to ${newSpeed}x`),
77
+ onFullscreenChange:(status: boolean) => console.log(`Fullscreen status:${status}`),
78
+ onSubtitleStatusChange: (subtitle, status) => console.log("Subtitle status changed:", subtitle, "Enabled:", status),
79
+ };
80
+
81
+ return (
82
+ <div>
83
+ <VideoPlayerLibrary params={params} />
84
+ </div>
85
+ );
86
+ }
87
+ ```
88
+
89
+ ## Example
90
+
91
+ ✔ To play static videos, follow the example below:
92
+
93
+ - id corresponds to the video link, which must be base64 format
94
+ - banner corresponds to the cover link, which must be base64 format
95
+
96
+ ```jsx
97
+ import { VideoPlayerLibrary } from "cafe-video-player";
98
+
99
+ export default function HomePage() {
100
+ const params = {
101
+ type: "static",
102
+ id: "aHR0cHM6Ly9hYnJlaGFtcmFoaS5pci9vL3RXMHFONUQwWFB2R04wdGhJQUM1UUEv",
103
+ banner: "image path", // (to display cover image from external url) optional
104
+ onChangeCurrentTime: (currentTime: number) => console.log(currentTime), //optional, This function returns the current time value when clicking on the progress bar or the backward and forward buttons.
105
+ subtitles = [{lang: "string", title: "string", url: "subtitle url"}] // optional
106
+ /*
107
+ subtitle example
108
+ subtitles = [
109
+ {lang: "fa", title: "فارسی", url: "https://hamrahi.cloud/subtitles/216-282790-6770242c63370b3aa9ce680b-sub_fa.srt"},
110
+ {lang: "en", title: "انگلیسی", url: "https://hamrahi.cloud/subtitles/216-282790-6770242c63370b58ecce680d-sub_en.srt"},
111
+ ]
112
+ */
113
+ onPlay: (currentTime: number) => console.log("Video started at:", currentTime),
114
+ onSpeedChange: (oldSpeed: number, newSpeed: number) => console.log(`Playback speed changed from ${oldSpeed}x to ${newSpeed}x`),
115
+ onFullscreenChange:(status: boolean) => console.log(`Fullscreen status:${status}`),
116
+ onSubtitleStatusChange: (subtitle, status) => console.log("Subtitle status changed:", subtitle, "Enabled:", status),
117
+ };
118
+
119
+ return (
120
+ <div>
121
+ <VideoPlayerLibrary params={params} />
122
+ </div>
123
+ );
124
+ }
125
+ ```
126
+
127
+ ## Example
128
+
129
+ ✔ To use the mini-player feature, follow the example below:
130
+
131
+ ```jsx
132
+ import { MiniPlayerLibrary } from "cafe-video-player";
133
+
134
+ export default function HomePage() {
135
+ const params = {
136
+ type: "vod",
137
+ id: "6623",
138
+ onClose: () => {},
139
+ };
140
+
141
+ return (
142
+ <div>
143
+ <MiniPlayerLibrary params={params} />
144
+ </div>
145
+ );
146
+ }
147
+ ```
148
+
149
+ ## Example
150
+
151
+ ✔ You can use bannerAlt props to set custom alt for video banner
152
+
153
+ ```jsx
154
+ import { VideoPlayerLibrary } from "cafe-video-player";
155
+
156
+ export default function HomePage() {
157
+ const params = {
158
+ id: "6623",
159
+ type: "vod",
160
+ bannerAlt: "alt for video banner",
161
+ };
162
+
163
+ return (
164
+ <div>
165
+ <VideoPlayerLibrary params={params} />
166
+ </div>
167
+ );
168
+ }
169
+ ```
170
+
171
+ ⚠️ Disable React StrictMode, as it may cause duplicate executions of effects and unexpected behavior during development.
172
+
173
+ For the modals to work correctly, you need to add the following tag to the end of the body tag.
174
+
175
+ ```jsx
176
+ <div id="dialog-react-root-videoPlayer" />
177
+ ```
178
+
179
+ To display the player styles correctly, you need to import the `videoPlayerStyles.css` file, as shown in the example below.
180
+
181
+ ```jsx
182
+
183
+ @import "tailwindcss";
184
+
185
+ @layer base {
186
+ @import "cafe-video-player/videoPlayerStyles.css";
187
+ }
188
+
189
+ ```
190
+
191
+ To display the images correctly, you must put the following configuration in the next.config.ts file.
192
+
193
+ ```jsx
194
+
195
+ images: {
196
+ remotePatterns: [
197
+ {
198
+ protocol: "https",
199
+ hostname: "**"
200
+ }
201
+ ]
202
+ },
203
+
204
+ ```
205
+
206
+ # Video HighLighter Integration Guide
207
+
208
+ This document explains how to integrate and use the **Video HighLighter** feature in a Next.js project.
209
+
210
+ ## Overview
211
+
212
+ The Video HighLighter enhances the video player with additional UI and state indicators during the download and preparation of video content. To enable it, several props must be passed to the player component.
213
+
214
+ ## Props
215
+
216
+ ### `vhl_status`
217
+
218
+ Indicates the current state of the Video HighLighter process. Accepted values:
219
+
220
+ - `skeleton`: Shows the skeleton loading state.
221
+ - `waiting`: Indicates the waiting period before video download begins.
222
+ - `download_start`: The download process has started.
223
+ - `download_error`: An error occurred during the download.
224
+ - `undefined`: Default value. Hides all Video HighLighter-related sections.
225
+
226
+ ### `vhl_progress`
227
+
228
+ A numeric value representing the percentage of the download progress.
229
+
230
+ ### `vhl_duration`
231
+
232
+ Total duration of the video in seconds (numeric value).
233
+
234
+ ### `vhl_statusText`
235
+
236
+ Text displayed under the progress bar while downloading the video.
237
+ For greater flexibility (e.g., multiline messages), this prop should be passed as a JSX element.
238
+
239
+ ### `vhl_onRetry`
240
+
241
+ A callback function executed if a download error occurs.
242
+
243
+ ### `banner`
244
+
245
+ An image used as the banner for the video.
246
+
247
+ ## Important Notes
248
+
249
+ After the video has been successfully downloaded, make sure to:
250
+
251
+ 1. Set the `vhl_status` to `undefined`.
252
+ 2. Pass the video `id` using the `id` prop to the player to start playback and load video details.
253
+
254
+ ---
255
+
256
+ ## 🧪 Example Usage in a Next.js Component
257
+
258
+ ```tsx
259
+ import { VideoPlayerLibrary } from "cafe-video-player";
260
+
261
+ export default function HomePage() {
262
+ const params = {
263
+ vhl_status="download_start"
264
+ vhl_progress={42}
265
+ vhl_duration={300}
266
+ vhl_statusText={<p>Downloading highlights...<br />Please wait.</p>}
267
+ vhl_onRetry={handleRetry}
268
+ banner="/images/video-banner.jpg"
269
+ id="abc123"
270
+ };
271
+
272
+ return (
273
+ <div>
274
+ <VideoPlayerLibrary params={params} />
275
+ </div>
276
+ );
277
+ }
278
+ ```
279
+
280
+ # Advertisement Integration Guide
281
+
282
+ This document explains how to integrate and use the **Advertisement** feature in a Next.js project with the `cafe-video-player`.
283
+
284
+ ---
285
+
286
+ ## Overview
287
+
288
+ The Advertisement feature allows you to show video ads before playback.
289
+ It supports skip functionality, clickable ads, and callback hooks for both skipping and ad completion.
290
+
291
+ ---
292
+
293
+ ## Props
294
+
295
+ An object that must follow the `IAdvertisement` interface:
296
+
297
+ ```ts
298
+ export interface IAdvertisement {
299
+ src: string; // The ad video source URL (vast url)
300
+ onSkipAd?: (currentTime: number) => void; // Callback when the ad is skipped, receives the currentTime (optional)
301
+ onEndAd?: (currentTime: number) => void; // Callback when the ad finishes, receives the currentTime (optional)
302
+ onClickAd?: (currentTime: number) => void; // Callback when the ad button is clicked, receives the currentTime. If not defined, the ad button will not be shown (optional)
303
+ }
304
+ ```
305
+
306
+ ## 🧪 Example Usage in a Next.js Component
307
+
308
+ ```tsx
309
+ import { VideoPlayerLibrary } from "cafe-video-player";
310
+
311
+ export default function HomePage() {
312
+ const params = {
313
+ type: "vod",
314
+ id: "6623",
315
+ advertisement: {
316
+ src: "https://example.com/ad.mp4",
317
+ onSkipAd: (currentTime: number) => console.log("Ad skipped at:", currentTime),
318
+ onEndAd: (currentTime: number) => console.log("Ad ended at:", currentTime),
319
+ onClickAd: (currentTime: number) => console.log("Ad clicked at:", currentTime),
320
+ },
321
+ };
322
+
323
+ return (
324
+ <div>
325
+ <VideoPlayerLibrary params={params} />
326
+ </div>
327
+ );
328
+ }
329
+ ```