@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.
- package/README.md +114 -21
- package/RNJWPlayer.podspec +1 -1
- package/android/build.gradle +14 -1
- package/android/src/main/java/com/jwplayer/rnjwplayer/RNJWPlayerModule.java +27 -0
- package/android/src/main/java/com/jwplayer/rnjwplayer/RNJWPlayerView.java +373 -204
- package/android/src/main/java/com/jwplayer/rnjwplayer/RNJWPlayerViewManager.java +16 -0
- package/android/src/main/java/com/jwplayer/rnjwplayer/Util.java +13 -1
- package/badges/version.svg +1 -1
- package/docs/CONFIG-REFERENCE.md +747 -0
- package/docs/MIGRATION-GUIDE.md +617 -0
- package/docs/PLATFORM-DIFFERENCES.md +693 -0
- package/docs/props.md +15 -3
- package/index.d.ts +225 -216
- package/index.js +34 -0
- package/ios/RNJWPlayer/RNJWPlayerView.swift +365 -10
- package/ios/RNJWPlayer/RNJWPlayerViewController.swift +45 -16
- package/ios/RNJWPlayer/RNJWPlayerViewManager.m +2 -0
- package/ios/RNJWPlayer/RNJWPlayerViewManager.swift +13 -0
- package/package.json +2 -2
- package/types/advertising.d.ts +514 -0
- package/types/index.d.ts +21 -0
- package/types/legacy.d.ts +82 -0
- package/types/platform-specific.d.ts +641 -0
- package/types/playlist.d.ts +410 -0
- package/types/unified-config.d.ts +591 -0
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/docs/types.md +0 -254
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JWPlayer Playlist Configuration Types
|
|
3
|
+
*
|
|
4
|
+
* Unified playlist, source, and track types supporting both iOS and Android
|
|
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
|
+
import { JWAdBreak, JWImaDaiSettings } from './advertising';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Media type/format
|
|
14
|
+
*/
|
|
15
|
+
export type MediaType = 'mp4' | 'webm' | 'aac' | 'mp3' | 'hls' | 'dash' | 'm3u8' | 'mpd' | 'oga';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Track kind for captions, thumbnails, and chapters
|
|
19
|
+
*/
|
|
20
|
+
export type TrackKind = 'captions' | 'thumbnails' | 'chapters' | 'subtitles';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* DRM Configuration
|
|
24
|
+
*
|
|
25
|
+
* Platform-specific support:
|
|
26
|
+
* - iOS: FairPlay DRM
|
|
27
|
+
* - Android: Widevine DRM
|
|
28
|
+
*/
|
|
29
|
+
export interface JWDrm {
|
|
30
|
+
/**
|
|
31
|
+
* FairPlay DRM configuration
|
|
32
|
+
* @platform ios
|
|
33
|
+
*/
|
|
34
|
+
fairplay?: {
|
|
35
|
+
/**
|
|
36
|
+
* URL for processing SPC (Server Playback Context)
|
|
37
|
+
*/
|
|
38
|
+
processSpcUrl?: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* URL for FairPlay certificate
|
|
42
|
+
*/
|
|
43
|
+
certificateUrl?: string;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Widevine DRM configuration
|
|
48
|
+
* @platform android
|
|
49
|
+
*/
|
|
50
|
+
widevine?: {
|
|
51
|
+
/**
|
|
52
|
+
* License server URL
|
|
53
|
+
*/
|
|
54
|
+
url: string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Optional key set ID for offline playback
|
|
58
|
+
*/
|
|
59
|
+
keySetId?: string;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* PlayReady DRM configuration (Android)
|
|
64
|
+
* @platform android
|
|
65
|
+
*/
|
|
66
|
+
playready?: Record<string, string>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Video source representing a specific quality level
|
|
71
|
+
*
|
|
72
|
+
* @platforms iOS, Android
|
|
73
|
+
*/
|
|
74
|
+
export interface JWSource {
|
|
75
|
+
/**
|
|
76
|
+
* URL of the video source file
|
|
77
|
+
* Required.
|
|
78
|
+
*/
|
|
79
|
+
file: string;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Label for the quality level (e.g., "1080p", "720p", "Auto")
|
|
83
|
+
* Auto-generated if not provided
|
|
84
|
+
*/
|
|
85
|
+
label?: string;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Media type/format
|
|
89
|
+
*/
|
|
90
|
+
type?: MediaType;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Whether this is the default quality level
|
|
94
|
+
* @default false
|
|
95
|
+
*/
|
|
96
|
+
default?: boolean;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Alternative naming for default quality
|
|
100
|
+
*/
|
|
101
|
+
defaultQuality?: boolean;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* DRM configuration for this source
|
|
105
|
+
*/
|
|
106
|
+
drm?: JWDrm;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Custom HTTP headers for this source
|
|
110
|
+
* @platform android
|
|
111
|
+
*/
|
|
112
|
+
httpheaders?: Record<string, string>;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Media track for captions, thumbnails, or chapters
|
|
117
|
+
*
|
|
118
|
+
* @platforms iOS, Android
|
|
119
|
+
*/
|
|
120
|
+
export interface JWTrack {
|
|
121
|
+
/**
|
|
122
|
+
* URL to the track file
|
|
123
|
+
* Required.
|
|
124
|
+
*/
|
|
125
|
+
file: string;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Type of track
|
|
129
|
+
* - "captions": Subtitle/caption track
|
|
130
|
+
* - "thumbnails": Thumbnail preview track (must be WebVTT)
|
|
131
|
+
* - "chapters": Chapter markers track
|
|
132
|
+
* - "subtitles": Subtitle track (Android)
|
|
133
|
+
*/
|
|
134
|
+
kind: TrackKind;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Label shown in the player UI
|
|
138
|
+
* For captions: shown in captions menu
|
|
139
|
+
* For thumbnails/chapters: not displayed
|
|
140
|
+
*/
|
|
141
|
+
label?: string;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Whether this track should be shown by default
|
|
145
|
+
* Only applies to captions
|
|
146
|
+
* @default false
|
|
147
|
+
*/
|
|
148
|
+
default?: boolean;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Locale/language code for the track (e.g., "en", "es", "fr")
|
|
152
|
+
* Primarily used for caption tracks
|
|
153
|
+
*/
|
|
154
|
+
locale?: string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Alternative naming for locale
|
|
158
|
+
* @platform android
|
|
159
|
+
*/
|
|
160
|
+
language?: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Whether this track is included in the HLS manifest
|
|
164
|
+
* If true, the side-loaded track will be ignored
|
|
165
|
+
* @default false
|
|
166
|
+
* @platform ios
|
|
167
|
+
*/
|
|
168
|
+
includedInManifest?: boolean;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Unique identifier for this track
|
|
172
|
+
* @platform android
|
|
173
|
+
*/
|
|
174
|
+
id?: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* External metadata for timed events
|
|
179
|
+
*
|
|
180
|
+
* Supplements the encoded metadata of the media asset.
|
|
181
|
+
* Triggers timed events during playback.
|
|
182
|
+
*
|
|
183
|
+
* Maximum 5 items; excess will be ignored.
|
|
184
|
+
*
|
|
185
|
+
* @platform ios
|
|
186
|
+
*/
|
|
187
|
+
export interface JWExternalMetadata {
|
|
188
|
+
/**
|
|
189
|
+
* Unique identifier for this metadata item
|
|
190
|
+
* Required.
|
|
191
|
+
*/
|
|
192
|
+
identifier: string;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Alternative naming for identifier
|
|
196
|
+
*/
|
|
197
|
+
id?: number;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Start time in seconds
|
|
201
|
+
* Required.
|
|
202
|
+
*/
|
|
203
|
+
startTime: number;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* End time in seconds
|
|
207
|
+
* Required.
|
|
208
|
+
*/
|
|
209
|
+
endTime: number;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Playlist item configuration
|
|
214
|
+
*
|
|
215
|
+
* Individual media item in a playlist
|
|
216
|
+
*
|
|
217
|
+
* @platforms iOS, Android
|
|
218
|
+
*/
|
|
219
|
+
export interface JWPlaylistItem {
|
|
220
|
+
// ========== MEDIA SOURCE (Required: file OR sources) ==========
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* URL of the media file
|
|
224
|
+
* Mutually exclusive with `sources`
|
|
225
|
+
*/
|
|
226
|
+
file?: string;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Array of video sources for multiple quality levels
|
|
230
|
+
* Mutually exclusive with `file`
|
|
231
|
+
*/
|
|
232
|
+
sources?: JWSource[];
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Alternative naming for sources (iOS)
|
|
236
|
+
* @platform ios
|
|
237
|
+
*/
|
|
238
|
+
allSources?: JWSource[];
|
|
239
|
+
|
|
240
|
+
// ========== METADATA ==========
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Title of the media item
|
|
244
|
+
*/
|
|
245
|
+
title?: string;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Description of the media item
|
|
249
|
+
*/
|
|
250
|
+
description?: string;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* URL of the poster image
|
|
254
|
+
*/
|
|
255
|
+
image?: string;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Media identifier
|
|
259
|
+
*
|
|
260
|
+
* Note: Native parsers use lowercase `mediaid`, but `mediaId` is preferred
|
|
261
|
+
*/
|
|
262
|
+
mediaId?: string;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Legacy naming (lowercase) - still supported
|
|
266
|
+
*/
|
|
267
|
+
mediaid?: string;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Feed ID for related content
|
|
271
|
+
*/
|
|
272
|
+
feedid?: string;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Alternative naming for feedId
|
|
276
|
+
*/
|
|
277
|
+
feedId?: string;
|
|
278
|
+
|
|
279
|
+
// ========== PLAYBACK SETTINGS ==========
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Start time in seconds
|
|
283
|
+
* Where to begin playback
|
|
284
|
+
* @default 0
|
|
285
|
+
*/
|
|
286
|
+
starttime?: number;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Alternative naming for startTime
|
|
290
|
+
*/
|
|
291
|
+
startTime?: number;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Duration of the media item in seconds
|
|
295
|
+
* Typically used for related items
|
|
296
|
+
*/
|
|
297
|
+
duration?: number;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Whether to autostart this item
|
|
301
|
+
* @platform android
|
|
302
|
+
*/
|
|
303
|
+
autostart?: boolean;
|
|
304
|
+
|
|
305
|
+
// ========== TRACKS (CAPTIONS, THUMBNAILS, CHAPTERS) ==========
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Array of caption, thumbnail, or chapter tracks
|
|
309
|
+
*/
|
|
310
|
+
tracks?: JWTrack[];
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Array of caption tracks only
|
|
314
|
+
* Alternative to specifying captions in `tracks` array
|
|
315
|
+
*/
|
|
316
|
+
captions?: JWTrack[];
|
|
317
|
+
|
|
318
|
+
// ========== ITEM-LEVEL ADVERTISING ==========
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Ad schedule for this item
|
|
322
|
+
* Can be:
|
|
323
|
+
* - VMAP URL or XML string
|
|
324
|
+
* - Object with ad breaks keyed by offset
|
|
325
|
+
* - Array of ad breaks
|
|
326
|
+
*
|
|
327
|
+
* Note: Prefer camelCase `adSchedule` but `adschedule` is supported
|
|
328
|
+
*/
|
|
329
|
+
adSchedule?: string | Record<string, JWAdBreak> | JWAdBreak[];
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Alternative naming (lowercase) - still supported
|
|
333
|
+
*/
|
|
334
|
+
adschedule?: string | Record<string, JWAdBreak> | JWAdBreak[];
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Alternative naming - still supported
|
|
338
|
+
*/
|
|
339
|
+
schedule?: string | Record<string, JWAdBreak> | JWAdBreak[];
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Google DAI stream settings for this item
|
|
343
|
+
*
|
|
344
|
+
* Platform-specific naming:
|
|
345
|
+
* - iOS: `daiSetting` (singular)
|
|
346
|
+
* - Android: `imaDaiSettings` (plural)
|
|
347
|
+
* Both are supported
|
|
348
|
+
*/
|
|
349
|
+
imaDaiSettings?: JWImaDaiSettings;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* iOS naming for DAI settings
|
|
353
|
+
* @platform ios
|
|
354
|
+
*/
|
|
355
|
+
daiSetting?: JWImaDaiSettings;
|
|
356
|
+
|
|
357
|
+
// ========== RELATED CONTENT ==========
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* URL to a feed containing related items for this specific item
|
|
361
|
+
*/
|
|
362
|
+
recommendations?: string;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Link URL for the item
|
|
366
|
+
*/
|
|
367
|
+
link?: string;
|
|
368
|
+
|
|
369
|
+
// ========== CHROMECAST ==========
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Custom user data for Chromecast
|
|
373
|
+
* Data to be passed to Chromecast receiver (optional and typically used for DRM implementations)
|
|
374
|
+
*/
|
|
375
|
+
userInfo?: Record<string, any>;
|
|
376
|
+
|
|
377
|
+
// ========== PLATFORM-SPECIFIC ==========
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Custom HTTP headers for this item
|
|
381
|
+
* @platform android
|
|
382
|
+
*/
|
|
383
|
+
httpheaders?: Record<string, string>;
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* AVAsset initialization options
|
|
387
|
+
* See Apple's AVURLAsset Initialization Options documentation
|
|
388
|
+
* @platform ios
|
|
389
|
+
*/
|
|
390
|
+
assetOptions?: Record<string, any>;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Array of external metadata for this item
|
|
394
|
+
* Overrides player-level external metadata
|
|
395
|
+
* Maximum 5 items
|
|
396
|
+
* @platform ios
|
|
397
|
+
*/
|
|
398
|
+
externalMetadata?: JWExternalMetadata[];
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* DRM configuration for this item
|
|
402
|
+
*/
|
|
403
|
+
drm?: JWDrm;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Playlist type - array of items or URL string
|
|
408
|
+
*/
|
|
409
|
+
export type Playlist = JWPlaylistItem[] | string;
|
|
410
|
+
|