@jwplayer/jwplayer-react-native 1.1.3 → 1.3.0

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.
Files changed (36) hide show
  1. package/README.md +114 -21
  2. package/RNJWPlayer.podspec +1 -1
  3. package/android/build.gradle +14 -1
  4. package/android/src/main/java/com/jwplayer/rnjwplayer/RNJWPlayerModule.java +27 -0
  5. package/android/src/main/java/com/jwplayer/rnjwplayer/RNJWPlayerView.java +373 -204
  6. package/android/src/main/java/com/jwplayer/rnjwplayer/RNJWPlayerViewManager.java +16 -0
  7. package/android/src/main/java/com/jwplayer/rnjwplayer/Util.java +13 -1
  8. package/badges/version.svg +1 -1
  9. package/docs/CONFIG-REFERENCE.md +747 -0
  10. package/docs/MIGRATION-GUIDE.md +617 -0
  11. package/docs/PLATFORM-DIFFERENCES.md +693 -0
  12. package/docs/props.md +15 -3
  13. package/index.d.ts +225 -216
  14. package/index.js +34 -0
  15. package/ios/RNJWPlayer/RNJWPlayerView.swift +365 -10
  16. package/ios/RNJWPlayer/RNJWPlayerViewController.swift +45 -16
  17. package/ios/RNJWPlayer/RNJWPlayerViewManager.m +2 -0
  18. package/ios/RNJWPlayer/RNJWPlayerViewManager.swift +13 -0
  19. package/package.json +2 -2
  20. package/types/advertising.d.ts +514 -0
  21. package/types/index.d.ts +21 -0
  22. package/types/legacy.d.ts +82 -0
  23. package/types/platform-specific.d.ts +641 -0
  24. package/types/playlist.d.ts +410 -0
  25. package/types/unified-config.d.ts +591 -0
  26. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  27. package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
  28. package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
  29. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  30. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  31. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  32. package/android/.gradle/8.9/gc.properties +0 -0
  33. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  34. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  35. package/android/.gradle/vcs-1/gc.properties +0 -0
  36. package/docs/types.md +0 -254
@@ -0,0 +1,514 @@
1
+ /**
2
+ * JWPlayer Advertising Configuration Types
3
+ *
4
+ * Unified advertising types supporting both iOS (JWJSONParser) and Android (JsonHelper)
5
+ *
6
+ * @see iOS: ios-json-parser/jwplayer-config.d.ts
7
+ * @see Android: android-json-parser/jwplayer-config-types.d.ts
8
+ */
9
+
10
+ /**
11
+ * Ad client types supported across platforms
12
+ */
13
+ export type AdClient =
14
+ | 'vast' // VAST ads (both platforms)
15
+ | 'VAST' // VAST ads alternative (both platforms)
16
+ | 'googima' // Google IMA (both platforms)
17
+ | 'IMA' // Google IMA alternative (Android)
18
+ | 'GOOGIMA' // Google IMA alternative (Android)
19
+ | 'dai' // Google DAI (iOS)
20
+ | 'GoogleIMADAI' // Google DAI (iOS)
21
+ | 'IMA_DAI'; // Google DAI (Android)
22
+
23
+ /**
24
+ * Ad break type
25
+ */
26
+ export type AdType = 'linear' | 'nonlinear' | 'LINEAR' | 'NONLINEAR';
27
+
28
+ /**
29
+ * Stream type for IMA DAI
30
+ */
31
+ export type StreamType = 'hls' | 'HLS' | 'dash' | 'DASH';
32
+
33
+ /**
34
+ * OMID (Open Measurement Interface Definition) support levels
35
+ */
36
+ export type OmidSupport = 'auto' | 'enabled' | 'disabled';
37
+
38
+ /**
39
+ * Ad break offset - when to show the ad
40
+ * - "pre": Preroll (before content)
41
+ * - "post": Postroll (after content)
42
+ * - Number: Midroll at N seconds
43
+ * - "N%": Midroll at N% of content duration
44
+ */
45
+ export type AdOffset = 'pre' | 'post' | string | number;
46
+
47
+ /**
48
+ * Start on seek behavior for ad rules
49
+ */
50
+ export type StartOnSeek = 'none' | 'pre';
51
+
52
+ /**
53
+ * IMA SDK Settings
54
+ * Controls the behavior of the Google IMA SDK
55
+ *
56
+ * @platforms iOS, Android
57
+ */
58
+ export interface JWImaSdkSettings {
59
+ /**
60
+ * Session ID for tracking
61
+ */
62
+ sessionId?: string;
63
+
64
+ /**
65
+ * Publisher Provided ID for tracking
66
+ */
67
+ ppid?: string;
68
+
69
+ /**
70
+ * Whether to auto-play ad breaks
71
+ * @default false
72
+ */
73
+ autoPlayAdBreaks?: boolean;
74
+
75
+ /**
76
+ * Language code (e.g., 'en', 'es', 'el')
77
+ */
78
+ language?: string;
79
+
80
+ /**
81
+ * Maximum number of redirects to follow for ad tags
82
+ * @default 0
83
+ */
84
+ maxRedirects?: number;
85
+
86
+ /**
87
+ * Player type identifier
88
+ */
89
+ playerType?: string;
90
+
91
+ /**
92
+ * Player version identifier
93
+ */
94
+ playerVersion?: string;
95
+
96
+ /**
97
+ * Enable debug mode for IMA SDK
98
+ * @default false
99
+ */
100
+ isDebugMode?: boolean;
101
+
102
+ /**
103
+ * Restrict to custom player
104
+ * @default false
105
+ * @platform android
106
+ */
107
+ doesRestrictToCustomPlayer?: boolean;
108
+
109
+ /**
110
+ * Locale for IMA SDK (alternative to language)
111
+ * @platform ios
112
+ */
113
+ locale?: string;
114
+
115
+ /**
116
+ * Enable debug mode (alternative naming)
117
+ * @platform ios
118
+ */
119
+ debug?: boolean;
120
+ }
121
+
122
+ /**
123
+ * IMA DAI (Dynamic Ad Insertion) Settings
124
+ *
125
+ * Must specify either:
126
+ * - VOD stream: `videoId` + `cmsId`
127
+ * - Live stream: `assetKey`
128
+ *
129
+ * @platforms iOS, Android
130
+ */
131
+ export interface JWImaDaiSettings {
132
+ /**
133
+ * Video ID for VOD DAI stream
134
+ * Must be used with `cmsId`
135
+ * Mutually exclusive with `assetKey`
136
+ *
137
+ * Note: iOS parser accepts `videoID` (uppercase), but `videoId` is preferred
138
+ */
139
+ videoId?: string;
140
+
141
+ /**
142
+ * Content source ID for VOD DAI stream
143
+ * Must be used with `videoId`
144
+ * Mutually exclusive with `assetKey`
145
+ *
146
+ * Note: iOS parser accepts `cmsID` (uppercase), but `cmsId` is preferred
147
+ */
148
+ cmsId?: string;
149
+
150
+ /**
151
+ * Asset key for live DAI stream
152
+ * Mutually exclusive with `videoId` and `cmsId`
153
+ */
154
+ assetKey?: string;
155
+
156
+ /**
157
+ * API key for verifying the application
158
+ */
159
+ apiKey?: string;
160
+
161
+ /**
162
+ * Stream type: 'hls' or 'dash'
163
+ * @default 'hls'
164
+ */
165
+ streamType?: StreamType;
166
+
167
+ /**
168
+ * Additional ad tag parameters
169
+ * Used to override ad tag parameters in the stream request
170
+ */
171
+ adTagParameters?: Record<string, string>;
172
+ }
173
+
174
+ /**
175
+ * Ad break configuration
176
+ * Defines a single ad break in the schedule
177
+ *
178
+ * @platforms iOS, Android
179
+ */
180
+ export interface JWAdBreak {
181
+ /**
182
+ * Ad tag URL or array of URLs
183
+ */
184
+ tag?: string | string[];
185
+
186
+ /**
187
+ * Ad configuration (alternative structure)
188
+ * Used in some Android configurations
189
+ */
190
+ ad?: {
191
+ /**
192
+ * Ad source identifier
193
+ */
194
+ source?: string;
195
+
196
+ /**
197
+ * Ad tag URL
198
+ */
199
+ tag?: string;
200
+ };
201
+
202
+ /**
203
+ * When to play the ad break
204
+ * - "pre": Preroll (before content)
205
+ * - "post": Postroll (after content)
206
+ * - "123": Midroll at 123 seconds
207
+ * - "50%": Midroll at 50% of content duration
208
+ *
209
+ * @default "pre"
210
+ */
211
+ offset?: AdOffset;
212
+
213
+ /**
214
+ * Skip offset in seconds
215
+ * Time before the skip button appears for this break
216
+ */
217
+ skipoffset?: number;
218
+
219
+ /**
220
+ * Ad break type
221
+ * @default "linear"
222
+ */
223
+ type?: AdType;
224
+
225
+ /**
226
+ * Custom parameters for the ad request
227
+ */
228
+ custParams?: Record<string, string>;
229
+ }
230
+
231
+ /**
232
+ * Ad schedule - can be array or object with named breaks
233
+ */
234
+ export type AdSchedule = JWAdBreak[] | Record<string, JWAdBreak> | string;
235
+
236
+ /**
237
+ * Ad playback rules
238
+ * Controls how ads are played across a playlist
239
+ *
240
+ * @platforms iOS (limited), Android (full support)
241
+ */
242
+ export interface JWAdRules {
243
+ /**
244
+ * Which playlist item to start showing ads on (1-based)
245
+ * @default 1
246
+ */
247
+ startOn?: number;
248
+
249
+ /**
250
+ * Show ads every N playlist items
251
+ * @default 1
252
+ */
253
+ frequency?: number;
254
+
255
+ /**
256
+ * Minimum seconds between midroll ad breaks
257
+ * @default 0
258
+ * @platform android
259
+ */
260
+ timeBetweenAds?: number;
261
+
262
+ /**
263
+ * When to show ads after seeking
264
+ * - "none": Don't show ads after seeking
265
+ * - "pre": Show preroll after seeking
266
+ * @platform android
267
+ */
268
+ startOnSeek?: StartOnSeek;
269
+ }
270
+
271
+ /**
272
+ * Base advertising configuration
273
+ * Common properties shared across all ad types
274
+ */
275
+ export interface BaseAdvertisingConfig {
276
+ /**
277
+ * Skip offset in seconds
278
+ * Time before the skip button appears
279
+ * Can be a number or a percentage string (e.g., "50%")
280
+ */
281
+ skipoffset?: number | string;
282
+
283
+ /**
284
+ * Ad countdown text (e.g., "Ad - xx")
285
+ * Shown during ad playback
286
+ */
287
+ admessage?: string;
288
+
289
+ /**
290
+ * Skip delay text (e.g., "Skip in xx")
291
+ * Shown before skip is available
292
+ */
293
+ skipmessage?: string;
294
+
295
+ /**
296
+ * Skip button text (e.g., "Skip Ad")
297
+ * Shown when skip is available
298
+ */
299
+ skiptext?: string;
300
+
301
+ /**
302
+ * Cue text for ad markers
303
+ * @platform android
304
+ */
305
+ cuetext?: string;
306
+
307
+ /**
308
+ * Ad pod message (e.g., "Ad 1 of 3")
309
+ * @platform android
310
+ */
311
+ adpodmessage?: string;
312
+
313
+ /**
314
+ * Enable VPAID controls
315
+ * @platform android
316
+ */
317
+ vpaidcontrols?: boolean;
318
+
319
+ /**
320
+ * Request timeout in milliseconds
321
+ * @platform android
322
+ */
323
+ requestTimeout?: number;
324
+
325
+ /**
326
+ * Creative timeout in milliseconds
327
+ * @platform android
328
+ */
329
+ creativeTimeout?: number;
330
+
331
+ /**
332
+ * Conditional ad opt-out
333
+ * @platform android
334
+ */
335
+ conditionaladoptout?: boolean;
336
+
337
+ /**
338
+ * OMID support level
339
+ * @default 'disabled'
340
+ */
341
+ omidSupport?: OmidSupport;
342
+
343
+ /**
344
+ * List of allowed OMID vendor keys
345
+ */
346
+ allowedOmidVendors?: string[];
347
+
348
+ /**
349
+ * Ad playback rules for playlist-level control
350
+ * Primary support on Android, limited on iOS
351
+ */
352
+ rules?: JWAdRules;
353
+ }
354
+
355
+ /**
356
+ * VAST Advertising Configuration with Schedule
357
+ * For VAST ads with an array or object schedule
358
+ *
359
+ * @platforms iOS, Android
360
+ */
361
+ export interface VastAdvertisingConfig extends BaseAdvertisingConfig {
362
+ client: 'vast' | 'VAST';
363
+
364
+ /**
365
+ * Ad schedule - array or object of ad breaks
366
+ */
367
+ schedule?: AdSchedule;
368
+ }
369
+
370
+ /**
371
+ * VMAP Advertising Configuration
372
+ * For VAST ads with a VMAP tag URL
373
+ *
374
+ * @platforms iOS, Android
375
+ */
376
+ export interface VmapAdvertisingConfig extends BaseAdvertisingConfig {
377
+ client: 'vast' | 'VAST';
378
+
379
+ /**
380
+ * VMAP tag URL or XML string
381
+ */
382
+ tag?: string;
383
+
384
+ /**
385
+ * Alternative way to specify VMAP URL (as string)
386
+ */
387
+ schedule?: string;
388
+ }
389
+
390
+ /**
391
+ * Google IMA Advertising Configuration
392
+ * For Google IMA ads with a schedule
393
+ *
394
+ * @platforms iOS, Android
395
+ */
396
+ export interface ImaAdvertisingConfig extends BaseAdvertisingConfig {
397
+ client: 'googima' | 'IMA' | 'GOOGIMA';
398
+
399
+ /**
400
+ * Single ad tag URL
401
+ */
402
+ tag?: string;
403
+
404
+ /**
405
+ * Ad schedule - array or object of ad breaks
406
+ */
407
+ schedule?: AdSchedule;
408
+
409
+ /**
410
+ * Google IMA SDK settings
411
+ */
412
+ imaSdkSettings?: JWImaSdkSettings;
413
+
414
+ /**
415
+ * Alternative naming for IMA settings (iOS)
416
+ * @platform ios
417
+ */
418
+ imaSettings?: JWImaSdkSettings;
419
+
420
+ /**
421
+ * Enable debug mode
422
+ */
423
+ debug?: boolean;
424
+ }
425
+
426
+ /**
427
+ * Google IMA DAI Advertising Configuration
428
+ * For Google IMA Dynamic Ad Insertion
429
+ *
430
+ * @platforms iOS, Android
431
+ *
432
+ * @example VOD Stream
433
+ * ```typescript
434
+ * {
435
+ * client: 'dai',
436
+ * imaDaiSettings: {
437
+ * videoId: 'tears-of-steel',
438
+ * cmsId: '2528370',
439
+ * streamType: 'hls'
440
+ * }
441
+ * }
442
+ * ```
443
+ *
444
+ * @example Live Stream
445
+ * ```typescript
446
+ * {
447
+ * client: 'dai',
448
+ * imaDaiSettings: {
449
+ * assetKey: 'sN_IYUG8STe1ZzhIIE_ksA',
450
+ * streamType: 'hls'
451
+ * }
452
+ * }
453
+ * ```
454
+ */
455
+ export interface ImaDaiAdvertisingConfig {
456
+ client: 'dai' | 'GoogleIMADAI' | 'IMA_DAI';
457
+
458
+ /**
459
+ * IMA DAI settings
460
+ *
461
+ * Platform-specific naming:
462
+ * - iOS: Prefers `googimadai` but accepts `imaDaiSettings`
463
+ * - Android: Uses `imaDaiSettings`
464
+ *
465
+ * **Recommendation:** Use `imaDaiSettings` for cross-platform compatibility
466
+ */
467
+ imaDaiSettings?: JWImaDaiSettings;
468
+
469
+ /**
470
+ * iOS-style naming for DAI settings (alias)
471
+ * @platform ios
472
+ */
473
+ googimadai?: JWImaDaiSettings;
474
+
475
+ /**
476
+ * Alternative naming used in iOS parser
477
+ * @platform ios
478
+ */
479
+ googleimadaisettings?: JWImaDaiSettings;
480
+
481
+ /**
482
+ * Google IMA SDK settings
483
+ */
484
+ imaSdkSettings?: JWImaSdkSettings;
485
+
486
+ /**
487
+ * Alternative naming for IMA settings (iOS)
488
+ * @platform ios
489
+ */
490
+ imaSettings?: JWImaSdkSettings;
491
+
492
+ /**
493
+ * Skip offset in seconds
494
+ */
495
+ skipoffset?: number;
496
+ }
497
+
498
+ /**
499
+ * Unified Advertising Configuration
500
+ *
501
+ * Supports all ad types across iOS and Android:
502
+ * - VAST with schedule
503
+ * - VMAP with tag URL
504
+ * - Google IMA with schedule
505
+ * - Google IMA DAI (VOD and Live)
506
+ *
507
+ * @platforms iOS, Android
508
+ */
509
+ export type JWAdvertisingConfig =
510
+ | VastAdvertisingConfig
511
+ | VmapAdvertisingConfig
512
+ | ImaAdvertisingConfig
513
+ | ImaDaiAdvertisingConfig;
514
+
@@ -0,0 +1,21 @@
1
+ /**
2
+ * JWPlayer React Native Unified Types
3
+ *
4
+ * Export all unified configuration types for use in the wrapper
5
+ */
6
+
7
+ // Core unified configuration
8
+ export * from './unified-config';
9
+
10
+ // Advertising types
11
+ export * from './advertising';
12
+
13
+ // Playlist and media types
14
+ export * from './playlist';
15
+
16
+ // Platform-specific types
17
+ export * from './platform-specific';
18
+
19
+ // Legacy types (deprecated but maintained for backward compatibility)
20
+ export * from './legacy';
21
+
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Legacy Type Definitions
3
+ *
4
+ * These types are maintained for backward compatibility with existing code.
5
+ * New code should use the unified types from unified-config.d.ts
6
+ *
7
+ * @deprecated Use unified types instead
8
+ */
9
+
10
+ import { JWPlayerConfig } from './unified-config';
11
+ import { JWAdvertisingConfig, JWImaDaiSettings, JWImaSdkSettings } from './advertising';
12
+ import { JWPlaylistItem, JWSource, JWTrack } from './playlist';
13
+ import {
14
+ JWStyling,
15
+ JWUiConfig,
16
+ JWLogoView,
17
+ JWRelatedConfig,
18
+ AudioSessionCategory,
19
+ AudioSessionCategoryOptions,
20
+ AudioSessionMode,
21
+ } from './platform-specific';
22
+
23
+ /**
24
+ * @deprecated Use JWPlayerConfig instead
25
+ */
26
+ export type JwConfig = JWPlayerConfig;
27
+
28
+ /**
29
+ * @deprecated Use JWPlayerConfig instead
30
+ */
31
+ export type Config = JWPlayerConfig;
32
+
33
+ /**
34
+ * @deprecated Use JWPlaylistItem instead
35
+ */
36
+ export type PlaylistItem = JWPlaylistItem;
37
+
38
+ /**
39
+ * @deprecated Use JWSource instead
40
+ */
41
+ export type Source = JWSource;
42
+
43
+ /**
44
+ * @deprecated Use JWTrack instead
45
+ */
46
+ export type Track = JWTrack;
47
+
48
+ /**
49
+ * @deprecated Use JWAdvertisingConfig instead
50
+ */
51
+ export type Advertising = JWAdvertisingConfig;
52
+
53
+ /**
54
+ * @deprecated Use JWImaDaiSettings instead
55
+ */
56
+ export type ImaDaiSettings = JWImaDaiSettings;
57
+
58
+ /**
59
+ * @deprecated Use JWImaSdkSettings instead
60
+ */
61
+ export type ImaSdkSettings = JWImaSdkSettings;
62
+
63
+ /**
64
+ * @deprecated Use JWStyling instead
65
+ */
66
+ export type Styling = JWStyling;
67
+
68
+ /**
69
+ * @deprecated Use JWUiConfig instead
70
+ */
71
+ export type UiConfig = JWUiConfig;
72
+
73
+ /**
74
+ * @deprecated Use JWLogoView instead
75
+ */
76
+ export type LogoView = JWLogoView;
77
+
78
+ /**
79
+ * @deprecated Use JWRelatedConfig instead
80
+ */
81
+ export type Related = JWRelatedConfig;
82
+