@gcorevideo/player 2.12.2 → 2.14.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 (42) hide show
  1. package/dist/index.js +63 -6
  2. package/dist/player.d.ts +71 -11
  3. package/docs/api/player.errorlevel.md +15 -0
  4. package/docs/api/player.md +77 -0
  5. package/docs/api/player.mediatransport.md +1 -1
  6. package/docs/api/player.playbackerror.code.md +14 -0
  7. package/docs/api/player.playbackerror.description.md +14 -0
  8. package/docs/api/player.playbackerror.level.md +14 -0
  9. package/docs/api/player.playbackerror.md +116 -0
  10. package/docs/api/player.playbackerror.message.md +14 -0
  11. package/docs/api/player.playbackerrorcode.md +83 -0
  12. package/docs/api/player.playbackmodule.md +1 -1
  13. package/docs/api/player.playerconfig.md +2 -2
  14. package/docs/api/player.playerconfig.strings.md +1 -1
  15. package/docs/api/player.playerplugin.md +1 -1
  16. package/docs/api/player.timeposition.md +21 -0
  17. package/docs/api/player.timeprogress.md +20 -0
  18. package/docs/api/player.timeupdate.md +20 -0
  19. package/docs/api/player.timevalue.md +16 -0
  20. package/docs/api/player.transportpreference.md +1 -1
  21. package/lib/index.d.ts +1 -0
  22. package/lib/index.d.ts.map +1 -1
  23. package/lib/index.js +1 -0
  24. package/lib/playback.types.d.ts +7 -4
  25. package/lib/playback.types.d.ts.map +1 -1
  26. package/lib/testUtils.d.ts +34 -0
  27. package/lib/testUtils.d.ts.map +1 -0
  28. package/lib/testUtils.js +58 -0
  29. package/lib/types.d.ts +2 -2
  30. package/lib/types.d.ts.map +1 -1
  31. package/lib/utils/mediaSources.d.ts.map +1 -1
  32. package/lib/utils/mediaSources.js +2 -3
  33. package/package.json +1 -1
  34. package/src/__tests__/Player.test.ts +0 -122
  35. package/src/index.ts +1 -0
  36. package/src/playback.types.ts +7 -4
  37. package/src/testUtils.ts +80 -0
  38. package/src/types.ts +2 -2
  39. package/src/utils/__tests__/mediaSources.test.ts +0 -41
  40. package/src/utils/mediaSources.ts +3 -4
  41. package/temp/player.api.json +373 -11
  42. package/tsconfig.tsbuildinfo +1 -1
@@ -38,10 +38,10 @@ export function buildSourcesSet(sources: PlayerMediaSource[]): SourceVariants {
38
38
 
39
39
  export function buildMediaSourcesList(
40
40
  sources: PlayerMediaSourceDesc[],
41
- priorityTransport: TransportPreference = 'auto',
41
+ priorityTransport: TransportPreference = 'dash',
42
42
  ): PlayerMediaSourceDesc[] {
43
43
  const [preferred, rest] = sources.reduce(
44
- priorityTransport === 'dash' || priorityTransport === 'auto'
44
+ priorityTransport === 'dash'
45
45
  ? (
46
46
  acc: [PlayerMediaSourceDesc[], PlayerMediaSourceDesc[]],
47
47
  item: PlayerMediaSourceDesc,
@@ -77,14 +77,13 @@ export function wrapSource(s: PlayerMediaSource): PlayerMediaSourceDesc {
77
77
  return typeof s === 'string' ? { source: s, mimeType: guessMimeType(s) } : s
78
78
  }
79
79
 
80
- function guessMimeType(s: string): string {
80
+ function guessMimeType(s: string): string | undefined {
81
81
  if (s.endsWith('.mpd')) {
82
82
  return 'application/dash+xml'
83
83
  }
84
84
  if (s.endsWith('.m3u8')) {
85
85
  return 'application/vnd.apple.mpegurl'
86
86
  }
87
- throw new Error('Unrecognized media source type')
88
87
  }
89
88
 
90
89
  export function isDashSource(source: string, mimeType?: string) {
@@ -203,6 +203,32 @@
203
203
  "endIndex": 3
204
204
  }
205
205
  },
206
+ {
207
+ "kind": "TypeAlias",
208
+ "canonicalReference": "@gcorevideo/player!ErrorLevel:type",
209
+ "docComment": "/**\n * @beta\n */\n",
210
+ "excerptTokens": [
211
+ {
212
+ "kind": "Content",
213
+ "text": "export type ErrorLevel = "
214
+ },
215
+ {
216
+ "kind": "Content",
217
+ "text": "'FATAL' | 'WARN' | 'INFO'"
218
+ },
219
+ {
220
+ "kind": "Content",
221
+ "text": ";"
222
+ }
223
+ ],
224
+ "fileUrlPath": "src/playback.types.ts",
225
+ "releaseTag": "Beta",
226
+ "name": "ErrorLevel",
227
+ "typeTokenRange": {
228
+ "startIndex": 1,
229
+ "endIndex": 2
230
+ }
231
+ },
206
232
  {
207
233
  "kind": "TypeAlias",
208
234
  "canonicalReference": "@gcorevideo/player!LangTag:type",
@@ -240,7 +266,7 @@
240
266
  },
241
267
  {
242
268
  "kind": "Content",
243
- "text": "'dash' | 'hls' | 'mpegts'"
269
+ "text": "'dash' | 'hls'"
244
270
  },
245
271
  {
246
272
  "kind": "Content",
@@ -255,6 +281,214 @@
255
281
  "endIndex": 2
256
282
  }
257
283
  },
284
+ {
285
+ "kind": "Interface",
286
+ "canonicalReference": "@gcorevideo/player!PlaybackError:interface",
287
+ "docComment": "/**\n * @beta\n */\n",
288
+ "excerptTokens": [
289
+ {
290
+ "kind": "Content",
291
+ "text": "export interface PlaybackError "
292
+ }
293
+ ],
294
+ "fileUrlPath": "src/playback.types.ts",
295
+ "releaseTag": "Beta",
296
+ "name": "PlaybackError",
297
+ "preserveMemberOrder": false,
298
+ "members": [
299
+ {
300
+ "kind": "PropertySignature",
301
+ "canonicalReference": "@gcorevideo/player!PlaybackError#code:member",
302
+ "docComment": "",
303
+ "excerptTokens": [
304
+ {
305
+ "kind": "Content",
306
+ "text": "code: "
307
+ },
308
+ {
309
+ "kind": "Reference",
310
+ "text": "PlaybackErrorCode",
311
+ "canonicalReference": "@gcorevideo/player!PlaybackErrorCode:enum"
312
+ },
313
+ {
314
+ "kind": "Content",
315
+ "text": ";"
316
+ }
317
+ ],
318
+ "isReadonly": false,
319
+ "isOptional": false,
320
+ "releaseTag": "Beta",
321
+ "name": "code",
322
+ "propertyTypeTokenRange": {
323
+ "startIndex": 1,
324
+ "endIndex": 2
325
+ }
326
+ },
327
+ {
328
+ "kind": "PropertySignature",
329
+ "canonicalReference": "@gcorevideo/player!PlaybackError#description:member",
330
+ "docComment": "",
331
+ "excerptTokens": [
332
+ {
333
+ "kind": "Content",
334
+ "text": "description: "
335
+ },
336
+ {
337
+ "kind": "Content",
338
+ "text": "string"
339
+ },
340
+ {
341
+ "kind": "Content",
342
+ "text": ";"
343
+ }
344
+ ],
345
+ "isReadonly": false,
346
+ "isOptional": false,
347
+ "releaseTag": "Beta",
348
+ "name": "description",
349
+ "propertyTypeTokenRange": {
350
+ "startIndex": 1,
351
+ "endIndex": 2
352
+ }
353
+ },
354
+ {
355
+ "kind": "PropertySignature",
356
+ "canonicalReference": "@gcorevideo/player!PlaybackError#level:member",
357
+ "docComment": "",
358
+ "excerptTokens": [
359
+ {
360
+ "kind": "Content",
361
+ "text": "level: "
362
+ },
363
+ {
364
+ "kind": "Reference",
365
+ "text": "ErrorLevel",
366
+ "canonicalReference": "@gcorevideo/player!ErrorLevel:type"
367
+ },
368
+ {
369
+ "kind": "Content",
370
+ "text": ";"
371
+ }
372
+ ],
373
+ "isReadonly": false,
374
+ "isOptional": false,
375
+ "releaseTag": "Beta",
376
+ "name": "level",
377
+ "propertyTypeTokenRange": {
378
+ "startIndex": 1,
379
+ "endIndex": 2
380
+ }
381
+ },
382
+ {
383
+ "kind": "PropertySignature",
384
+ "canonicalReference": "@gcorevideo/player!PlaybackError#message:member",
385
+ "docComment": "",
386
+ "excerptTokens": [
387
+ {
388
+ "kind": "Content",
389
+ "text": "message: "
390
+ },
391
+ {
392
+ "kind": "Content",
393
+ "text": "string"
394
+ },
395
+ {
396
+ "kind": "Content",
397
+ "text": ";"
398
+ }
399
+ ],
400
+ "isReadonly": false,
401
+ "isOptional": false,
402
+ "releaseTag": "Beta",
403
+ "name": "message",
404
+ "propertyTypeTokenRange": {
405
+ "startIndex": 1,
406
+ "endIndex": 2
407
+ }
408
+ }
409
+ ],
410
+ "extendsTokenRanges": []
411
+ },
412
+ {
413
+ "kind": "Enum",
414
+ "canonicalReference": "@gcorevideo/player!PlaybackErrorCode:enum",
415
+ "docComment": "/**\n * @beta\n */\n",
416
+ "excerptTokens": [
417
+ {
418
+ "kind": "Content",
419
+ "text": "export declare enum PlaybackErrorCode "
420
+ }
421
+ ],
422
+ "fileUrlPath": "src/playback.types.ts",
423
+ "releaseTag": "Beta",
424
+ "name": "PlaybackErrorCode",
425
+ "preserveMemberOrder": false,
426
+ "members": [
427
+ {
428
+ "kind": "EnumMember",
429
+ "canonicalReference": "@gcorevideo/player!PlaybackErrorCode.Generic:member",
430
+ "docComment": "",
431
+ "excerptTokens": [
432
+ {
433
+ "kind": "Content",
434
+ "text": "Generic = "
435
+ },
436
+ {
437
+ "kind": "Content",
438
+ "text": "0"
439
+ }
440
+ ],
441
+ "initializerTokenRange": {
442
+ "startIndex": 1,
443
+ "endIndex": 2
444
+ },
445
+ "releaseTag": "Beta",
446
+ "name": "Generic"
447
+ },
448
+ {
449
+ "kind": "EnumMember",
450
+ "canonicalReference": "@gcorevideo/player!PlaybackErrorCode.MediaSourceUnavailable:member",
451
+ "docComment": "",
452
+ "excerptTokens": [
453
+ {
454
+ "kind": "Content",
455
+ "text": "MediaSourceUnavailable = "
456
+ },
457
+ {
458
+ "kind": "Content",
459
+ "text": "1"
460
+ }
461
+ ],
462
+ "initializerTokenRange": {
463
+ "startIndex": 1,
464
+ "endIndex": 2
465
+ },
466
+ "releaseTag": "Beta",
467
+ "name": "MediaSourceUnavailable"
468
+ },
469
+ {
470
+ "kind": "EnumMember",
471
+ "canonicalReference": "@gcorevideo/player!PlaybackErrorCode.QualityLevelUnavailable:member",
472
+ "docComment": "",
473
+ "excerptTokens": [
474
+ {
475
+ "kind": "Content",
476
+ "text": "QualityLevelUnavailable = "
477
+ },
478
+ {
479
+ "kind": "Content",
480
+ "text": "2"
481
+ }
482
+ ],
483
+ "initializerTokenRange": {
484
+ "startIndex": 1,
485
+ "endIndex": 2
486
+ },
487
+ "releaseTag": "Beta",
488
+ "name": "QualityLevelUnavailable"
489
+ }
490
+ ]
491
+ },
258
492
  {
259
493
  "kind": "TypeAlias",
260
494
  "canonicalReference": "@gcorevideo/player!PlaybackModule:type",
@@ -266,7 +500,7 @@
266
500
  },
267
501
  {
268
502
  "kind": "Content",
269
- "text": "'dash' | 'hls' | 'native'"
503
+ "text": "'dash' | 'hls' | 'html5_video'"
270
504
  },
271
505
  {
272
506
  "kind": "Content",
@@ -1317,7 +1551,7 @@
1317
1551
  {
1318
1552
  "kind": "PropertySignature",
1319
1553
  "canonicalReference": "@gcorevideo/player!PlayerConfig#priorityTransport:member",
1320
- "docComment": "/**\n * Preferred transport protocol when multiple sources are available.\n *\n * @defaultValue\n *\n * 'auto'\n */\n",
1554
+ "docComment": "/**\n * Preferred transport protocol when multiple sources are available.\n *\n * @defaultValue\n *\n * 'dash'\n */\n",
1321
1555
  "excerptTokens": [
1322
1556
  {
1323
1557
  "kind": "Content",
@@ -1381,7 +1615,7 @@
1381
1615
  "excerptTokens": [
1382
1616
  {
1383
1617
  "kind": "Content",
1384
- "text": "strings: "
1618
+ "text": "strings?: "
1385
1619
  },
1386
1620
  {
1387
1621
  "kind": "Reference",
@@ -1394,7 +1628,7 @@
1394
1628
  }
1395
1629
  ],
1396
1630
  "isReadonly": false,
1397
- "isOptional": false,
1631
+ "isOptional": true,
1398
1632
  "releaseTag": "Beta",
1399
1633
  "name": "strings",
1400
1634
  "propertyTypeTokenRange": {
@@ -1751,7 +1985,7 @@
1751
1985
  },
1752
1986
  {
1753
1987
  "kind": "Content",
1754
- "text": "{\n new (...args: any[]): unknown;\n type: 'core' | 'container';\n}"
1988
+ "text": "{\n new (...args: any[]): unknown;\n name: string;\n}"
1755
1989
  },
1756
1990
  {
1757
1991
  "kind": "Content",
@@ -1792,6 +2026,138 @@
1792
2026
  "endIndex": 2
1793
2027
  }
1794
2028
  },
2029
+ {
2030
+ "kind": "TypeAlias",
2031
+ "canonicalReference": "@gcorevideo/player!TimePosition:type",
2032
+ "docComment": "/**\n * For the plugin development\n *\n * @beta\n */\n",
2033
+ "excerptTokens": [
2034
+ {
2035
+ "kind": "Content",
2036
+ "text": "export type TimePosition = "
2037
+ },
2038
+ {
2039
+ "kind": "Content",
2040
+ "text": "{\n current: "
2041
+ },
2042
+ {
2043
+ "kind": "Reference",
2044
+ "text": "TimeValue",
2045
+ "canonicalReference": "@gcorevideo/player!TimeValue:type"
2046
+ },
2047
+ {
2048
+ "kind": "Content",
2049
+ "text": ";\n total: "
2050
+ },
2051
+ {
2052
+ "kind": "Reference",
2053
+ "text": "TimeValue",
2054
+ "canonicalReference": "@gcorevideo/player!TimeValue:type"
2055
+ },
2056
+ {
2057
+ "kind": "Content",
2058
+ "text": ";\n}"
2059
+ },
2060
+ {
2061
+ "kind": "Content",
2062
+ "text": ";"
2063
+ }
2064
+ ],
2065
+ "fileUrlPath": "src/playback.types.ts",
2066
+ "releaseTag": "Beta",
2067
+ "name": "TimePosition",
2068
+ "typeTokenRange": {
2069
+ "startIndex": 1,
2070
+ "endIndex": 6
2071
+ }
2072
+ },
2073
+ {
2074
+ "kind": "TypeAlias",
2075
+ "canonicalReference": "@gcorevideo/player!TimeProgress:type",
2076
+ "docComment": "/**\n * For the plugin development\n *\n * @beta\n */\n",
2077
+ "excerptTokens": [
2078
+ {
2079
+ "kind": "Content",
2080
+ "text": "export type TimeProgress = "
2081
+ },
2082
+ {
2083
+ "kind": "Reference",
2084
+ "text": "TimePosition",
2085
+ "canonicalReference": "@gcorevideo/player!TimePosition:type"
2086
+ },
2087
+ {
2088
+ "kind": "Content",
2089
+ "text": " & {\n start: number;\n}"
2090
+ },
2091
+ {
2092
+ "kind": "Content",
2093
+ "text": ";"
2094
+ }
2095
+ ],
2096
+ "fileUrlPath": "src/playback.types.ts",
2097
+ "releaseTag": "Beta",
2098
+ "name": "TimeProgress",
2099
+ "typeTokenRange": {
2100
+ "startIndex": 1,
2101
+ "endIndex": 3
2102
+ }
2103
+ },
2104
+ {
2105
+ "kind": "TypeAlias",
2106
+ "canonicalReference": "@gcorevideo/player!TimeUpdate:type",
2107
+ "docComment": "/**\n * For the plugin development\n *\n * @beta\n */\n",
2108
+ "excerptTokens": [
2109
+ {
2110
+ "kind": "Content",
2111
+ "text": "export type TimeUpdate = "
2112
+ },
2113
+ {
2114
+ "kind": "Reference",
2115
+ "text": "TimePosition",
2116
+ "canonicalReference": "@gcorevideo/player!TimePosition:type"
2117
+ },
2118
+ {
2119
+ "kind": "Content",
2120
+ "text": " & {\n firstFragDateTime: number;\n}"
2121
+ },
2122
+ {
2123
+ "kind": "Content",
2124
+ "text": ";"
2125
+ }
2126
+ ],
2127
+ "fileUrlPath": "src/playback.types.ts",
2128
+ "releaseTag": "Beta",
2129
+ "name": "TimeUpdate",
2130
+ "typeTokenRange": {
2131
+ "startIndex": 1,
2132
+ "endIndex": 3
2133
+ }
2134
+ },
2135
+ {
2136
+ "kind": "TypeAlias",
2137
+ "canonicalReference": "@gcorevideo/player!TimeValue:type",
2138
+ "docComment": "/**\n * Playback time in seconds since the beginning of the stream (or a segment for the live streams) For the plugin development\n *\n * @beta\n */\n",
2139
+ "excerptTokens": [
2140
+ {
2141
+ "kind": "Content",
2142
+ "text": "export type TimeValue = "
2143
+ },
2144
+ {
2145
+ "kind": "Content",
2146
+ "text": "number"
2147
+ },
2148
+ {
2149
+ "kind": "Content",
2150
+ "text": ";"
2151
+ }
2152
+ ],
2153
+ "fileUrlPath": "src/playback.types.ts",
2154
+ "releaseTag": "Beta",
2155
+ "name": "TimeValue",
2156
+ "typeTokenRange": {
2157
+ "startIndex": 1,
2158
+ "endIndex": 2
2159
+ }
2160
+ },
1795
2161
  {
1796
2162
  "kind": "TypeAlias",
1797
2163
  "canonicalReference": "@gcorevideo/player!TranslationKey:type",
@@ -1899,10 +2265,6 @@
1899
2265
  "text": "MediaTransport",
1900
2266
  "canonicalReference": "@gcorevideo/player!MediaTransport:type"
1901
2267
  },
1902
- {
1903
- "kind": "Content",
1904
- "text": " | 'auto'"
1905
- },
1906
2268
  {
1907
2269
  "kind": "Content",
1908
2270
  "text": ";"
@@ -1913,7 +2275,7 @@
1913
2275
  "name": "TransportPreference",
1914
2276
  "typeTokenRange": {
1915
2277
  "startIndex": 1,
1916
- "endIndex": 3
2278
+ "endIndex": 2
1917
2279
  }
1918
2280
  },
1919
2281
  {