shaka-player 4.7.11 → 4.7.12

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 (44) hide show
  1. package/README.md +2 -4
  2. package/dist/deps.js +3 -4
  3. package/dist/locales.js +31 -31
  4. package/dist/shaka-player.compiled.d.ts +12 -10
  5. package/dist/shaka-player.compiled.debug.d.ts +12 -10
  6. package/dist/shaka-player.compiled.debug.externs.js +78 -64
  7. package/dist/shaka-player.compiled.debug.js +168 -163
  8. package/dist/shaka-player.compiled.debug.map +4 -4
  9. package/dist/shaka-player.compiled.externs.js +78 -64
  10. package/dist/shaka-player.compiled.js +1134 -1128
  11. package/dist/shaka-player.compiled.map +4 -4
  12. package/dist/shaka-player.ui.d.ts +12 -10
  13. package/dist/shaka-player.ui.debug.d.ts +12 -10
  14. package/dist/shaka-player.ui.debug.externs.js +78 -64
  15. package/dist/shaka-player.ui.debug.js +178 -174
  16. package/dist/shaka-player.ui.debug.map +4 -4
  17. package/dist/shaka-player.ui.externs.js +78 -64
  18. package/dist/shaka-player.ui.js +1264 -1258
  19. package/dist/shaka-player.ui.map +4 -4
  20. package/externs/shaka/player.js +32 -19
  21. package/lib/abr/simple_abr_manager.js +21 -26
  22. package/lib/cast/cast_proxy.js +1 -3
  23. package/lib/cast/cast_sender.js +8 -11
  24. package/lib/cea/cea608_memory.js +1 -1
  25. package/lib/cea/ts_cea_parser.js +10 -1
  26. package/lib/dash/dash_parser.js +3 -0
  27. package/lib/hls/hls_parser.js +18 -16
  28. package/lib/media/drm_engine.js +6 -3
  29. package/lib/media/media_source_engine.js +25 -12
  30. package/lib/media/presentation_timeline.js +23 -0
  31. package/lib/media/segment_utils.js +10 -1
  32. package/lib/player.js +15 -2
  33. package/lib/polyfill/media_capabilities.js +20 -1
  34. package/lib/polyfill/mediasource.js +37 -14
  35. package/lib/text/vtt_text_parser.js +51 -51
  36. package/lib/transmuxer/h264.js +3 -3
  37. package/lib/transmuxer/h265.js +3 -3
  38. package/lib/transmuxer/ts_transmuxer.js +42 -3
  39. package/lib/util/manifest_parser_utils.js +1 -0
  40. package/lib/util/mp4_parser.js +57 -0
  41. package/lib/util/platform.js +4 -0
  42. package/lib/util/ts_parser.js +99 -10
  43. package/package.json +1 -1
  44. package/lib/polyfill/storage_estimate.js +0 -57
@@ -1073,6 +1073,7 @@ declare namespace shaka.media {
1073
1073
  */
1074
1074
  getDelay ( ) : number ;
1075
1075
  getDuration ( ) : number ;
1076
+ getInitialProgramDateTime ( ) : number | null ;
1076
1077
  getMaxSegmentDuration ( ) : number ;
1077
1078
  getPresentationStartTime ( ) : number | null ;
1078
1079
  /**
@@ -1170,6 +1171,10 @@ declare namespace shaka.media {
1170
1171
  * @param duration The presentation's duration in seconds. Infinity indicates that the presentation continues indefinitely.
1171
1172
  */
1172
1173
  setDuration (duration : number ) : any ;
1174
+ /**
1175
+ * Sets the initial program date time.
1176
+ */
1177
+ setInitialProgramDateTime (initialProgramDateTime : number ) : any ;
1173
1178
  /**
1174
1179
  * Sets the presentation's start time.
1175
1180
  * @param presentationStartTime The wall-clock time, in seconds, when the presentation started or will start. Only required for live.
@@ -1921,16 +1926,6 @@ declare namespace shaka.polyfill {
1921
1926
  }
1922
1927
  }
1923
1928
  // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.externs.js
1924
- declare namespace shaka.polyfill {
1925
- class StorageEstimate {
1926
- private noStructuralTyping_shaka_polyfill_StorageEstimate : any;
1927
- /**
1928
- * Install the polyfill if needed.
1929
- */
1930
- static install ( ) : any ;
1931
- }
1932
- }
1933
- // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.externs.js
1934
1929
  declare namespace shaka.polyfill {
1935
1930
  class Symbol {
1936
1931
  private noStructuralTyping_shaka_polyfill_Symbol : any;
@@ -3919,6 +3914,13 @@ declare namespace shaka.util {
3919
3914
  * binary blob and to parse the body's contents using the provided callback.
3920
3915
  */
3921
3916
  static allData (callback : (a : Uint8Array ) => any ) : shaka.util.Mp4Parser.CallbackType ;
3917
+ /**
3918
+ * A callback that tells the Mp4 parser to treat the body of a box as a audio
3919
+ * sample entry. A audio sample entry has some fixed-sized fields
3920
+ * describing the audio codec parameters, followed by an arbitrary number of
3921
+ * appended children. Each child is a box.
3922
+ */
3923
+ static audioSampleEntry (box : shaka.extern.ParsedBox ) : any ;
3922
3924
  /**
3923
3925
  * A callback that tells the Mp4 parser to treat the body of a box as a series
3924
3926
  * of boxes. The number of boxes is limited by the size of the parent box.
@@ -1073,6 +1073,7 @@ declare namespace shaka.media {
1073
1073
  */
1074
1074
  getDelay ( ) : number ;
1075
1075
  getDuration ( ) : number ;
1076
+ getInitialProgramDateTime ( ) : number | null ;
1076
1077
  getMaxSegmentDuration ( ) : number ;
1077
1078
  getPresentationStartTime ( ) : number | null ;
1078
1079
  /**
@@ -1170,6 +1171,10 @@ declare namespace shaka.media {
1170
1171
  * @param duration The presentation's duration in seconds. Infinity indicates that the presentation continues indefinitely.
1171
1172
  */
1172
1173
  setDuration (duration : number ) : any ;
1174
+ /**
1175
+ * Sets the initial program date time.
1176
+ */
1177
+ setInitialProgramDateTime (initialProgramDateTime : number ) : any ;
1173
1178
  /**
1174
1179
  * Sets the presentation's start time.
1175
1180
  * @param presentationStartTime The wall-clock time, in seconds, when the presentation started or will start. Only required for live.
@@ -1921,16 +1926,6 @@ declare namespace shaka.polyfill {
1921
1926
  }
1922
1927
  }
1923
1928
  // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
1924
- declare namespace shaka.polyfill {
1925
- class StorageEstimate {
1926
- private noStructuralTyping_shaka_polyfill_StorageEstimate : any;
1927
- /**
1928
- * Install the polyfill if needed.
1929
- */
1930
- static install ( ) : any ;
1931
- }
1932
- }
1933
- // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
1934
1929
  declare namespace shaka.polyfill {
1935
1930
  class Symbol {
1936
1931
  private noStructuralTyping_shaka_polyfill_Symbol : any;
@@ -3919,6 +3914,13 @@ declare namespace shaka.util {
3919
3914
  * binary blob and to parse the body's contents using the provided callback.
3920
3915
  */
3921
3916
  static allData (callback : (a : Uint8Array ) => any ) : shaka.util.Mp4Parser.CallbackType ;
3917
+ /**
3918
+ * A callback that tells the Mp4 parser to treat the body of a box as a audio
3919
+ * sample entry. A audio sample entry has some fixed-sized fields
3920
+ * describing the audio codec parameters, followed by an arbitrary number of
3921
+ * appended children. Each child is a box.
3922
+ */
3923
+ static audioSampleEntry (box : shaka.extern.ParsedBox ) : any ;
3922
3924
  /**
3923
3925
  * A callback that tells the Mp4 parser to treat the body of a box as a series
3924
3926
  * of boxes. The number of boxes is limited by the size of the parent box.
@@ -595,6 +595,59 @@ shaka.ui.Localization.LOCALE_CHANGED;
595
595
  * @const {string}
596
596
  */
597
597
  shaka.ui.Localization.LOCALE_UPDATED;
598
+ /**
599
+ * @summary
600
+ * An EventManager maintains a collection of "event
601
+ * bindings" between event targets and event listeners.
602
+ * @implements {shaka.util.IReleasable}
603
+ */
604
+ shaka.util.EventManager = class {
605
+ /** */
606
+ constructor() {}
607
+ /**
608
+ * Detaches all event listeners.
609
+ * @override
610
+ */
611
+ release() {}
612
+ /**
613
+ * Attaches an event listener to an event target.
614
+ * @param {EventTarget} target The event target.
615
+ * @param {string} type The event type.
616
+ * @param {shaka.util.EventManager.ListenerType} listener The event listener.
617
+ * @param {(boolean|!AddEventListenerOptions)=} options An object that
618
+ * specifies characteristics about the event listener.
619
+ * The passive option, if true, indicates that this function will never
620
+ * call preventDefault(), which improves scrolling performance.
621
+ */
622
+ listen(target, type, listener, options) {}
623
+ /**
624
+ * Attaches an event listener to an event target. The listener will be
625
+ * removed when the first instance of the event is fired.
626
+ * @param {EventTarget} target The event target.
627
+ * @param {string} type The event type.
628
+ * @param {shaka.util.EventManager.ListenerType} listener The event listener.
629
+ * @param {(boolean|!AddEventListenerOptions)=} options An object that
630
+ * specifies characteristics about the event listener.
631
+ * The passive option, if true, indicates that this function will never
632
+ * call preventDefault(), which improves scrolling performance.
633
+ */
634
+ listenOnce(target, type, listener, options) {}
635
+ /**
636
+ * Detaches an event listener from an event target.
637
+ * @param {EventTarget} target The event target.
638
+ * @param {string} type The event type.
639
+ * @param {shaka.util.EventManager.ListenerType=} listener The event listener.
640
+ */
641
+ unlisten(target, type, listener) {}
642
+ /**
643
+ * Detaches all event listeners from all targets.
644
+ */
645
+ removeAll() {}
646
+ };
647
+ /**
648
+ * @typedef {function(!Event)}
649
+ */
650
+ shaka.util.EventManager.ListenerType;
598
651
  /**
599
652
  * @summary A set of BufferSource utility functions.
600
653
  */
@@ -1691,59 +1744,6 @@ shaka.net.NetworkingEngine.OnRequest;
1691
1744
  * new URI and the second string is the old URI.
1692
1745
  */
1693
1746
  shaka.net.NetworkingEngine.OnRetry;
1694
- /**
1695
- * @summary
1696
- * An EventManager maintains a collection of "event
1697
- * bindings" between event targets and event listeners.
1698
- * @implements {shaka.util.IReleasable}
1699
- */
1700
- shaka.util.EventManager = class {
1701
- /** */
1702
- constructor() {}
1703
- /**
1704
- * Detaches all event listeners.
1705
- * @override
1706
- */
1707
- release() {}
1708
- /**
1709
- * Attaches an event listener to an event target.
1710
- * @param {EventTarget} target The event target.
1711
- * @param {string} type The event type.
1712
- * @param {shaka.util.EventManager.ListenerType} listener The event listener.
1713
- * @param {(boolean|!AddEventListenerOptions)=} options An object that
1714
- * specifies characteristics about the event listener.
1715
- * The passive option, if true, indicates that this function will never
1716
- * call preventDefault(), which improves scrolling performance.
1717
- */
1718
- listen(target, type, listener, options) {}
1719
- /**
1720
- * Attaches an event listener to an event target. The listener will be
1721
- * removed when the first instance of the event is fired.
1722
- * @param {EventTarget} target The event target.
1723
- * @param {string} type The event type.
1724
- * @param {shaka.util.EventManager.ListenerType} listener The event listener.
1725
- * @param {(boolean|!AddEventListenerOptions)=} options An object that
1726
- * specifies characteristics about the event listener.
1727
- * The passive option, if true, indicates that this function will never
1728
- * call preventDefault(), which improves scrolling performance.
1729
- */
1730
- listenOnce(target, type, listener, options) {}
1731
- /**
1732
- * Detaches an event listener from an event target.
1733
- * @param {EventTarget} target The event target.
1734
- * @param {string} type The event type.
1735
- * @param {shaka.util.EventManager.ListenerType=} listener The event listener.
1736
- */
1737
- unlisten(target, type, listener) {}
1738
- /**
1739
- * Detaches all event listeners from all targets.
1740
- */
1741
- removeAll() {}
1742
- };
1743
- /**
1744
- * @typedef {function(!Event)}
1745
- */
1746
- shaka.util.EventManager.ListenerType;
1747
1747
  /**
1748
1748
  * @namespace shaka.util.StringUtils
1749
1749
  * @summary A set of string utility functions.
@@ -1944,6 +1944,14 @@ shaka.util.Mp4Parser = class {
1944
1944
  * @param {!shaka.extern.ParsedBox} box
1945
1945
  */
1946
1946
  static visualSampleEntry(box) {}
1947
+ /**
1948
+ * A callback that tells the Mp4 parser to treat the body of a box as a audio
1949
+ * sample entry. A audio sample entry has some fixed-sized fields
1950
+ * describing the audio codec parameters, followed by an arbitrary number of
1951
+ * appended children. Each child is a box.
1952
+ * @param {!shaka.extern.ParsedBox} box
1953
+ */
1954
+ static audioSampleEntry(box) {}
1947
1955
  /**
1948
1956
  * Create a callback that tells the Mp4 parser to treat the body of a box as a
1949
1957
  * binary blob and to parse the body's contents using the provided callback.
@@ -2542,6 +2550,15 @@ shaka.media.PresentationTimeline = class {
2542
2550
  * @return {boolean}
2543
2551
  */
2544
2552
  isStartTimeLocked() {}
2553
+ /**
2554
+ * Sets the initial program date time.
2555
+ * @param {number} initialProgramDateTime
2556
+ */
2557
+ setInitialProgramDateTime(initialProgramDateTime) {}
2558
+ /**
2559
+ * @return {?number} The initial program date time in seconds.
2560
+ */
2561
+ getInitialProgramDateTime() {}
2545
2562
  /**
2546
2563
  * Gives PresentationTimeline a Stream's minimum segment start time.
2547
2564
  * @param {number} startTime
@@ -4993,6 +5010,14 @@ shaka.polyfill.MediaCapabilities.originalMcap;
4993
5010
  */
4994
5011
  shaka.polyfill.MediaCapabilities.memoizedMediaKeySystemAccessRequests_ = {
4995
5012
 
5013
+ };
5014
+ /**
5015
+ * A cache that stores the canDisplayType result of calling
5016
+ * `cast.__platform__.canDisplayType`.
5017
+ * @type {(Object<(!string), (!boolean)>)}
5018
+ */
5019
+ shaka.polyfill.MediaCapabilities.memoizedCanDisplayTypeRequests_ = {
5020
+
4996
5021
  };
4997
5022
  /**
4998
5023
  * @summary A polyfill to patch MSE bugs.
@@ -5071,17 +5096,6 @@ shaka.polyfill.RandomUUID = class {
5071
5096
  */
5072
5097
  static install() {}
5073
5098
  };
5074
- /**
5075
- * @summary A polyfill to provide navigator.storage.estimate in old
5076
- * webkit browsers.
5077
- * See: https://developers.google.com/web/updates/2017/08/estimating-available-storage-space#the-present
5078
- */
5079
- shaka.polyfill.StorageEstimate = class {
5080
- /**
5081
- * Install the polyfill if needed.
5082
- */
5083
- static install() {}
5084
- };
5085
5099
  /**
5086
5100
  * @summary A polyfill to provide Symbol.prototype.description in all browsers.
5087
5101
  * See: https://caniuse.com/mdn-javascript_builtins_symbol_description