shaka-player 3.1.3 → 3.2.2
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/AUTHORS +3 -0
- package/CHANGELOG.md +175 -3
- package/CONTRIBUTORS +3 -0
- package/README.md +4 -4
- package/build/generateExterns.js +1 -1
- package/build/types/polyfill +1 -0
- package/demo/common/asset.js +9 -7
- package/demo/common/assets.js +11 -2
- package/demo/common/message_ids.js +2 -1
- package/demo/config.js +5 -2
- package/demo/index.html +1 -1
- package/demo/locales/en.json +2 -1
- package/demo/locales/source.json +8 -4
- package/demo/main.js +2 -1
- package/dist/controls.css +2 -2
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +15 -15
- package/dist/demo.compiled.debug.map +2 -2
- package/dist/demo.compiled.js +15 -15
- package/dist/demo.compiled.map +2 -2
- package/dist/deps.js +22 -21
- package/dist/locales.js +36 -36
- package/dist/receiver.compiled.debug.js +9 -9
- package/dist/receiver.compiled.debug.map +2 -2
- package/dist/receiver.compiled.js +9 -9
- package/dist/receiver.compiled.map +2 -2
- package/dist/shaka-player.compiled.d.ts +58 -10
- package/dist/shaka-player.compiled.debug.d.ts +58 -10
- package/dist/shaka-player.compiled.debug.externs.js +777 -717
- package/dist/shaka-player.compiled.debug.js +639 -607
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +777 -717
- package/dist/shaka-player.compiled.js +826 -819
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +58 -10
- package/dist/shaka-player.ui.debug.d.ts +58 -10
- package/dist/shaka-player.ui.debug.externs.js +529 -469
- package/dist/shaka-player.ui.debug.js +676 -645
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +529 -469
- package/dist/shaka-player.ui.js +963 -955
- package/dist/shaka-player.ui.map +4 -4
- package/docs/tutorials/fairplay.md +1 -1
- package/docs/tutorials/ui.md +5 -5
- package/externs/aria.js +6 -0
- package/externs/shaka/ads.js +24 -1
- package/externs/shaka/manifest.js +6 -1
- package/externs/shaka/offline.js +5 -0
- package/externs/shaka/player.js +53 -9
- package/externs/shaka/text.js +10 -10
- package/externs/texttrack.js +3 -0
- package/karma.conf.js +1 -0
- package/lib/ads/ad_manager.js +16 -15
- package/lib/ads/client_side_ad_manager.js +52 -88
- package/lib/ads/server_side_ad_manager.js +26 -12
- package/lib/cast/cast_proxy.js +11 -2
- package/lib/cast/cast_receiver.js +2 -1
- package/lib/cast/cast_sender.js +2 -2
- package/lib/cast/cast_utils.js +6 -1
- package/lib/cea/cea608_data_channel.js +56 -56
- package/lib/cea/cea608_memory.js +33 -33
- package/lib/cea/cea708_service.js +43 -43
- package/lib/cea/cea708_window.js +38 -38
- package/lib/cea/cea_decoder.js +13 -14
- package/lib/cea/cea_utils.js +23 -23
- package/lib/cea/dtvcc_packet_builder.js +7 -7
- package/lib/cea/i_caption_decoder.js +2 -3
- package/lib/cea/i_cea_parser.js +2 -2
- package/lib/cea/mp4_cea_parser.js +6 -6
- package/lib/dash/dash_parser.js +98 -2
- package/lib/dash/segment_list.js +1 -1
- package/lib/dash/segment_template.js +1 -1
- package/lib/hls/hls_parser.js +159 -29
- package/lib/media/closed_caption_parser.js +1 -2
- package/lib/media/drm_engine.js +169 -192
- package/lib/media/gap_jumping_controller.js +4 -2
- package/lib/media/media_source_engine.js +1 -2
- package/lib/media/segment_index.js +3 -1
- package/lib/media/segment_reference.js +19 -2
- package/lib/media/streaming_engine.js +8 -7
- package/lib/net/networking_engine.js +3 -1
- package/lib/offline/download_manager.js +1 -2
- package/lib/offline/indexeddb/v1_storage_cell.js +1 -0
- package/lib/offline/indexeddb/v2_storage_cell.js +1 -0
- package/lib/offline/manifest_converter.js +3 -1
- package/lib/offline/storage.js +12 -14
- package/lib/player.js +437 -167
- package/lib/polyfill/aria.js +82 -0
- package/lib/polyfill/media_capabilities.js +7 -1
- package/lib/polyfill/mediasource.js +6 -0
- package/lib/polyfill/orientation.js +1 -1
- package/lib/polyfill/patchedmediakeys_apple.js +4 -4
- package/lib/polyfill/patchedmediakeys_ms.js +4 -4
- package/lib/polyfill/patchedmediakeys_webkit.js +4 -4
- package/lib/routing/walker.js +2 -3
- package/lib/text/mp4_ttml_parser.js +3 -0
- package/lib/text/srt_text_parser.js +4 -4
- package/lib/text/text_engine.js +16 -4
- package/lib/text/ttml_text_parser.js +5 -0
- package/lib/text/ui_text_displayer.js +85 -37
- package/lib/text/vtt_text_parser.js +2 -2
- package/lib/text/web_vtt_generator.js +55 -12
- package/lib/util/error.js +6 -0
- package/lib/util/fake_event.js +53 -7
- package/lib/util/manifest_parser_utils.js +1 -0
- package/lib/util/mp4_box_parsers.js +20 -20
- package/lib/util/multi_map.js +8 -0
- package/lib/util/periods.js +4 -1
- package/lib/util/platform.js +13 -1
- package/lib/util/player_configuration.js +13 -1
- package/lib/util/stream_utils.js +153 -85
- package/lib/util/xml_utils.js +31 -12
- package/package.json +1 -1
- package/roadmap.md +24 -22
- package/shaka-player.uncompiled.js +1 -0
- package/test/cast/cast_proxy_unit.js +12 -6
- package/test/cast/cast_utils_unit.js +2 -1
- package/test/cea/cea608_memory_unit.js +1 -1
- package/test/cea/cea708_service_unit.js +8 -8
- package/test/cea/cea708_window_unit.js +6 -6
- package/test/cea/cea_decoder_unit.js +1 -1
- package/test/cea/dtvcc_packet_builder_unit.js +2 -2
- package/test/dash/dash_parser_manifest_unit.js +230 -2
- package/test/hls/hls_parser_unit.js +255 -1
- package/test/media/closed_caption_parser_unit.js +6 -1
- package/test/media/drm_engine_integration.js +86 -12
- package/test/media/drm_engine_unit.js +353 -450
- package/test/offline/manifest_convert_unit.js +2 -0
- package/test/offline/storage_integration.js +9 -19
- package/test/player_integration.js +90 -0
- package/test/player_src_equals_integration.js +52 -0
- package/test/player_unit.js +11 -33
- package/test/test/assets/3675/chunk-stream0-00001.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00002.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00003.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00004.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00005.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00006.m4s +0 -0
- package/test/test/assets/3675/chunk-stream0-00007.m4s +0 -0
- package/test/test/assets/3675/dash_0.mpd +30 -0
- package/test/test/assets/3675/dash_1.mpd +30 -0
- package/test/test/assets/3675/dash_2.mpd +30 -0
- package/test/test/assets/3675/dash_3.mpd +30 -0
- package/test/test/assets/3675/dash_4.mpd +30 -0
- package/test/test/assets/3675/dash_5.mpd +26 -0
- package/test/test/assets/3675/init-stream0.m4s +0 -0
- package/test/test/assets/chapters.srt +11 -0
- package/test/test/assets/chapters.vtt +10 -0
- package/test/test/util/cea_utils.js +12 -12
- package/test/test/util/fake_ad_manager.js +8 -1
- package/test/test/util/manifest_generator.js +2 -0
- package/test/test/util/manifest_parser_util.js +3 -1
- package/test/text/ttml_text_parser_unit.js +9 -0
- package/test/text/ui_text_displayer_unit.js +29 -17
- package/test/text/web_vtt_generator_unit.js +81 -7
- package/test/ui/localization_unit.js +15 -14
- package/test/ui/text_displayer_layout_unit.js +13 -1
- package/test/util/stream_utils_unit.js +153 -10
- package/ui/airplay_button.js +1 -1
- package/ui/audio_language_selection.js +2 -5
- package/ui/cast_button.js +6 -9
- package/ui/constants.js +0 -3
- package/ui/controls.js +4 -6
- package/ui/fast_forward_button.js +2 -3
- package/ui/fullscreen_button.js +1 -3
- package/ui/language_utils.js +1 -1
- package/ui/less/containers.less +3 -7
- package/ui/locales/ru.json +6 -6
- package/ui/localization.js +28 -51
- package/ui/loop_button.js +1 -3
- package/ui/mute_button.js +1 -3
- package/ui/overflow_menu.js +2 -3
- package/ui/pip_button.js +7 -10
- package/ui/playback_rate_selection.js +3 -6
- package/ui/presentation_time.js +1 -3
- package/ui/resolution_selection.js +4 -7
- package/ui/rewind_button.js +2 -3
- package/ui/seek_bar.js +2 -4
- package/ui/spacer.js +1 -1
- package/ui/text_selection.js +8 -11
- package/ui/ui_utils.js +1 -1
- package/ui/volume_bar.js +1 -3
|
@@ -32,9 +32,9 @@ shaka.offline = {};
|
|
|
32
32
|
/** @const */
|
|
33
33
|
shaka.text = {};
|
|
34
34
|
/** @const */
|
|
35
|
-
shaka.util = {};
|
|
36
|
-
/** @const */
|
|
37
35
|
shaka.ui = {};
|
|
36
|
+
/** @const */
|
|
37
|
+
shaka.util = {};
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* @summary Create an Event work-alike object based on the provided dictionary.
|
|
@@ -44,7 +44,7 @@ shaka.ui = {};
|
|
|
44
44
|
shaka.util.FakeEvent = class {
|
|
45
45
|
/**
|
|
46
46
|
* @param {string} type
|
|
47
|
-
* @param {Object
|
|
47
|
+
* @param {Map.<string, Object>=} dict
|
|
48
48
|
*/
|
|
49
49
|
constructor(type, dict) {}
|
|
50
50
|
};
|
|
@@ -261,6 +261,7 @@ shaka.util.Error.Code = {
|
|
|
261
261
|
'EXPIRED': 6014,
|
|
262
262
|
'SERVER_CERTIFICATE_REQUIRED': 6015,
|
|
263
263
|
'INIT_DATA_TRANSFORM_ERROR': 6016,
|
|
264
|
+
'SERVER_CERTIFICATE_REQUEST_FAILED': 6017,
|
|
264
265
|
'LOAD_INTERRUPTED': 7000,
|
|
265
266
|
'OPERATION_ABORTED': 7001,
|
|
266
267
|
'NO_VIDEO_ELEMENT': 7002,
|
|
@@ -407,379 +408,28 @@ shaka.ui.Localization.LOCALE_CHANGED;
|
|
|
407
408
|
*/
|
|
408
409
|
shaka.ui.Localization.LOCALE_UPDATED;
|
|
409
410
|
/**
|
|
410
|
-
* @
|
|
411
|
+
* @implements {shaka.extern.Cue}
|
|
411
412
|
*/
|
|
412
|
-
shaka.
|
|
413
|
-
/**
|
|
414
|
-
* Compare two buffers for equality. For buffers of different types, this
|
|
415
|
-
* compares the underlying buffers as binary data.
|
|
416
|
-
* @param {?BufferSource} arr1
|
|
417
|
-
* @param {?BufferSource} arr2
|
|
418
|
-
* @return {boolean}
|
|
419
|
-
*/
|
|
420
|
-
static equal(arr1, arr2) {}
|
|
421
|
-
/**
|
|
422
|
-
* Gets an ArrayBuffer that contains the data from the given TypedArray. Note
|
|
423
|
-
* this will allocate a new ArrayBuffer if the object is a partial view of
|
|
424
|
-
* the data.
|
|
425
|
-
* @param {!BufferSource} view
|
|
426
|
-
* @return {!ArrayBuffer}
|
|
427
|
-
*/
|
|
428
|
-
static toArrayBuffer(view) {}
|
|
429
|
-
/**
|
|
430
|
-
* Creates a new Uint8Array view on the same buffer. This clamps the values
|
|
431
|
-
* to be within the same view (i.e. you can't use this to move past the end
|
|
432
|
-
* of the view, even if the underlying buffer is larger). However, you can
|
|
433
|
-
* pass a negative offset to access the data before the view.
|
|
434
|
-
* @param {BufferSource} data
|
|
435
|
-
* @param {number=} offset The offset from the beginning of this data's view
|
|
436
|
-
* to start the new view at.
|
|
437
|
-
* @param {number=} length The byte length of the new view.
|
|
438
|
-
* @return {!Uint8Array}
|
|
439
|
-
*/
|
|
440
|
-
static toUint8(data, offset, length) {}
|
|
413
|
+
shaka.text.Cue = class {
|
|
441
414
|
/**
|
|
442
|
-
*
|
|
443
|
-
* @
|
|
444
|
-
* @param {
|
|
445
|
-
* @param {number=} offset
|
|
446
|
-
* @param {number=} length
|
|
447
|
-
* @return {!DataView}
|
|
415
|
+
* @param {number} startTime
|
|
416
|
+
* @param {number} endTime
|
|
417
|
+
* @param {string} payload
|
|
448
418
|
*/
|
|
449
|
-
|
|
419
|
+
constructor(startTime, endTime, payload) {}
|
|
450
420
|
};
|
|
451
421
|
/**
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
shaka.util.StringUtils = class {
|
|
456
|
-
/**
|
|
457
|
-
* Creates a string from the given buffer as UTF-8 encoding.
|
|
458
|
-
* @param {?BufferSource} data
|
|
459
|
-
* @return {string}
|
|
460
|
-
*/
|
|
461
|
-
static fromUTF8(data) {}
|
|
462
|
-
/**
|
|
463
|
-
* Creates a string from the given buffer as UTF-16 encoding.
|
|
464
|
-
* @param {?BufferSource} data
|
|
465
|
-
* @param {boolean} littleEndian
|
|
466
|
-
true to read little endian, false to read big.
|
|
467
|
-
* @param {boolean=} noThrow true to avoid throwing in cases where we may
|
|
468
|
-
* expect invalid input. If noThrow is true and the data has an odd
|
|
469
|
-
* length,it will be truncated.
|
|
470
|
-
* @return {string}
|
|
471
|
-
*/
|
|
472
|
-
static fromUTF16(data, littleEndian, noThrow) {}
|
|
473
|
-
/**
|
|
474
|
-
* Creates a string from the given buffer, auto-detecting the encoding that is
|
|
475
|
-
* being used. If it cannot detect the encoding, it will throw an exception.
|
|
476
|
-
* @param {?BufferSource} data
|
|
477
|
-
* @return {string}
|
|
478
|
-
*/
|
|
479
|
-
static fromBytesAutoDetect(data) {}
|
|
480
|
-
/**
|
|
481
|
-
* Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.
|
|
482
|
-
* @param {string} str
|
|
483
|
-
* @return {!ArrayBuffer}
|
|
484
|
-
*/
|
|
485
|
-
static toUTF8(str) {}
|
|
486
|
-
/**
|
|
487
|
-
* Creates a ArrayBuffer from the given string, converting to UTF-16 encoding.
|
|
488
|
-
* @param {string} str
|
|
489
|
-
* @param {boolean} littleEndian
|
|
490
|
-
* @return {!ArrayBuffer}
|
|
491
|
-
*/
|
|
492
|
-
static toUTF16(str, littleEndian) {}
|
|
493
|
-
/**
|
|
494
|
-
* Resets the fromCharCode method's implementation.
|
|
495
|
-
* For debug use.
|
|
496
|
-
*/
|
|
497
|
-
static resetFromCharCode() {}
|
|
498
|
-
};
|
|
422
|
+
* @override
|
|
423
|
+
*/
|
|
424
|
+
shaka.text.Cue.prototype.startTime;
|
|
499
425
|
/**
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
shaka.
|
|
503
|
-
/**
|
|
504
|
-
* @param {BufferSource} data
|
|
505
|
-
* @param {shaka.util.DataViewReader.Endianness} endianness The endianness.
|
|
506
|
-
*/
|
|
507
|
-
constructor(data, endianness) {}
|
|
508
|
-
/**
|
|
509
|
-
* @return {boolean} True if the reader has more data, false otherwise.
|
|
510
|
-
*/
|
|
511
|
-
hasMoreData() {}
|
|
512
|
-
/**
|
|
513
|
-
* Gets the current byte position.
|
|
514
|
-
* @return {number}
|
|
515
|
-
*/
|
|
516
|
-
getPosition() {}
|
|
517
|
-
/**
|
|
518
|
-
* Gets the byte length of the DataView.
|
|
519
|
-
* @return {number}
|
|
520
|
-
*/
|
|
521
|
-
getLength() {}
|
|
522
|
-
/**
|
|
523
|
-
* Reads an unsigned 8 bit integer, and advances the reader.
|
|
524
|
-
* @return {number} The integer.
|
|
525
|
-
*/
|
|
526
|
-
readUint8() {}
|
|
527
|
-
/**
|
|
528
|
-
* Reads an unsigned 16 bit integer, and advances the reader.
|
|
529
|
-
* @return {number} The integer.
|
|
530
|
-
*/
|
|
531
|
-
readUint16() {}
|
|
532
|
-
/**
|
|
533
|
-
* Reads an unsigned 32 bit integer, and advances the reader.
|
|
534
|
-
* @return {number} The integer.
|
|
535
|
-
*/
|
|
536
|
-
readUint32() {}
|
|
537
|
-
/**
|
|
538
|
-
* Reads a signed 32 bit integer, and advances the reader.
|
|
539
|
-
* @return {number} The integer.
|
|
540
|
-
*/
|
|
541
|
-
readInt32() {}
|
|
542
|
-
/**
|
|
543
|
-
* Reads an unsigned 64 bit integer, and advances the reader.
|
|
544
|
-
* @return {number} The integer.
|
|
545
|
-
*/
|
|
546
|
-
readUint64() {}
|
|
547
|
-
/**
|
|
548
|
-
* Reads the specified number of raw bytes.
|
|
549
|
-
* @param {number} bytes The number of bytes to read.
|
|
550
|
-
* @return {!Uint8Array}
|
|
551
|
-
*/
|
|
552
|
-
readBytes(bytes) {}
|
|
553
|
-
/**
|
|
554
|
-
* Skips the specified number of bytes.
|
|
555
|
-
* @param {number} bytes The number of bytes to skip.
|
|
556
|
-
*/
|
|
557
|
-
skip(bytes) {}
|
|
558
|
-
/**
|
|
559
|
-
* Rewinds the specified number of bytes.
|
|
560
|
-
* @param {number} bytes The number of bytes to rewind.
|
|
561
|
-
*/
|
|
562
|
-
rewind(bytes) {}
|
|
563
|
-
/**
|
|
564
|
-
* Seeks to a specified position.
|
|
565
|
-
* @param {number} position The desired byte position within the DataView.
|
|
566
|
-
*/
|
|
567
|
-
seek(position) {}
|
|
568
|
-
/**
|
|
569
|
-
* Keeps reading until it reaches a byte that equals to zero. The text is
|
|
570
|
-
* assumed to be UTF-8.
|
|
571
|
-
* @return {string}
|
|
572
|
-
*/
|
|
573
|
-
readTerminatedString() {}
|
|
574
|
-
};
|
|
426
|
+
* @override
|
|
427
|
+
*/
|
|
428
|
+
shaka.text.Cue.prototype.direction;
|
|
575
429
|
/**
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
shaka.util.DataViewReader.Endianness = {
|
|
580
|
-
'BIG_ENDIAN': 0,
|
|
581
|
-
'LITTLE_ENDIAN': 1
|
|
582
|
-
};
|
|
583
|
-
/**
|
|
584
|
-
*/
|
|
585
|
-
shaka.util.Mp4Parser = class {
|
|
586
|
-
/** */
|
|
587
|
-
constructor() {}
|
|
588
|
-
/**
|
|
589
|
-
* Declare a box type as a Box.
|
|
590
|
-
* @param {string} type
|
|
591
|
-
* @param {!shaka.util.Mp4Parser.CallbackType} definition
|
|
592
|
-
* @return {!shaka.util.Mp4Parser}
|
|
593
|
-
*/
|
|
594
|
-
box(type, definition) {}
|
|
595
|
-
/**
|
|
596
|
-
* Declare a box type as a Full Box.
|
|
597
|
-
* @param {string} type
|
|
598
|
-
* @param {!shaka.util.Mp4Parser.CallbackType} definition
|
|
599
|
-
* @return {!shaka.util.Mp4Parser}
|
|
600
|
-
*/
|
|
601
|
-
fullBox(type, definition) {}
|
|
602
|
-
/**
|
|
603
|
-
* Stop parsing. Useful for extracting information from partial segments and
|
|
604
|
-
* avoiding an out-of-bounds error once you find what you are looking for.
|
|
605
|
-
*/
|
|
606
|
-
stop() {}
|
|
607
|
-
/**
|
|
608
|
-
* Parse the given data using the added callbacks.
|
|
609
|
-
* @param {!BufferSource} data
|
|
610
|
-
* @param {boolean=} partialOkay If true, allow reading partial payloads
|
|
611
|
-
* from some boxes. If the goal is a child box, we can sometimes find it
|
|
612
|
-
* without enough data to find all child boxes.
|
|
613
|
-
* @param {boolean=} stopOnPartial If true, stop reading if an incomplete
|
|
614
|
-
* box is detected.
|
|
615
|
-
*/
|
|
616
|
-
parse(data, partialOkay, stopOnPartial) {}
|
|
617
|
-
/**
|
|
618
|
-
* Parse the next box on the current level.
|
|
619
|
-
* @param {number} absStart The absolute start position in the original
|
|
620
|
-
* byte array.
|
|
621
|
-
* @param {!shaka.util.DataViewReader} reader
|
|
622
|
-
* @param {boolean=} partialOkay If true, allow reading partial payloads
|
|
623
|
-
* from some boxes. If the goal is a child box, we can sometimes find it
|
|
624
|
-
* without enough data to find all child boxes.
|
|
625
|
-
* @param {boolean=} stopOnPartial If true, stop reading if an incomplete
|
|
626
|
-
* box is detected.
|
|
627
|
-
*/
|
|
628
|
-
parseNext(absStart, reader, partialOkay, stopOnPartial) {}
|
|
629
|
-
/**
|
|
630
|
-
* A callback that tells the Mp4 parser to treat the body of a box as a series
|
|
631
|
-
* of boxes. The number of boxes is limited by the size of the parent box.
|
|
632
|
-
* @param {!shaka.extern.ParsedBox} box
|
|
633
|
-
*/
|
|
634
|
-
static children(box) {}
|
|
635
|
-
/**
|
|
636
|
-
* A callback that tells the Mp4 parser to treat the body of a box as a sample
|
|
637
|
-
* description. A sample description box has a fixed number of children. The
|
|
638
|
-
* number of children is represented by a 4 byte unsigned integer. Each child
|
|
639
|
-
* is a box.
|
|
640
|
-
* @param {!shaka.extern.ParsedBox} box
|
|
641
|
-
*/
|
|
642
|
-
static sampleDescription(box) {}
|
|
643
|
-
/**
|
|
644
|
-
* Create a callback that tells the Mp4 parser to treat the body of a box as a
|
|
645
|
-
* binary blob and to parse the body's contents using the provided callback.
|
|
646
|
-
* @param {function(!Uint8Array)} callback
|
|
647
|
-
* @return {!shaka.util.Mp4Parser.CallbackType}
|
|
648
|
-
*/
|
|
649
|
-
static allData(callback) {}
|
|
650
|
-
/**
|
|
651
|
-
* Convert an integer type from a box into an ascii string name.
|
|
652
|
-
* Useful for debugging.
|
|
653
|
-
* @param {number} type The type of the box, a uint32.
|
|
654
|
-
* @return {string}
|
|
655
|
-
*/
|
|
656
|
-
static typeToString(type) {}
|
|
657
|
-
/**
|
|
658
|
-
* Find the header size of the box.
|
|
659
|
-
* Useful for modifying boxes in place or finding the exact offset of a field.
|
|
660
|
-
* @param {shaka.extern.ParsedBox} box
|
|
661
|
-
* @return {number}
|
|
662
|
-
*/
|
|
663
|
-
static headerSize(box) {}
|
|
664
|
-
};
|
|
665
|
-
/**
|
|
666
|
-
* @typedef {function(!shaka.extern.ParsedBox)}
|
|
667
|
-
*/
|
|
668
|
-
shaka.util.Mp4Parser.CallbackType;
|
|
669
|
-
/**
|
|
670
|
-
* A timer allows a single function to be executed at a later time or at
|
|
671
|
-
* regular intervals.
|
|
672
|
-
* @final
|
|
673
|
-
*/
|
|
674
|
-
shaka.util.Timer = class {
|
|
675
|
-
/**
|
|
676
|
-
* Create a new timer. A timer is committed to a single callback function.
|
|
677
|
-
* While there is no technical reason to do this, it is far easier to
|
|
678
|
-
* understand and use timers when they are connected to one functional idea.
|
|
679
|
-
* @param {function()} onTick
|
|
680
|
-
*/
|
|
681
|
-
constructor(onTick) {}
|
|
682
|
-
/**
|
|
683
|
-
* Have the timer call |onTick| now.
|
|
684
|
-
* @return {!shaka.util.Timer}
|
|
685
|
-
*/
|
|
686
|
-
tickNow() {}
|
|
687
|
-
/**
|
|
688
|
-
* Have the timer call |onTick| after |seconds| has elapsed unless |stop| is
|
|
689
|
-
* called first.
|
|
690
|
-
* @param {number} seconds
|
|
691
|
-
* @return {!shaka.util.Timer}
|
|
692
|
-
*/
|
|
693
|
-
tickAfter(seconds) {}
|
|
694
|
-
/**
|
|
695
|
-
* Have the timer call |onTick| every |seconds| until |stop| is called.
|
|
696
|
-
* @param {number} seconds
|
|
697
|
-
* @return {!shaka.util.Timer}
|
|
698
|
-
*/
|
|
699
|
-
tickEvery(seconds) {}
|
|
700
|
-
/**
|
|
701
|
-
* Stop the timer and clear the previous behaviour. The timer is still usable
|
|
702
|
-
* after calling |stop|.
|
|
703
|
-
*/
|
|
704
|
-
stop() {}
|
|
705
|
-
};
|
|
706
|
-
/**
|
|
707
|
-
* @summary A set of Uint8Array utility functions.
|
|
708
|
-
*/
|
|
709
|
-
shaka.util.Uint8ArrayUtils = class {
|
|
710
|
-
/**
|
|
711
|
-
* Compare two Uint8Arrays for equality.
|
|
712
|
-
* @param {Uint8Array} arr1
|
|
713
|
-
* @param {Uint8Array} arr2
|
|
714
|
-
* @return {boolean}
|
|
715
|
-
* @deprecated
|
|
716
|
-
*/
|
|
717
|
-
static equal(arr1, arr2) {}
|
|
718
|
-
/**
|
|
719
|
-
* Convert a buffer to a base64 string. The output will be standard
|
|
720
|
-
* alphabet as opposed to base64url safe alphabet.
|
|
721
|
-
* @param {BufferSource} data
|
|
722
|
-
* @return {string}
|
|
723
|
-
*/
|
|
724
|
-
static toStandardBase64(data) {}
|
|
725
|
-
/**
|
|
726
|
-
* Convert a buffer to a base64 string. The output will always use the
|
|
727
|
-
* alternate encoding/alphabet also known as "base64url".
|
|
728
|
-
* @param {BufferSource} data
|
|
729
|
-
* @param {boolean=} padding If true, pad the output with equals signs.
|
|
730
|
-
* Defaults to true.
|
|
731
|
-
* @return {string}
|
|
732
|
-
*/
|
|
733
|
-
static toBase64(data, padding) {}
|
|
734
|
-
/**
|
|
735
|
-
* Convert a base64 string to a Uint8Array. Accepts either the standard
|
|
736
|
-
* alphabet or the alternate "base64url" alphabet.
|
|
737
|
-
* @param {string} str
|
|
738
|
-
* @return {!Uint8Array}
|
|
739
|
-
*/
|
|
740
|
-
static fromBase64(str) {}
|
|
741
|
-
/**
|
|
742
|
-
* Convert a hex string to a Uint8Array.
|
|
743
|
-
* @param {string} str
|
|
744
|
-
* @return {!Uint8Array}
|
|
745
|
-
*/
|
|
746
|
-
static fromHex(str) {}
|
|
747
|
-
/**
|
|
748
|
-
* Convert a buffer to a hex string.
|
|
749
|
-
* @param {BufferSource} data
|
|
750
|
-
* @return {string}
|
|
751
|
-
*/
|
|
752
|
-
static toHex(data) {}
|
|
753
|
-
/**
|
|
754
|
-
* Concatenate buffers.
|
|
755
|
-
* @param {...BufferSource} varArgs
|
|
756
|
-
* @return {!Uint8Array}
|
|
757
|
-
*/
|
|
758
|
-
static concat(...varArgs) {}
|
|
759
|
-
};
|
|
760
|
-
/**
|
|
761
|
-
* @implements {shaka.extern.Cue}
|
|
762
|
-
*/
|
|
763
|
-
shaka.text.Cue = class {
|
|
764
|
-
/**
|
|
765
|
-
* @param {number} startTime
|
|
766
|
-
* @param {number} endTime
|
|
767
|
-
* @param {string} payload
|
|
768
|
-
*/
|
|
769
|
-
constructor(startTime, endTime, payload) {}
|
|
770
|
-
};
|
|
771
|
-
/**
|
|
772
|
-
* @override
|
|
773
|
-
*/
|
|
774
|
-
shaka.text.Cue.prototype.startTime;
|
|
775
|
-
/**
|
|
776
|
-
* @override
|
|
777
|
-
*/
|
|
778
|
-
shaka.text.Cue.prototype.direction;
|
|
779
|
-
/**
|
|
780
|
-
* @override
|
|
781
|
-
*/
|
|
782
|
-
shaka.text.Cue.prototype.endTime;
|
|
430
|
+
* @override
|
|
431
|
+
*/
|
|
432
|
+
shaka.text.Cue.prototype.endTime;
|
|
783
433
|
/**
|
|
784
434
|
* @override
|
|
785
435
|
* @type {string}
|
|
@@ -1085,6 +735,48 @@ shaka.text.CueRegion.scrollMode = {
|
|
|
1085
735
|
'NONE': '',
|
|
1086
736
|
'UP': 'up'
|
|
1087
737
|
};
|
|
738
|
+
/**
|
|
739
|
+
* @summary A set of BufferSource utility functions.
|
|
740
|
+
*/
|
|
741
|
+
shaka.util.BufferUtils = class {
|
|
742
|
+
/**
|
|
743
|
+
* Compare two buffers for equality. For buffers of different types, this
|
|
744
|
+
* compares the underlying buffers as binary data.
|
|
745
|
+
* @param {?BufferSource} arr1
|
|
746
|
+
* @param {?BufferSource} arr2
|
|
747
|
+
* @return {boolean}
|
|
748
|
+
*/
|
|
749
|
+
static equal(arr1, arr2) {}
|
|
750
|
+
/**
|
|
751
|
+
* Gets an ArrayBuffer that contains the data from the given TypedArray. Note
|
|
752
|
+
* this will allocate a new ArrayBuffer if the object is a partial view of
|
|
753
|
+
* the data.
|
|
754
|
+
* @param {!BufferSource} view
|
|
755
|
+
* @return {!ArrayBuffer}
|
|
756
|
+
*/
|
|
757
|
+
static toArrayBuffer(view) {}
|
|
758
|
+
/**
|
|
759
|
+
* Creates a new Uint8Array view on the same buffer. This clamps the values
|
|
760
|
+
* to be within the same view (i.e. you can't use this to move past the end
|
|
761
|
+
* of the view, even if the underlying buffer is larger). However, you can
|
|
762
|
+
* pass a negative offset to access the data before the view.
|
|
763
|
+
* @param {BufferSource} data
|
|
764
|
+
* @param {number=} offset The offset from the beginning of this data's view
|
|
765
|
+
* to start the new view at.
|
|
766
|
+
* @param {number=} length The byte length of the new view.
|
|
767
|
+
* @return {!Uint8Array}
|
|
768
|
+
*/
|
|
769
|
+
static toUint8(data, offset, length) {}
|
|
770
|
+
/**
|
|
771
|
+
* Creates a DataView over the given buffer.
|
|
772
|
+
* @see toUint8
|
|
773
|
+
* @param {BufferSource} buffer
|
|
774
|
+
* @param {number=} offset
|
|
775
|
+
* @param {number=} length
|
|
776
|
+
* @return {!DataView}
|
|
777
|
+
*/
|
|
778
|
+
static toDataView(buffer, offset, length) {}
|
|
779
|
+
};
|
|
1088
780
|
/**
|
|
1089
781
|
* An interface to standardize how objects are destroyed.
|
|
1090
782
|
* @interface
|
|
@@ -1121,6 +813,108 @@ shaka.dependencies = class {
|
|
|
1121
813
|
shaka.dependencies.Allowed = {
|
|
1122
814
|
muxjs: 'muxjs'
|
|
1123
815
|
};
|
|
816
|
+
/**
|
|
817
|
+
* @namespace shaka.util.StringUtils
|
|
818
|
+
* @summary A set of string utility functions.
|
|
819
|
+
*/
|
|
820
|
+
shaka.util.StringUtils = class {
|
|
821
|
+
/**
|
|
822
|
+
* Creates a string from the given buffer as UTF-8 encoding.
|
|
823
|
+
* @param {?BufferSource} data
|
|
824
|
+
* @return {string}
|
|
825
|
+
*/
|
|
826
|
+
static fromUTF8(data) {}
|
|
827
|
+
/**
|
|
828
|
+
* Creates a string from the given buffer as UTF-16 encoding.
|
|
829
|
+
* @param {?BufferSource} data
|
|
830
|
+
* @param {boolean} littleEndian
|
|
831
|
+
true to read little endian, false to read big.
|
|
832
|
+
* @param {boolean=} noThrow true to avoid throwing in cases where we may
|
|
833
|
+
* expect invalid input. If noThrow is true and the data has an odd
|
|
834
|
+
* length,it will be truncated.
|
|
835
|
+
* @return {string}
|
|
836
|
+
*/
|
|
837
|
+
static fromUTF16(data, littleEndian, noThrow) {}
|
|
838
|
+
/**
|
|
839
|
+
* Creates a string from the given buffer, auto-detecting the encoding that is
|
|
840
|
+
* being used. If it cannot detect the encoding, it will throw an exception.
|
|
841
|
+
* @param {?BufferSource} data
|
|
842
|
+
* @return {string}
|
|
843
|
+
*/
|
|
844
|
+
static fromBytesAutoDetect(data) {}
|
|
845
|
+
/**
|
|
846
|
+
* Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.
|
|
847
|
+
* @param {string} str
|
|
848
|
+
* @return {!ArrayBuffer}
|
|
849
|
+
*/
|
|
850
|
+
static toUTF8(str) {}
|
|
851
|
+
/**
|
|
852
|
+
* Creates a ArrayBuffer from the given string, converting to UTF-16 encoding.
|
|
853
|
+
* @param {string} str
|
|
854
|
+
* @param {boolean} littleEndian
|
|
855
|
+
* @return {!ArrayBuffer}
|
|
856
|
+
*/
|
|
857
|
+
static toUTF16(str, littleEndian) {}
|
|
858
|
+
/**
|
|
859
|
+
* Resets the fromCharCode method's implementation.
|
|
860
|
+
* For debug use.
|
|
861
|
+
*/
|
|
862
|
+
static resetFromCharCode() {}
|
|
863
|
+
};
|
|
864
|
+
/**
|
|
865
|
+
* @summary A set of Uint8Array utility functions.
|
|
866
|
+
*/
|
|
867
|
+
shaka.util.Uint8ArrayUtils = class {
|
|
868
|
+
/**
|
|
869
|
+
* Compare two Uint8Arrays for equality.
|
|
870
|
+
* @param {Uint8Array} arr1
|
|
871
|
+
* @param {Uint8Array} arr2
|
|
872
|
+
* @return {boolean}
|
|
873
|
+
* @deprecated
|
|
874
|
+
*/
|
|
875
|
+
static equal(arr1, arr2) {}
|
|
876
|
+
/**
|
|
877
|
+
* Convert a buffer to a base64 string. The output will be standard
|
|
878
|
+
* alphabet as opposed to base64url safe alphabet.
|
|
879
|
+
* @param {BufferSource} data
|
|
880
|
+
* @return {string}
|
|
881
|
+
*/
|
|
882
|
+
static toStandardBase64(data) {}
|
|
883
|
+
/**
|
|
884
|
+
* Convert a buffer to a base64 string. The output will always use the
|
|
885
|
+
* alternate encoding/alphabet also known as "base64url".
|
|
886
|
+
* @param {BufferSource} data
|
|
887
|
+
* @param {boolean=} padding If true, pad the output with equals signs.
|
|
888
|
+
* Defaults to true.
|
|
889
|
+
* @return {string}
|
|
890
|
+
*/
|
|
891
|
+
static toBase64(data, padding) {}
|
|
892
|
+
/**
|
|
893
|
+
* Convert a base64 string to a Uint8Array. Accepts either the standard
|
|
894
|
+
* alphabet or the alternate "base64url" alphabet.
|
|
895
|
+
* @param {string} str
|
|
896
|
+
* @return {!Uint8Array}
|
|
897
|
+
*/
|
|
898
|
+
static fromBase64(str) {}
|
|
899
|
+
/**
|
|
900
|
+
* Convert a hex string to a Uint8Array.
|
|
901
|
+
* @param {string} str
|
|
902
|
+
* @return {!Uint8Array}
|
|
903
|
+
*/
|
|
904
|
+
static fromHex(str) {}
|
|
905
|
+
/**
|
|
906
|
+
* Convert a buffer to a hex string.
|
|
907
|
+
* @param {BufferSource} data
|
|
908
|
+
* @return {string}
|
|
909
|
+
*/
|
|
910
|
+
static toHex(data) {}
|
|
911
|
+
/**
|
|
912
|
+
* Concatenate buffers.
|
|
913
|
+
* @param {...BufferSource} varArgs
|
|
914
|
+
* @return {!Uint8Array}
|
|
915
|
+
*/
|
|
916
|
+
static concat(...varArgs) {}
|
|
917
|
+
};
|
|
1124
918
|
/**
|
|
1125
919
|
* @summary Manages text parsers and cues.
|
|
1126
920
|
* @implements {shaka.util.IDestroyable}
|
|
@@ -1147,70 +941,42 @@ shaka.text.TextEngine = class {
|
|
|
1147
941
|
destroy() {}
|
|
1148
942
|
};
|
|
1149
943
|
/**
|
|
1150
|
-
*
|
|
1151
|
-
*
|
|
1152
|
-
*
|
|
1153
|
-
* @interface
|
|
1154
|
-
*/
|
|
1155
|
-
shaka.util.IReleasable = class {
|
|
1156
|
-
/**
|
|
1157
|
-
* Request that this object release all internal references.
|
|
1158
|
-
*/
|
|
1159
|
-
release() {}
|
|
1160
|
-
};
|
|
1161
|
-
/**
|
|
1162
|
-
* @summary
|
|
1163
|
-
* An EventManager maintains a collection of "event
|
|
1164
|
-
* bindings" between event targets and event listeners.
|
|
1165
|
-
* @implements {shaka.util.IReleasable}
|
|
944
|
+
* A timer allows a single function to be executed at a later time or at
|
|
945
|
+
* regular intervals.
|
|
946
|
+
* @final
|
|
1166
947
|
*/
|
|
1167
|
-
shaka.util.
|
|
1168
|
-
/** */
|
|
1169
|
-
constructor() {}
|
|
948
|
+
shaka.util.Timer = class {
|
|
1170
949
|
/**
|
|
1171
|
-
*
|
|
1172
|
-
*
|
|
950
|
+
* Create a new timer. A timer is committed to a single callback function.
|
|
951
|
+
* While there is no technical reason to do this, it is far easier to
|
|
952
|
+
* understand and use timers when they are connected to one functional idea.
|
|
953
|
+
* @param {function()} onTick
|
|
1173
954
|
*/
|
|
1174
|
-
|
|
955
|
+
constructor(onTick) {}
|
|
1175
956
|
/**
|
|
1176
|
-
*
|
|
1177
|
-
* @
|
|
1178
|
-
* @param {string} type The event type.
|
|
1179
|
-
* @param {shaka.util.EventManager.ListenerType} listener The event listener.
|
|
1180
|
-
* @param {(boolean|!AddEventListenerOptions)=} options An object that
|
|
1181
|
-
* specifies characteristics about the event listener.
|
|
1182
|
-
* The passive option, if true, indicates that this function will never
|
|
1183
|
-
* call preventDefault(), which improves scrolling performance.
|
|
957
|
+
* Have the timer call |onTick| now.
|
|
958
|
+
* @return {!shaka.util.Timer}
|
|
1184
959
|
*/
|
|
1185
|
-
|
|
960
|
+
tickNow() {}
|
|
1186
961
|
/**
|
|
1187
|
-
*
|
|
1188
|
-
*
|
|
1189
|
-
* @param {
|
|
1190
|
-
* @
|
|
1191
|
-
* @param {shaka.util.EventManager.ListenerType} listener The event listener.
|
|
1192
|
-
* @param {(boolean|!AddEventListenerOptions)=} options An object that
|
|
1193
|
-
* specifies characteristics about the event listener.
|
|
1194
|
-
* The passive option, if true, indicates that this function will never
|
|
1195
|
-
* call preventDefault(), which improves scrolling performance.
|
|
962
|
+
* Have the timer call |onTick| after |seconds| has elapsed unless |stop| is
|
|
963
|
+
* called first.
|
|
964
|
+
* @param {number} seconds
|
|
965
|
+
* @return {!shaka.util.Timer}
|
|
1196
966
|
*/
|
|
1197
|
-
|
|
967
|
+
tickAfter(seconds) {}
|
|
1198
968
|
/**
|
|
1199
|
-
*
|
|
1200
|
-
* @param {
|
|
1201
|
-
* @
|
|
1202
|
-
* @param {shaka.util.EventManager.ListenerType=} listener The event listener.
|
|
969
|
+
* Have the timer call |onTick| every |seconds| until |stop| is called.
|
|
970
|
+
* @param {number} seconds
|
|
971
|
+
* @return {!shaka.util.Timer}
|
|
1203
972
|
*/
|
|
1204
|
-
|
|
973
|
+
tickEvery(seconds) {}
|
|
1205
974
|
/**
|
|
1206
|
-
*
|
|
975
|
+
* Stop the timer and clear the previous behaviour. The timer is still usable
|
|
976
|
+
* after calling |stop|.
|
|
1207
977
|
*/
|
|
1208
|
-
|
|
978
|
+
stop() {}
|
|
1209
979
|
};
|
|
1210
|
-
/**
|
|
1211
|
-
* @typedef {function(!Event)}
|
|
1212
|
-
*/
|
|
1213
|
-
shaka.util.EventManager.ListenerType;
|
|
1214
980
|
/**
|
|
1215
981
|
* @summary
|
|
1216
982
|
* <p>
|
|
@@ -1460,56 +1226,122 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
|
|
|
1460
1226
|
*/
|
|
1461
1227
|
shaka.net.NetworkingEngine.NumBytesRemainingClass = class {
|
|
1462
1228
|
/**
|
|
1463
|
-
* Constructor
|
|
1229
|
+
* Constructor
|
|
1230
|
+
*/
|
|
1231
|
+
constructor() {}
|
|
1232
|
+
};
|
|
1233
|
+
/**
|
|
1234
|
+
* A pending network request. This can track the current progress of the
|
|
1235
|
+
* download, and allows the request to be aborted if the network is slow.
|
|
1236
|
+
* @implements {shaka.extern.IAbortableOperation.<shaka.extern.Response>}
|
|
1237
|
+
* @extends {shaka.util.AbortableOperation}
|
|
1238
|
+
*/
|
|
1239
|
+
shaka.net.NetworkingEngine.PendingRequest = class extends shaka.util.AbortableOperation {
|
|
1240
|
+
/**
|
|
1241
|
+
* @param {!Promise} promise
|
|
1242
|
+
* A Promise which represents the underlying operation. It is resolved
|
|
1243
|
+
* when the operation is complete, and rejected if the operation fails or
|
|
1244
|
+
* is aborted. Aborted operations should be rejected with a
|
|
1245
|
+
* shaka.util.Error object using the error code OPERATION_ABORTED.
|
|
1246
|
+
* @param {function():!Promise} onAbort
|
|
1247
|
+
* Will be called by this object to abort the underlying operation. This
|
|
1248
|
+
* is not cancelation, and will not necessarily result in any work being
|
|
1249
|
+
* undone. abort() should return a Promise which is resolved when the
|
|
1250
|
+
* underlying operation has been aborted. The returned Promise should
|
|
1251
|
+
* never be rejected.
|
|
1252
|
+
* @param {shaka.net.NetworkingEngine.NumBytesRemainingClass}
|
|
1253
|
+
* numBytesRemainingObj
|
|
1254
|
+
*/
|
|
1255
|
+
constructor(promise, onAbort, numBytesRemainingObj) {}
|
|
1256
|
+
};
|
|
1257
|
+
/**
|
|
1258
|
+
* Request types. Allows a filter to decide which requests to read/alter.
|
|
1259
|
+
* @enum {number}
|
|
1260
|
+
*/
|
|
1261
|
+
shaka.net.NetworkingEngine.RequestType = {
|
|
1262
|
+
'MANIFEST': 0,
|
|
1263
|
+
'SEGMENT': 1,
|
|
1264
|
+
'LICENSE': 2,
|
|
1265
|
+
'APP': 3,
|
|
1266
|
+
'TIMING': 4,
|
|
1267
|
+
'SERVER_CERTIFICATE': 5
|
|
1268
|
+
};
|
|
1269
|
+
/**
|
|
1270
|
+
* Priority level for network scheme plugins.
|
|
1271
|
+
* If multiple plugins are provided for the same scheme, only the
|
|
1272
|
+
* highest-priority one is used.
|
|
1273
|
+
* @enum {number}
|
|
1274
|
+
*/
|
|
1275
|
+
shaka.net.NetworkingEngine.PluginPriority = {
|
|
1276
|
+
'FALLBACK': 1,
|
|
1277
|
+
'PREFERRED': 2,
|
|
1278
|
+
'APPLICATION': 3
|
|
1279
|
+
};
|
|
1280
|
+
/**
|
|
1281
|
+
* An interface to standardize how objects release internal references
|
|
1282
|
+
* synchronously. If an object needs to asynchronously release references, then
|
|
1283
|
+
* it should use 'shaka.util.IDestroyable'.
|
|
1284
|
+
* @interface
|
|
1285
|
+
*/
|
|
1286
|
+
shaka.util.IReleasable = class {
|
|
1287
|
+
/**
|
|
1288
|
+
* Request that this object release all internal references.
|
|
1289
|
+
*/
|
|
1290
|
+
release() {}
|
|
1291
|
+
};
|
|
1292
|
+
/**
|
|
1293
|
+
* @summary
|
|
1294
|
+
* An EventManager maintains a collection of "event
|
|
1295
|
+
* bindings" between event targets and event listeners.
|
|
1296
|
+
* @implements {shaka.util.IReleasable}
|
|
1297
|
+
*/
|
|
1298
|
+
shaka.util.EventManager = class {
|
|
1299
|
+
/** */
|
|
1300
|
+
constructor() {}
|
|
1301
|
+
/**
|
|
1302
|
+
* Detaches all event listeners.
|
|
1303
|
+
* @override
|
|
1304
|
+
*/
|
|
1305
|
+
release() {}
|
|
1306
|
+
/**
|
|
1307
|
+
* Attaches an event listener to an event target.
|
|
1308
|
+
* @param {EventTarget} target The event target.
|
|
1309
|
+
* @param {string} type The event type.
|
|
1310
|
+
* @param {shaka.util.EventManager.ListenerType} listener The event listener.
|
|
1311
|
+
* @param {(boolean|!AddEventListenerOptions)=} options An object that
|
|
1312
|
+
* specifies characteristics about the event listener.
|
|
1313
|
+
* The passive option, if true, indicates that this function will never
|
|
1314
|
+
* call preventDefault(), which improves scrolling performance.
|
|
1315
|
+
*/
|
|
1316
|
+
listen(target, type, listener, options) {}
|
|
1317
|
+
/**
|
|
1318
|
+
* Attaches an event listener to an event target. The listener will be
|
|
1319
|
+
* removed when the first instance of the event is fired.
|
|
1320
|
+
* @param {EventTarget} target The event target.
|
|
1321
|
+
* @param {string} type The event type.
|
|
1322
|
+
* @param {shaka.util.EventManager.ListenerType} listener The event listener.
|
|
1323
|
+
* @param {(boolean|!AddEventListenerOptions)=} options An object that
|
|
1324
|
+
* specifies characteristics about the event listener.
|
|
1325
|
+
* The passive option, if true, indicates that this function will never
|
|
1326
|
+
* call preventDefault(), which improves scrolling performance.
|
|
1327
|
+
*/
|
|
1328
|
+
listenOnce(target, type, listener, options) {}
|
|
1329
|
+
/**
|
|
1330
|
+
* Detaches an event listener from an event target.
|
|
1331
|
+
* @param {EventTarget} target The event target.
|
|
1332
|
+
* @param {string} type The event type.
|
|
1333
|
+
* @param {shaka.util.EventManager.ListenerType=} listener The event listener.
|
|
1464
1334
|
*/
|
|
1465
|
-
|
|
1466
|
-
};
|
|
1467
|
-
/**
|
|
1468
|
-
* A pending network request. This can track the current progress of the
|
|
1469
|
-
* download, and allows the request to be aborted if the network is slow.
|
|
1470
|
-
* @implements {shaka.extern.IAbortableOperation.<shaka.extern.Response>}
|
|
1471
|
-
* @extends {shaka.util.AbortableOperation}
|
|
1472
|
-
*/
|
|
1473
|
-
shaka.net.NetworkingEngine.PendingRequest = class extends shaka.util.AbortableOperation {
|
|
1335
|
+
unlisten(target, type, listener) {}
|
|
1474
1336
|
/**
|
|
1475
|
-
*
|
|
1476
|
-
* A Promise which represents the underlying operation. It is resolved
|
|
1477
|
-
* when the operation is complete, and rejected if the operation fails or
|
|
1478
|
-
* is aborted. Aborted operations should be rejected with a
|
|
1479
|
-
* shaka.util.Error object using the error code OPERATION_ABORTED.
|
|
1480
|
-
* @param {function():!Promise} onAbort
|
|
1481
|
-
* Will be called by this object to abort the underlying operation. This
|
|
1482
|
-
* is not cancelation, and will not necessarily result in any work being
|
|
1483
|
-
* undone. abort() should return a Promise which is resolved when the
|
|
1484
|
-
* underlying operation has been aborted. The returned Promise should
|
|
1485
|
-
* never be rejected.
|
|
1486
|
-
* @param {shaka.net.NetworkingEngine.NumBytesRemainingClass}
|
|
1487
|
-
* numBytesRemainingObj
|
|
1337
|
+
* Detaches all event listeners from all targets.
|
|
1488
1338
|
*/
|
|
1489
|
-
|
|
1490
|
-
};
|
|
1491
|
-
/**
|
|
1492
|
-
* Request types. Allows a filter to decide which requests to read/alter.
|
|
1493
|
-
* @enum {number}
|
|
1494
|
-
*/
|
|
1495
|
-
shaka.net.NetworkingEngine.RequestType = {
|
|
1496
|
-
'MANIFEST': 0,
|
|
1497
|
-
'SEGMENT': 1,
|
|
1498
|
-
'LICENSE': 2,
|
|
1499
|
-
'APP': 3,
|
|
1500
|
-
'TIMING': 4
|
|
1339
|
+
removeAll() {}
|
|
1501
1340
|
};
|
|
1502
1341
|
/**
|
|
1503
|
-
*
|
|
1504
|
-
* If multiple plugins are provided for the same scheme, only the
|
|
1505
|
-
* highest-priority one is used.
|
|
1506
|
-
* @enum {number}
|
|
1342
|
+
* @typedef {function(!Event)}
|
|
1507
1343
|
*/
|
|
1508
|
-
shaka.
|
|
1509
|
-
'FALLBACK': 1,
|
|
1510
|
-
'PREFERRED': 2,
|
|
1511
|
-
'APPLICATION': 3
|
|
1512
|
-
};
|
|
1344
|
+
shaka.util.EventManager.ListenerType;
|
|
1513
1345
|
/**
|
|
1514
1346
|
* @summary A set of FairPlay utility functions.
|
|
1515
1347
|
*/
|
|
@@ -1563,6 +1395,176 @@ shaka.media.ManifestParser = class {
|
|
|
1563
1395
|
*/
|
|
1564
1396
|
static unregisterParserByMime(mimeType) {}
|
|
1565
1397
|
};
|
|
1398
|
+
/**
|
|
1399
|
+
* @summary DataViewReader abstracts a DataView object.
|
|
1400
|
+
*/
|
|
1401
|
+
shaka.util.DataViewReader = class {
|
|
1402
|
+
/**
|
|
1403
|
+
* @param {BufferSource} data
|
|
1404
|
+
* @param {shaka.util.DataViewReader.Endianness} endianness The endianness.
|
|
1405
|
+
*/
|
|
1406
|
+
constructor(data, endianness) {}
|
|
1407
|
+
/**
|
|
1408
|
+
* @return {boolean} True if the reader has more data, false otherwise.
|
|
1409
|
+
*/
|
|
1410
|
+
hasMoreData() {}
|
|
1411
|
+
/**
|
|
1412
|
+
* Gets the current byte position.
|
|
1413
|
+
* @return {number}
|
|
1414
|
+
*/
|
|
1415
|
+
getPosition() {}
|
|
1416
|
+
/**
|
|
1417
|
+
* Gets the byte length of the DataView.
|
|
1418
|
+
* @return {number}
|
|
1419
|
+
*/
|
|
1420
|
+
getLength() {}
|
|
1421
|
+
/**
|
|
1422
|
+
* Reads an unsigned 8 bit integer, and advances the reader.
|
|
1423
|
+
* @return {number} The integer.
|
|
1424
|
+
*/
|
|
1425
|
+
readUint8() {}
|
|
1426
|
+
/**
|
|
1427
|
+
* Reads an unsigned 16 bit integer, and advances the reader.
|
|
1428
|
+
* @return {number} The integer.
|
|
1429
|
+
*/
|
|
1430
|
+
readUint16() {}
|
|
1431
|
+
/**
|
|
1432
|
+
* Reads an unsigned 32 bit integer, and advances the reader.
|
|
1433
|
+
* @return {number} The integer.
|
|
1434
|
+
*/
|
|
1435
|
+
readUint32() {}
|
|
1436
|
+
/**
|
|
1437
|
+
* Reads a signed 32 bit integer, and advances the reader.
|
|
1438
|
+
* @return {number} The integer.
|
|
1439
|
+
*/
|
|
1440
|
+
readInt32() {}
|
|
1441
|
+
/**
|
|
1442
|
+
* Reads an unsigned 64 bit integer, and advances the reader.
|
|
1443
|
+
* @return {number} The integer.
|
|
1444
|
+
*/
|
|
1445
|
+
readUint64() {}
|
|
1446
|
+
/**
|
|
1447
|
+
* Reads the specified number of raw bytes.
|
|
1448
|
+
* @param {number} bytes The number of bytes to read.
|
|
1449
|
+
* @return {!Uint8Array}
|
|
1450
|
+
*/
|
|
1451
|
+
readBytes(bytes) {}
|
|
1452
|
+
/**
|
|
1453
|
+
* Skips the specified number of bytes.
|
|
1454
|
+
* @param {number} bytes The number of bytes to skip.
|
|
1455
|
+
*/
|
|
1456
|
+
skip(bytes) {}
|
|
1457
|
+
/**
|
|
1458
|
+
* Rewinds the specified number of bytes.
|
|
1459
|
+
* @param {number} bytes The number of bytes to rewind.
|
|
1460
|
+
*/
|
|
1461
|
+
rewind(bytes) {}
|
|
1462
|
+
/**
|
|
1463
|
+
* Seeks to a specified position.
|
|
1464
|
+
* @param {number} position The desired byte position within the DataView.
|
|
1465
|
+
*/
|
|
1466
|
+
seek(position) {}
|
|
1467
|
+
/**
|
|
1468
|
+
* Keeps reading until it reaches a byte that equals to zero. The text is
|
|
1469
|
+
* assumed to be UTF-8.
|
|
1470
|
+
* @return {string}
|
|
1471
|
+
*/
|
|
1472
|
+
readTerminatedString() {}
|
|
1473
|
+
};
|
|
1474
|
+
/**
|
|
1475
|
+
* Endianness.
|
|
1476
|
+
* @enum {number}
|
|
1477
|
+
*/
|
|
1478
|
+
shaka.util.DataViewReader.Endianness = {
|
|
1479
|
+
'BIG_ENDIAN': 0,
|
|
1480
|
+
'LITTLE_ENDIAN': 1
|
|
1481
|
+
};
|
|
1482
|
+
/**
|
|
1483
|
+
*/
|
|
1484
|
+
shaka.util.Mp4Parser = class {
|
|
1485
|
+
/** */
|
|
1486
|
+
constructor() {}
|
|
1487
|
+
/**
|
|
1488
|
+
* Declare a box type as a Box.
|
|
1489
|
+
* @param {string} type
|
|
1490
|
+
* @param {!shaka.util.Mp4Parser.CallbackType} definition
|
|
1491
|
+
* @return {!shaka.util.Mp4Parser}
|
|
1492
|
+
*/
|
|
1493
|
+
box(type, definition) {}
|
|
1494
|
+
/**
|
|
1495
|
+
* Declare a box type as a Full Box.
|
|
1496
|
+
* @param {string} type
|
|
1497
|
+
* @param {!shaka.util.Mp4Parser.CallbackType} definition
|
|
1498
|
+
* @return {!shaka.util.Mp4Parser}
|
|
1499
|
+
*/
|
|
1500
|
+
fullBox(type, definition) {}
|
|
1501
|
+
/**
|
|
1502
|
+
* Stop parsing. Useful for extracting information from partial segments and
|
|
1503
|
+
* avoiding an out-of-bounds error once you find what you are looking for.
|
|
1504
|
+
*/
|
|
1505
|
+
stop() {}
|
|
1506
|
+
/**
|
|
1507
|
+
* Parse the given data using the added callbacks.
|
|
1508
|
+
* @param {!BufferSource} data
|
|
1509
|
+
* @param {boolean=} partialOkay If true, allow reading partial payloads
|
|
1510
|
+
* from some boxes. If the goal is a child box, we can sometimes find it
|
|
1511
|
+
* without enough data to find all child boxes.
|
|
1512
|
+
* @param {boolean=} stopOnPartial If true, stop reading if an incomplete
|
|
1513
|
+
* box is detected.
|
|
1514
|
+
*/
|
|
1515
|
+
parse(data, partialOkay, stopOnPartial) {}
|
|
1516
|
+
/**
|
|
1517
|
+
* Parse the next box on the current level.
|
|
1518
|
+
* @param {number} absStart The absolute start position in the original
|
|
1519
|
+
* byte array.
|
|
1520
|
+
* @param {!shaka.util.DataViewReader} reader
|
|
1521
|
+
* @param {boolean=} partialOkay If true, allow reading partial payloads
|
|
1522
|
+
* from some boxes. If the goal is a child box, we can sometimes find it
|
|
1523
|
+
* without enough data to find all child boxes.
|
|
1524
|
+
* @param {boolean=} stopOnPartial If true, stop reading if an incomplete
|
|
1525
|
+
* box is detected.
|
|
1526
|
+
*/
|
|
1527
|
+
parseNext(absStart, reader, partialOkay, stopOnPartial) {}
|
|
1528
|
+
/**
|
|
1529
|
+
* A callback that tells the Mp4 parser to treat the body of a box as a series
|
|
1530
|
+
* of boxes. The number of boxes is limited by the size of the parent box.
|
|
1531
|
+
* @param {!shaka.extern.ParsedBox} box
|
|
1532
|
+
*/
|
|
1533
|
+
static children(box) {}
|
|
1534
|
+
/**
|
|
1535
|
+
* A callback that tells the Mp4 parser to treat the body of a box as a sample
|
|
1536
|
+
* description. A sample description box has a fixed number of children. The
|
|
1537
|
+
* number of children is represented by a 4 byte unsigned integer. Each child
|
|
1538
|
+
* is a box.
|
|
1539
|
+
* @param {!shaka.extern.ParsedBox} box
|
|
1540
|
+
*/
|
|
1541
|
+
static sampleDescription(box) {}
|
|
1542
|
+
/**
|
|
1543
|
+
* Create a callback that tells the Mp4 parser to treat the body of a box as a
|
|
1544
|
+
* binary blob and to parse the body's contents using the provided callback.
|
|
1545
|
+
* @param {function(!Uint8Array)} callback
|
|
1546
|
+
* @return {!shaka.util.Mp4Parser.CallbackType}
|
|
1547
|
+
*/
|
|
1548
|
+
static allData(callback) {}
|
|
1549
|
+
/**
|
|
1550
|
+
* Convert an integer type from a box into an ascii string name.
|
|
1551
|
+
* Useful for debugging.
|
|
1552
|
+
* @param {number} type The type of the box, a uint32.
|
|
1553
|
+
* @return {string}
|
|
1554
|
+
*/
|
|
1555
|
+
static typeToString(type) {}
|
|
1556
|
+
/**
|
|
1557
|
+
* Find the header size of the box.
|
|
1558
|
+
* Useful for modifying boxes in place or finding the exact offset of a field.
|
|
1559
|
+
* @param {shaka.extern.ParsedBox} box
|
|
1560
|
+
* @return {number}
|
|
1561
|
+
*/
|
|
1562
|
+
static headerSize(box) {}
|
|
1563
|
+
};
|
|
1564
|
+
/**
|
|
1565
|
+
* @typedef {function(!shaka.extern.ParsedBox)}
|
|
1566
|
+
*/
|
|
1567
|
+
shaka.util.Mp4Parser.CallbackType;
|
|
1566
1568
|
/**
|
|
1567
1569
|
* Creates an InitSegmentReference, which provides the location to an
|
|
1568
1570
|
* initialization segment.
|
|
@@ -1633,9 +1635,13 @@ shaka.media.SegmentReference = class {
|
|
|
1633
1635
|
* presentation. Any content from after this time will be removed by
|
|
1634
1636
|
* MediaSource.
|
|
1635
1637
|
* @param {!Array.<!shaka.media.SegmentReference>=} partialReferences
|
|
1636
|
-
|
|
1638
|
+
* A list of SegmentReferences for the partial segments.
|
|
1639
|
+
* @param {?string=} tilesLayout
|
|
1640
|
+
* The value is a grid-item-dimension consisting of two positive decimal
|
|
1641
|
+
* integers in the format: column-x-row ('4x3'). It describes the
|
|
1642
|
+
* arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
|
|
1637
1643
|
*/
|
|
1638
|
-
constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences) {}
|
|
1644
|
+
constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout) {}
|
|
1639
1645
|
/**
|
|
1640
1646
|
* Creates and returns the URIs of the resource containing the segment.
|
|
1641
1647
|
* @return {!Array.<string>}
|
|
@@ -1664,6 +1670,11 @@ shaka.media.SegmentReference = class {
|
|
|
1664
1670
|
* @return {?number}
|
|
1665
1671
|
*/
|
|
1666
1672
|
getEndByte() {}
|
|
1673
|
+
/**
|
|
1674
|
+
* Returns the segment's tiles layout. Only defined in image segments.
|
|
1675
|
+
* @return {?string}
|
|
1676
|
+
*/
|
|
1677
|
+
getTilesLayout() {}
|
|
1667
1678
|
};
|
|
1668
1679
|
/**
|
|
1669
1680
|
* PresentationTimeline.
|
|
@@ -2285,6 +2296,11 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
2285
2296
|
* @return {shaka.extern.PlayerConfiguration}
|
|
2286
2297
|
*/
|
|
2287
2298
|
getConfiguration() {}
|
|
2299
|
+
/**
|
|
2300
|
+
* Returns the ratio of video length buffered compared to buffering Goal
|
|
2301
|
+
* @return {number}
|
|
2302
|
+
*/
|
|
2303
|
+
getBufferFullness() {}
|
|
2288
2304
|
/**
|
|
2289
2305
|
* Reset configuration to default.
|
|
2290
2306
|
*/
|
|
@@ -2347,6 +2363,10 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
2347
2363
|
* @return {{start: number, end: number}}
|
|
2348
2364
|
*/
|
|
2349
2365
|
seekRange() {}
|
|
2366
|
+
/**
|
|
2367
|
+
* Go to live in a live stream.
|
|
2368
|
+
*/
|
|
2369
|
+
goToLive() {}
|
|
2350
2370
|
/**
|
|
2351
2371
|
* Get the key system currently used by EME. If EME is not being used, this
|
|
2352
2372
|
* will return an empty string. If the player has not loaded content, this
|
|
@@ -2528,6 +2548,17 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
2528
2548
|
* @return {boolean}
|
|
2529
2549
|
*/
|
|
2530
2550
|
isTextTrackVisible() {}
|
|
2551
|
+
/**
|
|
2552
|
+
* Return a list of chapters tracks.
|
|
2553
|
+
* @return {!Array.<shaka.extern.Track>}
|
|
2554
|
+
*/
|
|
2555
|
+
getChaptersTracks() {}
|
|
2556
|
+
/**
|
|
2557
|
+
* This returns the list of chapters.
|
|
2558
|
+
* @param {string} language
|
|
2559
|
+
* @return {!Array.<shaka.extern.Chapter>}
|
|
2560
|
+
*/
|
|
2561
|
+
getChapters(language) {}
|
|
2531
2562
|
/**
|
|
2532
2563
|
* Enable or disable the text displayer. If the player is in an unloaded
|
|
2533
2564
|
* state, the request will be applied next time content is loaded.
|
|
@@ -2591,6 +2622,16 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
2591
2622
|
* @return {!Promise.<shaka.extern.Track>}
|
|
2592
2623
|
*/
|
|
2593
2624
|
addTextTrackAsync(uri, language, kind, mimeType, codec, label, forced) {}
|
|
2625
|
+
/**
|
|
2626
|
+
* Adds the given chapters track to the loaded manifest. <code>load()</code>
|
|
2627
|
+
* must resolve before calling. The presentation must have a duration.
|
|
2628
|
+
* This returns the created track.
|
|
2629
|
+
* @param {string} uri
|
|
2630
|
+
* @param {string} language
|
|
2631
|
+
* @param {string=} mimeType
|
|
2632
|
+
* @return {!Promise.<shaka.extern.Track>}
|
|
2633
|
+
*/
|
|
2634
|
+
addChaptersTrack(uri, language, mimeType) {}
|
|
2594
2635
|
/**
|
|
2595
2636
|
* Set the maximum resolution that the platform's hardware can handle.
|
|
2596
2637
|
* This will be called automatically by <code>shaka.cast.CastReceiver</code>
|
|
@@ -2863,6 +2904,11 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
|
|
|
2863
2904
|
* @override
|
|
2864
2905
|
*/
|
|
2865
2906
|
replaceServerSideAdTagParameters(adTagParameters) {}
|
|
2907
|
+
/**
|
|
2908
|
+
* @return {!Array.<!shaka.extern.AdCuePoint>}
|
|
2909
|
+
* @override
|
|
2910
|
+
*/
|
|
2911
|
+
getServerSideCuePoints() {}
|
|
2866
2912
|
/**
|
|
2867
2913
|
* @return {shaka.extern.AdsStats}
|
|
2868
2914
|
* @override
|
|
@@ -3478,6 +3524,20 @@ shaka.polyfill = class {
|
|
|
3478
3524
|
*/
|
|
3479
3525
|
static register(polyfill, priority) {}
|
|
3480
3526
|
};
|
|
3527
|
+
/**
|
|
3528
|
+
* @summary A polyfill to add support for the ARIAMixin interface mixin, for
|
|
3529
|
+
* browsers that do not implement it (e.g. Firefox).
|
|
3530
|
+
* Note that IE also does not support ARIAMixin, but this polyfill does not work
|
|
3531
|
+
* for that platform, as it relies on getters and setters.
|
|
3532
|
+
* @see https://w3c.github.io/aria/#ARIAMixin
|
|
3533
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element
|
|
3534
|
+
*/
|
|
3535
|
+
shaka.polyfill.Aria = class {
|
|
3536
|
+
/**
|
|
3537
|
+
* Install the polyfill if needed.
|
|
3538
|
+
*/
|
|
3539
|
+
static install() {}
|
|
3540
|
+
};
|
|
3481
3541
|
/**
|
|
3482
3542
|
* @summary A polyfill to add support for EncryptionScheme queries in EME.
|
|
3483
3543
|
* @see https://wicg.github.io/encrypted-media-encryption-scheme/
|
|
@@ -3739,8 +3799,8 @@ shaka.text.SrtTextParser = class {
|
|
|
3739
3799
|
parseMedia(data, time) {}
|
|
3740
3800
|
/**
|
|
3741
3801
|
* Convert a SRT format to WebVTT
|
|
3742
|
-
* @param {
|
|
3743
|
-
* @return {
|
|
3802
|
+
* @param {string} data
|
|
3803
|
+
* @return {string}
|
|
3744
3804
|
*/
|
|
3745
3805
|
static srt2webvtt(data) {}
|
|
3746
3806
|
};
|