shaka-player 3.1.5 → 3.2.3

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 (134) hide show
  1. package/CHANGELOG.md +129 -6
  2. package/README.md +4 -4
  3. package/build/types/polyfill +1 -0
  4. package/demo/common/asset.js +9 -7
  5. package/demo/common/assets.js +10 -1
  6. package/demo/common/message_ids.js +2 -1
  7. package/demo/config.js +5 -2
  8. package/demo/index.html +1 -1
  9. package/demo/locales/en.json +2 -1
  10. package/demo/locales/source.json +8 -4
  11. package/demo/main.js +2 -1
  12. package/dist/demo.compiled.debug.js +14 -14
  13. package/dist/demo.compiled.debug.map +2 -2
  14. package/dist/demo.compiled.js +14 -14
  15. package/dist/demo.compiled.map +2 -2
  16. package/dist/deps.js +21 -20
  17. package/dist/locales.js +30 -30
  18. package/dist/receiver.compiled.debug.js +8 -8
  19. package/dist/receiver.compiled.debug.map +2 -2
  20. package/dist/receiver.compiled.js +8 -8
  21. package/dist/receiver.compiled.map +2 -2
  22. package/dist/shaka-player.compiled.d.ts +63 -10
  23. package/dist/shaka-player.compiled.debug.d.ts +63 -10
  24. package/dist/shaka-player.compiled.debug.externs.js +786 -716
  25. package/dist/shaka-player.compiled.debug.js +563 -534
  26. package/dist/shaka-player.compiled.debug.map +4 -4
  27. package/dist/shaka-player.compiled.externs.js +786 -716
  28. package/dist/shaka-player.compiled.js +820 -809
  29. package/dist/shaka-player.compiled.map +4 -4
  30. package/dist/shaka-player.ui.d.ts +63 -10
  31. package/dist/shaka-player.ui.debug.d.ts +63 -10
  32. package/dist/shaka-player.ui.debug.externs.js +542 -472
  33. package/dist/shaka-player.ui.debug.js +594 -566
  34. package/dist/shaka-player.ui.debug.map +4 -4
  35. package/dist/shaka-player.ui.externs.js +542 -472
  36. package/dist/shaka-player.ui.js +938 -927
  37. package/dist/shaka-player.ui.map +4 -4
  38. package/docs/tutorials/ui.md +5 -5
  39. package/externs/aria.js +6 -0
  40. package/externs/shaka/ads.js +24 -1
  41. package/externs/shaka/manifest.js +6 -1
  42. package/externs/shaka/offline.js +5 -0
  43. package/externs/shaka/player.js +61 -9
  44. package/externs/shaka/text.js +10 -10
  45. package/externs/texttrack.js +3 -0
  46. package/lib/ads/ad_manager.js +16 -15
  47. package/lib/ads/client_side_ad_manager.js +6 -2
  48. package/lib/ads/server_side_ad_manager.js +19 -2
  49. package/lib/cast/cast_proxy.js +8 -0
  50. package/lib/cast/cast_utils.js +6 -1
  51. package/lib/cea/cea608_data_channel.js +56 -56
  52. package/lib/cea/cea608_memory.js +33 -33
  53. package/lib/cea/cea708_service.js +43 -43
  54. package/lib/cea/cea708_window.js +38 -38
  55. package/lib/cea/cea_decoder.js +13 -14
  56. package/lib/cea/cea_utils.js +23 -23
  57. package/lib/cea/dtvcc_packet_builder.js +7 -7
  58. package/lib/cea/i_caption_decoder.js +2 -3
  59. package/lib/cea/i_cea_parser.js +2 -2
  60. package/lib/cea/mp4_cea_parser.js +6 -6
  61. package/lib/dash/dash_parser.js +5 -0
  62. package/lib/hls/hls_parser.js +159 -12
  63. package/lib/media/closed_caption_parser.js +1 -2
  64. package/lib/media/drm_engine.js +162 -192
  65. package/lib/media/segment_index.js +4 -1
  66. package/lib/media/segment_reference.js +37 -2
  67. package/lib/media/streaming_engine.js +6 -6
  68. package/lib/net/networking_engine.js +1 -0
  69. package/lib/offline/download_manager.js +1 -2
  70. package/lib/offline/indexeddb/v1_storage_cell.js +1 -0
  71. package/lib/offline/indexeddb/v2_storage_cell.js +1 -0
  72. package/lib/offline/manifest_converter.js +3 -1
  73. package/lib/offline/storage.js +12 -14
  74. package/lib/player.js +426 -149
  75. package/lib/polyfill/aria.js +82 -0
  76. package/lib/routing/walker.js +2 -3
  77. package/lib/text/srt_text_parser.js +4 -4
  78. package/lib/text/text_engine.js +2 -2
  79. package/lib/text/vtt_text_parser.js +2 -2
  80. package/lib/text/web_vtt_generator.js +55 -12
  81. package/lib/util/error.js +6 -0
  82. package/lib/util/manifest_parser_utils.js +1 -0
  83. package/lib/util/mp4_box_parsers.js +20 -20
  84. package/lib/util/multi_map.js +8 -0
  85. package/lib/util/player_configuration.js +13 -1
  86. package/lib/util/stream_utils.js +168 -88
  87. package/lib/util/xml_utils.js +31 -12
  88. package/package.json +1 -1
  89. package/roadmap.md +24 -22
  90. package/shaka-player.uncompiled.js +1 -0
  91. package/test/cast/cast_utils_unit.js +1 -0
  92. package/test/cea/cea608_memory_unit.js +1 -1
  93. package/test/cea/cea708_service_unit.js +8 -8
  94. package/test/cea/cea708_window_unit.js +6 -6
  95. package/test/cea/cea_decoder_unit.js +1 -1
  96. package/test/cea/dtvcc_packet_builder_unit.js +2 -2
  97. package/test/dash/dash_parser_manifest_unit.js +43 -1
  98. package/test/hls/hls_parser_unit.js +250 -0
  99. package/test/media/drm_engine_integration.js +86 -12
  100. package/test/media/drm_engine_unit.js +310 -450
  101. package/test/offline/manifest_convert_unit.js +2 -0
  102. package/test/offline/storage_integration.js +9 -19
  103. package/test/player_integration.js +85 -0
  104. package/test/player_src_equals_integration.js +85 -0
  105. package/test/player_unit.js +25 -37
  106. package/test/test/assets/chapters.srt +11 -0
  107. package/test/test/assets/chapters.vtt +10 -0
  108. package/test/test/assets/chapters2.vtt +10 -0
  109. package/test/test/util/cea_utils.js +12 -12
  110. package/test/test/util/fake_ad_manager.js +7 -0
  111. package/test/test/util/manifest_generator.js +2 -0
  112. package/test/test/util/manifest_parser_util.js +3 -1
  113. package/test/text/web_vtt_generator_unit.js +81 -7
  114. package/test/util/stream_utils_unit.js +118 -10
  115. package/ui/airplay_button.js +1 -1
  116. package/ui/audio_language_selection.js +2 -5
  117. package/ui/cast_button.js +4 -6
  118. package/ui/constants.js +0 -3
  119. package/ui/fast_forward_button.js +2 -3
  120. package/ui/fullscreen_button.js +1 -3
  121. package/ui/language_utils.js +1 -1
  122. package/ui/loop_button.js +1 -3
  123. package/ui/mute_button.js +1 -3
  124. package/ui/overflow_menu.js +2 -3
  125. package/ui/pip_button.js +5 -7
  126. package/ui/playback_rate_selection.js +3 -6
  127. package/ui/presentation_time.js +1 -3
  128. package/ui/resolution_selection.js +4 -7
  129. package/ui/rewind_button.js +2 -3
  130. package/ui/seek_bar.js +2 -4
  131. package/ui/spacer.js +1 -1
  132. package/ui/text_selection.js +8 -11
  133. package/ui/ui_utils.js +1 -1
  134. package/ui/volume_bar.js +1 -3
@@ -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,
@@ -406,357 +407,6 @@ shaka.ui.Localization.LOCALE_CHANGED;
406
407
  * @const {string}
407
408
  */
408
409
  shaka.ui.Localization.LOCALE_UPDATED;
409
- /**
410
- * @summary A set of BufferSource utility functions.
411
- */
412
- shaka.util.BufferUtils = class {
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) {}
441
- /**
442
- * Creates a DataView over the given buffer.
443
- * @see toUint8
444
- * @param {BufferSource} buffer
445
- * @param {number=} offset
446
- * @param {number=} length
447
- * @return {!DataView}
448
- */
449
- static toDataView(buffer, offset, length) {}
450
- };
451
- /**
452
- * @namespace shaka.util.StringUtils
453
- * @summary A set of string utility functions.
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
- };
499
- /**
500
- * @summary DataViewReader abstracts a DataView object.
501
- */
502
- shaka.util.DataViewReader = class {
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
- };
575
- /**
576
- * Endianness.
577
- * @enum {number}
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
410
  /**
761
411
  * @implements {shaka.extern.Cue}
762
412
  */
@@ -1089,41 +739,185 @@ shaka.text.CueRegion.scrollMode = {
1089
739
  'NONE': '',
1090
740
  'UP': 'up'
1091
741
  };
742
+ /**
743
+ * @summary A set of BufferSource utility functions.
744
+ */
745
+ shaka.util.BufferUtils = class {
746
+ /**
747
+ * Compare two buffers for equality. For buffers of different types, this
748
+ * compares the underlying buffers as binary data.
749
+ * @param {?BufferSource} arr1
750
+ * @param {?BufferSource} arr2
751
+ * @return {boolean}
752
+ */
753
+ static equal(arr1, arr2) {}
754
+ /**
755
+ * Gets an ArrayBuffer that contains the data from the given TypedArray. Note
756
+ * this will allocate a new ArrayBuffer if the object is a partial view of
757
+ * the data.
758
+ * @param {!BufferSource} view
759
+ * @return {!ArrayBuffer}
760
+ */
761
+ static toArrayBuffer(view) {}
762
+ /**
763
+ * Creates a new Uint8Array view on the same buffer. This clamps the values
764
+ * to be within the same view (i.e. you can't use this to move past the end
765
+ * of the view, even if the underlying buffer is larger). However, you can
766
+ * pass a negative offset to access the data before the view.
767
+ * @param {BufferSource} data
768
+ * @param {number=} offset The offset from the beginning of this data's view
769
+ * to start the new view at.
770
+ * @param {number=} length The byte length of the new view.
771
+ * @return {!Uint8Array}
772
+ */
773
+ static toUint8(data, offset, length) {}
774
+ /**
775
+ * Creates a DataView over the given buffer.
776
+ * @see toUint8
777
+ * @param {BufferSource} buffer
778
+ * @param {number=} offset
779
+ * @param {number=} length
780
+ * @return {!DataView}
781
+ */
782
+ static toDataView(buffer, offset, length) {}
783
+ };
1092
784
  /**
1093
785
  * An interface to standardize how objects are destroyed.
1094
786
  * @interface
1095
787
  */
1096
788
  shaka.util.IDestroyable = class {
1097
789
  /**
1098
- * Request that this object be destroyed, releasing all resources and shutting
1099
- * down all operations. Returns a Promise which is resolved when destruction
1100
- * is complete. This Promise should never be rejected.
1101
- * @return {!Promise}
790
+ * Request that this object be destroyed, releasing all resources and shutting
791
+ * down all operations. Returns a Promise which is resolved when destruction
792
+ * is complete. This Promise should never be rejected.
793
+ * @return {!Promise}
794
+ */
795
+ destroy() {}
796
+ };
797
+ /**
798
+ */
799
+ shaka.dependencies = class {
800
+ /**
801
+ * Registers a new dependency.
802
+ * @param {shaka.dependencies.Allowed} key which is used for retrieving a
803
+ * dependency
804
+ * @param {?} dep a dependency
805
+ */
806
+ static add(key, dep) {}
807
+ /**
808
+ * Check if we have a dependency for the key.
809
+ * @param {shaka.dependencies.Allowed} key key
810
+ * @return {boolean}
811
+ */
812
+ static has(key) {}
813
+ };
814
+ /**
815
+ * @enum {string}
816
+ */
817
+ shaka.dependencies.Allowed = {
818
+ muxjs: 'muxjs'
819
+ };
820
+ /**
821
+ * @namespace shaka.util.StringUtils
822
+ * @summary A set of string utility functions.
823
+ */
824
+ shaka.util.StringUtils = class {
825
+ /**
826
+ * Creates a string from the given buffer as UTF-8 encoding.
827
+ * @param {?BufferSource} data
828
+ * @return {string}
829
+ */
830
+ static fromUTF8(data) {}
831
+ /**
832
+ * Creates a string from the given buffer as UTF-16 encoding.
833
+ * @param {?BufferSource} data
834
+ * @param {boolean} littleEndian
835
+ true to read little endian, false to read big.
836
+ * @param {boolean=} noThrow true to avoid throwing in cases where we may
837
+ * expect invalid input. If noThrow is true and the data has an odd
838
+ * length,it will be truncated.
839
+ * @return {string}
840
+ */
841
+ static fromUTF16(data, littleEndian, noThrow) {}
842
+ /**
843
+ * Creates a string from the given buffer, auto-detecting the encoding that is
844
+ * being used. If it cannot detect the encoding, it will throw an exception.
845
+ * @param {?BufferSource} data
846
+ * @return {string}
847
+ */
848
+ static fromBytesAutoDetect(data) {}
849
+ /**
850
+ * Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.
851
+ * @param {string} str
852
+ * @return {!ArrayBuffer}
853
+ */
854
+ static toUTF8(str) {}
855
+ /**
856
+ * Creates a ArrayBuffer from the given string, converting to UTF-16 encoding.
857
+ * @param {string} str
858
+ * @param {boolean} littleEndian
859
+ * @return {!ArrayBuffer}
1102
860
  */
1103
- destroy() {}
861
+ static toUTF16(str, littleEndian) {}
862
+ /**
863
+ * Resets the fromCharCode method's implementation.
864
+ * For debug use.
865
+ */
866
+ static resetFromCharCode() {}
1104
867
  };
1105
868
  /**
869
+ * @summary A set of Uint8Array utility functions.
1106
870
  */
1107
- shaka.dependencies = class {
871
+ shaka.util.Uint8ArrayUtils = class {
1108
872
  /**
1109
- * Registers a new dependency.
1110
- * @param {shaka.dependencies.Allowed} key which is used for retrieving a
1111
- * dependency
1112
- * @param {?} dep a dependency
873
+ * Compare two Uint8Arrays for equality.
874
+ * @param {Uint8Array} arr1
875
+ * @param {Uint8Array} arr2
876
+ * @return {boolean}
877
+ * @deprecated
1113
878
  */
1114
- static add(key, dep) {}
879
+ static equal(arr1, arr2) {}
1115
880
  /**
1116
- * Check if we have a dependency for the key.
1117
- * @param {shaka.dependencies.Allowed} key key
1118
- * @return {boolean}
881
+ * Convert a buffer to a base64 string. The output will be standard
882
+ * alphabet as opposed to base64url safe alphabet.
883
+ * @param {BufferSource} data
884
+ * @return {string}
1119
885
  */
1120
- static has(key) {}
1121
- };
1122
- /**
1123
- * @enum {string}
1124
- */
1125
- shaka.dependencies.Allowed = {
1126
- muxjs: 'muxjs'
886
+ static toStandardBase64(data) {}
887
+ /**
888
+ * Convert a buffer to a base64 string. The output will always use the
889
+ * alternate encoding/alphabet also known as "base64url".
890
+ * @param {BufferSource} data
891
+ * @param {boolean=} padding If true, pad the output with equals signs.
892
+ * Defaults to true.
893
+ * @return {string}
894
+ */
895
+ static toBase64(data, padding) {}
896
+ /**
897
+ * Convert a base64 string to a Uint8Array. Accepts either the standard
898
+ * alphabet or the alternate "base64url" alphabet.
899
+ * @param {string} str
900
+ * @return {!Uint8Array}
901
+ */
902
+ static fromBase64(str) {}
903
+ /**
904
+ * Convert a hex string to a Uint8Array.
905
+ * @param {string} str
906
+ * @return {!Uint8Array}
907
+ */
908
+ static fromHex(str) {}
909
+ /**
910
+ * Convert a buffer to a hex string.
911
+ * @param {BufferSource} data
912
+ * @return {string}
913
+ */
914
+ static toHex(data) {}
915
+ /**
916
+ * Concatenate buffers.
917
+ * @param {...BufferSource} varArgs
918
+ * @return {!Uint8Array}
919
+ */
920
+ static concat(...varArgs) {}
1127
921
  };
1128
922
  /**
1129
923
  * @summary Manages text parsers and cues.
@@ -1151,70 +945,42 @@ shaka.text.TextEngine = class {
1151
945
  destroy() {}
1152
946
  };
1153
947
  /**
1154
- * An interface to standardize how objects release internal references
1155
- * synchronously. If an object needs to asynchronously release references, then
1156
- * it should use 'shaka.util.IDestroyable'.
1157
- * @interface
1158
- */
1159
- shaka.util.IReleasable = class {
1160
- /**
1161
- * Request that this object release all internal references.
1162
- */
1163
- release() {}
1164
- };
1165
- /**
1166
- * @summary
1167
- * An EventManager maintains a collection of "event
1168
- * bindings" between event targets and event listeners.
1169
- * @implements {shaka.util.IReleasable}
948
+ * A timer allows a single function to be executed at a later time or at
949
+ * regular intervals.
950
+ * @final
1170
951
  */
1171
- shaka.util.EventManager = class {
1172
- /** */
1173
- constructor() {}
952
+ shaka.util.Timer = class {
1174
953
  /**
1175
- * Detaches all event listeners.
1176
- * @override
954
+ * Create a new timer. A timer is committed to a single callback function.
955
+ * While there is no technical reason to do this, it is far easier to
956
+ * understand and use timers when they are connected to one functional idea.
957
+ * @param {function()} onTick
1177
958
  */
1178
- release() {}
959
+ constructor(onTick) {}
1179
960
  /**
1180
- * Attaches an event listener to an event target.
1181
- * @param {EventTarget} target The event target.
1182
- * @param {string} type The event type.
1183
- * @param {shaka.util.EventManager.ListenerType} listener The event listener.
1184
- * @param {(boolean|!AddEventListenerOptions)=} options An object that
1185
- * specifies characteristics about the event listener.
1186
- * The passive option, if true, indicates that this function will never
1187
- * call preventDefault(), which improves scrolling performance.
961
+ * Have the timer call |onTick| now.
962
+ * @return {!shaka.util.Timer}
1188
963
  */
1189
- listen(target, type, listener, options) {}
964
+ tickNow() {}
1190
965
  /**
1191
- * Attaches an event listener to an event target. The listener will be
1192
- * removed when the first instance of the event is fired.
1193
- * @param {EventTarget} target The event target.
1194
- * @param {string} type The event type.
1195
- * @param {shaka.util.EventManager.ListenerType} listener The event listener.
1196
- * @param {(boolean|!AddEventListenerOptions)=} options An object that
1197
- * specifies characteristics about the event listener.
1198
- * The passive option, if true, indicates that this function will never
1199
- * call preventDefault(), which improves scrolling performance.
966
+ * Have the timer call |onTick| after |seconds| has elapsed unless |stop| is
967
+ * called first.
968
+ * @param {number} seconds
969
+ * @return {!shaka.util.Timer}
1200
970
  */
1201
- listenOnce(target, type, listener, options) {}
971
+ tickAfter(seconds) {}
1202
972
  /**
1203
- * Detaches an event listener from an event target.
1204
- * @param {EventTarget} target The event target.
1205
- * @param {string} type The event type.
1206
- * @param {shaka.util.EventManager.ListenerType=} listener The event listener.
973
+ * Have the timer call |onTick| every |seconds| until |stop| is called.
974
+ * @param {number} seconds
975
+ * @return {!shaka.util.Timer}
1207
976
  */
1208
- unlisten(target, type, listener) {}
977
+ tickEvery(seconds) {}
1209
978
  /**
1210
- * Detaches all event listeners from all targets.
979
+ * Stop the timer and clear the previous behaviour. The timer is still usable
980
+ * after calling |stop|.
1211
981
  */
1212
- removeAll() {}
982
+ stop() {}
1213
983
  };
1214
- /**
1215
- * @typedef {function(!Event)}
1216
- */
1217
- shaka.util.EventManager.ListenerType;
1218
984
  /**
1219
985
  * @summary
1220
986
  * <p>
@@ -1466,54 +1232,120 @@ shaka.net.NetworkingEngine.NumBytesRemainingClass = class {
1466
1232
  /**
1467
1233
  * Constructor
1468
1234
  */
1469
- constructor() {}
1470
- };
1471
- /**
1472
- * A pending network request. This can track the current progress of the
1473
- * download, and allows the request to be aborted if the network is slow.
1474
- * @implements {shaka.extern.IAbortableOperation.<shaka.extern.Response>}
1475
- * @extends {shaka.util.AbortableOperation}
1476
- */
1477
- shaka.net.NetworkingEngine.PendingRequest = class extends shaka.util.AbortableOperation {
1235
+ constructor() {}
1236
+ };
1237
+ /**
1238
+ * A pending network request. This can track the current progress of the
1239
+ * download, and allows the request to be aborted if the network is slow.
1240
+ * @implements {shaka.extern.IAbortableOperation.<shaka.extern.Response>}
1241
+ * @extends {shaka.util.AbortableOperation}
1242
+ */
1243
+ shaka.net.NetworkingEngine.PendingRequest = class extends shaka.util.AbortableOperation {
1244
+ /**
1245
+ * @param {!Promise} promise
1246
+ * A Promise which represents the underlying operation. It is resolved
1247
+ * when the operation is complete, and rejected if the operation fails or
1248
+ * is aborted. Aborted operations should be rejected with a
1249
+ * shaka.util.Error object using the error code OPERATION_ABORTED.
1250
+ * @param {function():!Promise} onAbort
1251
+ * Will be called by this object to abort the underlying operation. This
1252
+ * is not cancelation, and will not necessarily result in any work being
1253
+ * undone. abort() should return a Promise which is resolved when the
1254
+ * underlying operation has been aborted. The returned Promise should
1255
+ * never be rejected.
1256
+ * @param {shaka.net.NetworkingEngine.NumBytesRemainingClass}
1257
+ * numBytesRemainingObj
1258
+ */
1259
+ constructor(promise, onAbort, numBytesRemainingObj) {}
1260
+ };
1261
+ /**
1262
+ * Request types. Allows a filter to decide which requests to read/alter.
1263
+ * @enum {number}
1264
+ */
1265
+ shaka.net.NetworkingEngine.RequestType = {
1266
+ 'MANIFEST': 0,
1267
+ 'SEGMENT': 1,
1268
+ 'LICENSE': 2,
1269
+ 'APP': 3,
1270
+ 'TIMING': 4,
1271
+ 'SERVER_CERTIFICATE': 5
1272
+ };
1273
+ /**
1274
+ * Priority level for network scheme plugins.
1275
+ * If multiple plugins are provided for the same scheme, only the
1276
+ * highest-priority one is used.
1277
+ * @enum {number}
1278
+ */
1279
+ shaka.net.NetworkingEngine.PluginPriority = {
1280
+ 'FALLBACK': 1,
1281
+ 'PREFERRED': 2,
1282
+ 'APPLICATION': 3
1283
+ };
1284
+ /**
1285
+ * An interface to standardize how objects release internal references
1286
+ * synchronously. If an object needs to asynchronously release references, then
1287
+ * it should use 'shaka.util.IDestroyable'.
1288
+ * @interface
1289
+ */
1290
+ shaka.util.IReleasable = class {
1291
+ /**
1292
+ * Request that this object release all internal references.
1293
+ */
1294
+ release() {}
1295
+ };
1296
+ /**
1297
+ * @summary
1298
+ * An EventManager maintains a collection of "event
1299
+ * bindings" between event targets and event listeners.
1300
+ * @implements {shaka.util.IReleasable}
1301
+ */
1302
+ shaka.util.EventManager = class {
1303
+ /** */
1304
+ constructor() {}
1305
+ /**
1306
+ * Detaches all event listeners.
1307
+ * @override
1308
+ */
1309
+ release() {}
1310
+ /**
1311
+ * Attaches an event listener to an event target.
1312
+ * @param {EventTarget} target The event target.
1313
+ * @param {string} type The event type.
1314
+ * @param {shaka.util.EventManager.ListenerType} listener The event listener.
1315
+ * @param {(boolean|!AddEventListenerOptions)=} options An object that
1316
+ * specifies characteristics about the event listener.
1317
+ * The passive option, if true, indicates that this function will never
1318
+ * call preventDefault(), which improves scrolling performance.
1319
+ */
1320
+ listen(target, type, listener, options) {}
1321
+ /**
1322
+ * Attaches an event listener to an event target. The listener will be
1323
+ * removed when the first instance of the event is fired.
1324
+ * @param {EventTarget} target The event target.
1325
+ * @param {string} type The event type.
1326
+ * @param {shaka.util.EventManager.ListenerType} listener The event listener.
1327
+ * @param {(boolean|!AddEventListenerOptions)=} options An object that
1328
+ * specifies characteristics about the event listener.
1329
+ * The passive option, if true, indicates that this function will never
1330
+ * call preventDefault(), which improves scrolling performance.
1331
+ */
1332
+ listenOnce(target, type, listener, options) {}
1333
+ /**
1334
+ * Detaches an event listener from an event target.
1335
+ * @param {EventTarget} target The event target.
1336
+ * @param {string} type The event type.
1337
+ * @param {shaka.util.EventManager.ListenerType=} listener The event listener.
1338
+ */
1339
+ unlisten(target, type, listener) {}
1478
1340
  /**
1479
- * @param {!Promise} promise
1480
- * A Promise which represents the underlying operation. It is resolved
1481
- * when the operation is complete, and rejected if the operation fails or
1482
- * is aborted. Aborted operations should be rejected with a
1483
- * shaka.util.Error object using the error code OPERATION_ABORTED.
1484
- * @param {function():!Promise} onAbort
1485
- * Will be called by this object to abort the underlying operation. This
1486
- * is not cancelation, and will not necessarily result in any work being
1487
- * undone. abort() should return a Promise which is resolved when the
1488
- * underlying operation has been aborted. The returned Promise should
1489
- * never be rejected.
1490
- * @param {shaka.net.NetworkingEngine.NumBytesRemainingClass}
1491
- * numBytesRemainingObj
1341
+ * Detaches all event listeners from all targets.
1492
1342
  */
1493
- constructor(promise, onAbort, numBytesRemainingObj) {}
1494
- };
1495
- /**
1496
- * Request types. Allows a filter to decide which requests to read/alter.
1497
- * @enum {number}
1498
- */
1499
- shaka.net.NetworkingEngine.RequestType = {
1500
- 'MANIFEST': 0,
1501
- 'SEGMENT': 1,
1502
- 'LICENSE': 2,
1503
- 'APP': 3,
1504
- 'TIMING': 4
1343
+ removeAll() {}
1505
1344
  };
1506
1345
  /**
1507
- * Priority level for network scheme plugins.
1508
- * If multiple plugins are provided for the same scheme, only the
1509
- * highest-priority one is used.
1510
- * @enum {number}
1346
+ * @typedef {function(!Event)}
1511
1347
  */
1512
- shaka.net.NetworkingEngine.PluginPriority = {
1513
- 'FALLBACK': 1,
1514
- 'PREFERRED': 2,
1515
- 'APPLICATION': 3
1516
- };
1348
+ shaka.util.EventManager.ListenerType;
1517
1349
  /**
1518
1350
  * @summary A set of FairPlay utility functions.
1519
1351
  */
@@ -1567,6 +1399,176 @@ shaka.media.ManifestParser = class {
1567
1399
  */
1568
1400
  static unregisterParserByMime(mimeType) {}
1569
1401
  };
1402
+ /**
1403
+ * @summary DataViewReader abstracts a DataView object.
1404
+ */
1405
+ shaka.util.DataViewReader = class {
1406
+ /**
1407
+ * @param {BufferSource} data
1408
+ * @param {shaka.util.DataViewReader.Endianness} endianness The endianness.
1409
+ */
1410
+ constructor(data, endianness) {}
1411
+ /**
1412
+ * @return {boolean} True if the reader has more data, false otherwise.
1413
+ */
1414
+ hasMoreData() {}
1415
+ /**
1416
+ * Gets the current byte position.
1417
+ * @return {number}
1418
+ */
1419
+ getPosition() {}
1420
+ /**
1421
+ * Gets the byte length of the DataView.
1422
+ * @return {number}
1423
+ */
1424
+ getLength() {}
1425
+ /**
1426
+ * Reads an unsigned 8 bit integer, and advances the reader.
1427
+ * @return {number} The integer.
1428
+ */
1429
+ readUint8() {}
1430
+ /**
1431
+ * Reads an unsigned 16 bit integer, and advances the reader.
1432
+ * @return {number} The integer.
1433
+ */
1434
+ readUint16() {}
1435
+ /**
1436
+ * Reads an unsigned 32 bit integer, and advances the reader.
1437
+ * @return {number} The integer.
1438
+ */
1439
+ readUint32() {}
1440
+ /**
1441
+ * Reads a signed 32 bit integer, and advances the reader.
1442
+ * @return {number} The integer.
1443
+ */
1444
+ readInt32() {}
1445
+ /**
1446
+ * Reads an unsigned 64 bit integer, and advances the reader.
1447
+ * @return {number} The integer.
1448
+ */
1449
+ readUint64() {}
1450
+ /**
1451
+ * Reads the specified number of raw bytes.
1452
+ * @param {number} bytes The number of bytes to read.
1453
+ * @return {!Uint8Array}
1454
+ */
1455
+ readBytes(bytes) {}
1456
+ /**
1457
+ * Skips the specified number of bytes.
1458
+ * @param {number} bytes The number of bytes to skip.
1459
+ */
1460
+ skip(bytes) {}
1461
+ /**
1462
+ * Rewinds the specified number of bytes.
1463
+ * @param {number} bytes The number of bytes to rewind.
1464
+ */
1465
+ rewind(bytes) {}
1466
+ /**
1467
+ * Seeks to a specified position.
1468
+ * @param {number} position The desired byte position within the DataView.
1469
+ */
1470
+ seek(position) {}
1471
+ /**
1472
+ * Keeps reading until it reaches a byte that equals to zero. The text is
1473
+ * assumed to be UTF-8.
1474
+ * @return {string}
1475
+ */
1476
+ readTerminatedString() {}
1477
+ };
1478
+ /**
1479
+ * Endianness.
1480
+ * @enum {number}
1481
+ */
1482
+ shaka.util.DataViewReader.Endianness = {
1483
+ 'BIG_ENDIAN': 0,
1484
+ 'LITTLE_ENDIAN': 1
1485
+ };
1486
+ /**
1487
+ */
1488
+ shaka.util.Mp4Parser = class {
1489
+ /** */
1490
+ constructor() {}
1491
+ /**
1492
+ * Declare a box type as a Box.
1493
+ * @param {string} type
1494
+ * @param {!shaka.util.Mp4Parser.CallbackType} definition
1495
+ * @return {!shaka.util.Mp4Parser}
1496
+ */
1497
+ box(type, definition) {}
1498
+ /**
1499
+ * Declare a box type as a Full Box.
1500
+ * @param {string} type
1501
+ * @param {!shaka.util.Mp4Parser.CallbackType} definition
1502
+ * @return {!shaka.util.Mp4Parser}
1503
+ */
1504
+ fullBox(type, definition) {}
1505
+ /**
1506
+ * Stop parsing. Useful for extracting information from partial segments and
1507
+ * avoiding an out-of-bounds error once you find what you are looking for.
1508
+ */
1509
+ stop() {}
1510
+ /**
1511
+ * Parse the given data using the added callbacks.
1512
+ * @param {!BufferSource} data
1513
+ * @param {boolean=} partialOkay If true, allow reading partial payloads
1514
+ * from some boxes. If the goal is a child box, we can sometimes find it
1515
+ * without enough data to find all child boxes.
1516
+ * @param {boolean=} stopOnPartial If true, stop reading if an incomplete
1517
+ * box is detected.
1518
+ */
1519
+ parse(data, partialOkay, stopOnPartial) {}
1520
+ /**
1521
+ * Parse the next box on the current level.
1522
+ * @param {number} absStart The absolute start position in the original
1523
+ * byte array.
1524
+ * @param {!shaka.util.DataViewReader} reader
1525
+ * @param {boolean=} partialOkay If true, allow reading partial payloads
1526
+ * from some boxes. If the goal is a child box, we can sometimes find it
1527
+ * without enough data to find all child boxes.
1528
+ * @param {boolean=} stopOnPartial If true, stop reading if an incomplete
1529
+ * box is detected.
1530
+ */
1531
+ parseNext(absStart, reader, partialOkay, stopOnPartial) {}
1532
+ /**
1533
+ * A callback that tells the Mp4 parser to treat the body of a box as a series
1534
+ * of boxes. The number of boxes is limited by the size of the parent box.
1535
+ * @param {!shaka.extern.ParsedBox} box
1536
+ */
1537
+ static children(box) {}
1538
+ /**
1539
+ * A callback that tells the Mp4 parser to treat the body of a box as a sample
1540
+ * description. A sample description box has a fixed number of children. The
1541
+ * number of children is represented by a 4 byte unsigned integer. Each child
1542
+ * is a box.
1543
+ * @param {!shaka.extern.ParsedBox} box
1544
+ */
1545
+ static sampleDescription(box) {}
1546
+ /**
1547
+ * Create a callback that tells the Mp4 parser to treat the body of a box as a
1548
+ * binary blob and to parse the body's contents using the provided callback.
1549
+ * @param {function(!Uint8Array)} callback
1550
+ * @return {!shaka.util.Mp4Parser.CallbackType}
1551
+ */
1552
+ static allData(callback) {}
1553
+ /**
1554
+ * Convert an integer type from a box into an ascii string name.
1555
+ * Useful for debugging.
1556
+ * @param {number} type The type of the box, a uint32.
1557
+ * @return {string}
1558
+ */
1559
+ static typeToString(type) {}
1560
+ /**
1561
+ * Find the header size of the box.
1562
+ * Useful for modifying boxes in place or finding the exact offset of a field.
1563
+ * @param {shaka.extern.ParsedBox} box
1564
+ * @return {number}
1565
+ */
1566
+ static headerSize(box) {}
1567
+ };
1568
+ /**
1569
+ * @typedef {function(!shaka.extern.ParsedBox)}
1570
+ */
1571
+ shaka.util.Mp4Parser.CallbackType;
1570
1572
  /**
1571
1573
  * Creates an InitSegmentReference, which provides the location to an
1572
1574
  * initialization segment.
@@ -1637,9 +1639,17 @@ shaka.media.SegmentReference = class {
1637
1639
  * presentation. Any content from after this time will be removed by
1638
1640
  * MediaSource.
1639
1641
  * @param {!Array.<!shaka.media.SegmentReference>=} partialReferences
1640
- A list of SegmentReferences for the partial segments.
1641
- */
1642
- constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences) {}
1642
+ * A list of SegmentReferences for the partial segments.
1643
+ * @param {?string=} tilesLayout
1644
+ * The value is a grid-item-dimension consisting of two positive decimal
1645
+ * integers in the format: column-x-row ('4x3'). It describes the
1646
+ * arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
1647
+ * @param {?number=} tileDuration
1648
+ * The explicit duration of an individual tile within the tiles grid.
1649
+ * If not provided, the duration should be automatically calculated based on
1650
+ * the duration of the reference.
1651
+ */
1652
+ constructor(startTime, endTime, uris, startByte, endByte, initSegmentReference, timestampOffset, appendWindowStart, appendWindowEnd, partialReferences, tilesLayout, tileDuration) {}
1643
1653
  /**
1644
1654
  * Creates and returns the URIs of the resource containing the segment.
1645
1655
  * @return {!Array.<string>}
@@ -1668,6 +1678,17 @@ shaka.media.SegmentReference = class {
1668
1678
  * @return {?number}
1669
1679
  */
1670
1680
  getEndByte() {}
1681
+ /**
1682
+ * Returns the segment's tiles layout. Only defined in image segments.
1683
+ * @return {?string}
1684
+ */
1685
+ getTilesLayout() {}
1686
+ /**
1687
+ * Returns the segment's explicit tile duration.
1688
+ * Only defined in image segments.
1689
+ * @return {?number}
1690
+ */
1691
+ getTileDuration() {}
1671
1692
  };
1672
1693
  /**
1673
1694
  * PresentationTimeline.
@@ -2289,6 +2310,11 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2289
2310
  * @return {shaka.extern.PlayerConfiguration}
2290
2311
  */
2291
2312
  getConfiguration() {}
2313
+ /**
2314
+ * Returns the ratio of video length buffered compared to buffering Goal
2315
+ * @return {number}
2316
+ */
2317
+ getBufferFullness() {}
2292
2318
  /**
2293
2319
  * Reset configuration to default.
2294
2320
  */
@@ -2351,6 +2377,10 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2351
2377
  * @return {{start: number, end: number}}
2352
2378
  */
2353
2379
  seekRange() {}
2380
+ /**
2381
+ * Go to live in a live stream.
2382
+ */
2383
+ goToLive() {}
2354
2384
  /**
2355
2385
  * Get the key system currently used by EME. If EME is not being used, this
2356
2386
  * will return an empty string. If the player has not loaded content, this
@@ -2532,6 +2562,17 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2532
2562
  * @return {boolean}
2533
2563
  */
2534
2564
  isTextTrackVisible() {}
2565
+ /**
2566
+ * Return a list of chapters tracks.
2567
+ * @return {!Array.<shaka.extern.Track>}
2568
+ */
2569
+ getChaptersTracks() {}
2570
+ /**
2571
+ * This returns the list of chapters.
2572
+ * @param {string} language
2573
+ * @return {!Array.<shaka.extern.Chapter>}
2574
+ */
2575
+ getChapters(language) {}
2535
2576
  /**
2536
2577
  * Enable or disable the text displayer. If the player is in an unloaded
2537
2578
  * state, the request will be applied next time content is loaded.
@@ -2595,6 +2636,16 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
2595
2636
  * @return {!Promise.<shaka.extern.Track>}
2596
2637
  */
2597
2638
  addTextTrackAsync(uri, language, kind, mimeType, codec, label, forced) {}
2639
+ /**
2640
+ * Adds the given chapters track to the loaded manifest. <code>load()</code>
2641
+ * must resolve before calling. The presentation must have a duration.
2642
+ * This returns the created track.
2643
+ * @param {string} uri
2644
+ * @param {string} language
2645
+ * @param {string=} mimeType
2646
+ * @return {!Promise.<shaka.extern.Track>}
2647
+ */
2648
+ addChaptersTrack(uri, language, mimeType) {}
2598
2649
  /**
2599
2650
  * Set the maximum resolution that the platform's hardware can handle.
2600
2651
  * This will be called automatically by <code>shaka.cast.CastReceiver</code>
@@ -2867,6 +2918,11 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
2867
2918
  * @override
2868
2919
  */
2869
2920
  replaceServerSideAdTagParameters(adTagParameters) {}
2921
+ /**
2922
+ * @return {!Array.<!shaka.extern.AdCuePoint>}
2923
+ * @override
2924
+ */
2925
+ getServerSideCuePoints() {}
2870
2926
  /**
2871
2927
  * @return {shaka.extern.AdsStats}
2872
2928
  * @override
@@ -3482,6 +3538,20 @@ shaka.polyfill = class {
3482
3538
  */
3483
3539
  static register(polyfill, priority) {}
3484
3540
  };
3541
+ /**
3542
+ * @summary A polyfill to add support for the ARIAMixin interface mixin, for
3543
+ * browsers that do not implement it (e.g. Firefox).
3544
+ * Note that IE also does not support ARIAMixin, but this polyfill does not work
3545
+ * for that platform, as it relies on getters and setters.
3546
+ * @see https://w3c.github.io/aria/#ARIAMixin
3547
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element
3548
+ */
3549
+ shaka.polyfill.Aria = class {
3550
+ /**
3551
+ * Install the polyfill if needed.
3552
+ */
3553
+ static install() {}
3554
+ };
3485
3555
  /**
3486
3556
  * @summary A polyfill to add support for EncryptionScheme queries in EME.
3487
3557
  * @see https://wicg.github.io/encrypted-media-encryption-scheme/
@@ -3750,8 +3820,8 @@ shaka.text.SrtTextParser = class {
3750
3820
  parseMedia(data, time) {}
3751
3821
  /**
3752
3822
  * Convert a SRT format to WebVTT
3753
- * @param {!string} data
3754
- * @return {!string}
3823
+ * @param {string} data
3824
+ * @return {string}
3755
3825
  */
3756
3826
  static srt2webvtt(data) {}
3757
3827
  };