shaka-player 3.2.2 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
  2. package/.github/ISSUE_TEMPLATE/feature_request.md +1 -1
  3. package/.github/ISSUE_TEMPLATE/question.md +1 -1
  4. package/AUTHORS +6 -5
  5. package/CHANGELOG.md +247 -0
  6. package/CONTRIBUTORS +4 -2
  7. package/build/types/core +3 -0
  8. package/build/types/offline +1 -0
  9. package/build/types/polyfill +1 -0
  10. package/build/types/ui +2 -0
  11. package/demo/common/assets.js +18 -0
  12. package/demo/common/message_ids.js +13 -1
  13. package/demo/config.js +31 -1
  14. package/demo/index.html +1 -1
  15. package/demo/locales/en.json +12 -0
  16. package/demo/locales/source.json +48 -0
  17. package/dist/controls.css +26 -2
  18. package/dist/controls.css.map +1 -1
  19. package/dist/demo.compiled.debug.js +19 -16
  20. package/dist/demo.compiled.debug.map +3 -3
  21. package/dist/demo.compiled.js +19 -16
  22. package/dist/demo.compiled.map +3 -3
  23. package/dist/deps.js +18 -11
  24. package/dist/locales.js +28 -26
  25. package/dist/receiver.compiled.debug.js +11 -9
  26. package/dist/receiver.compiled.debug.map +3 -3
  27. package/dist/receiver.compiled.js +11 -9
  28. package/dist/receiver.compiled.map +3 -3
  29. package/dist/shaka-player.compiled.d.ts +205 -15
  30. package/dist/shaka-player.compiled.debug.d.ts +205 -15
  31. package/dist/shaka-player.compiled.debug.externs.js +256 -6
  32. package/dist/shaka-player.compiled.debug.js +406 -354
  33. package/dist/shaka-player.compiled.debug.map +4 -4
  34. package/dist/shaka-player.compiled.externs.js +256 -6
  35. package/dist/shaka-player.compiled.js +826 -800
  36. package/dist/shaka-player.compiled.map +4 -4
  37. package/dist/shaka-player.ui.d.ts +221 -16
  38. package/dist/shaka-player.ui.debug.d.ts +221 -16
  39. package/dist/shaka-player.ui.debug.externs.js +283 -6
  40. package/dist/shaka-player.ui.debug.js +547 -476
  41. package/dist/shaka-player.ui.debug.map +4 -4
  42. package/dist/shaka-player.ui.externs.js +283 -6
  43. package/dist/shaka-player.ui.js +1019 -980
  44. package/dist/shaka-player.ui.map +4 -4
  45. package/docs/design/bg-fetch-after.gv +29 -0
  46. package/docs/design/bg-fetch-after.gv.png +0 -0
  47. package/docs/design/bg-fetch-before.gv +18 -0
  48. package/docs/design/bg-fetch-before.gv.png +0 -0
  49. package/docs/design/bg-fetch.md +134 -0
  50. package/docs/tutorials/blob-url.md +15 -0
  51. package/docs/tutorials/index.json +1 -0
  52. package/docs/tutorials/ui-customization.md +66 -0
  53. package/docs/tutorials/ui.md +5 -5
  54. package/externs/ima.js +3 -0
  55. package/externs/shaka/ads.js +5 -0
  56. package/externs/shaka/manifest.js +12 -1
  57. package/externs/shaka/manifest_parser.js +10 -1
  58. package/externs/shaka/net.js +20 -4
  59. package/externs/shaka/offline.js +31 -2
  60. package/externs/shaka/player.js +130 -5
  61. package/externs/shaka/text.js +14 -0
  62. package/externs/webcrypto.js +18 -0
  63. package/lib/abr/ewma.js +14 -0
  64. package/lib/abr/ewma_bandwidth_estimator.js +16 -2
  65. package/lib/abr/simple_abr_manager.js +6 -0
  66. package/lib/ads/client_side_ad.js +8 -0
  67. package/lib/ads/client_side_ad_manager.js +8 -4
  68. package/lib/ads/server_side_ad.js +7 -0
  69. package/lib/cast/cast_utils.js +1 -0
  70. package/lib/dash/dash_parser.js +48 -14
  71. package/lib/dash/segment_base.js +25 -1
  72. package/lib/dash/segment_list.js +18 -9
  73. package/lib/dash/segment_template.js +23 -10
  74. package/lib/hls/hls_parser.js +86 -23
  75. package/lib/media/quality_observer.js +291 -0
  76. package/lib/media/segment_index.js +6 -0
  77. package/lib/media/segment_reference.js +18 -3
  78. package/lib/media/streaming_engine.js +42 -4
  79. package/lib/net/http_fetch_plugin.js +31 -11
  80. package/lib/net/http_plugin_utils.js +1 -0
  81. package/lib/net/http_xhr_plugin.js +40 -14
  82. package/lib/net/networking_engine.js +81 -18
  83. package/lib/offline/download_info.js +68 -0
  84. package/lib/offline/download_manager.js +13 -5
  85. package/lib/offline/indexeddb/base_storage_cell.js +35 -0
  86. package/lib/offline/indexeddb/storage_mechanism.js +1 -1
  87. package/lib/offline/indexeddb/v5_storage_cell.js +5 -0
  88. package/lib/offline/storage.js +393 -284
  89. package/lib/offline/stored_content_utils.js +2 -0
  90. package/lib/player.js +206 -7
  91. package/lib/polyfill/random_uuid.js +52 -0
  92. package/lib/text/cue.js +12 -0
  93. package/lib/text/ttml_text_parser.js +25 -2
  94. package/lib/text/ui_text_displayer.js +2 -2
  95. package/lib/util/cmcd_manager.js +826 -0
  96. package/lib/util/error.js +6 -0
  97. package/lib/util/language_utils.js +12 -0
  98. package/lib/util/mutex.js +52 -0
  99. package/lib/util/periods.js +98 -64
  100. package/lib/util/player_configuration.js +18 -0
  101. package/package.json +1 -1
  102. package/shaka-player.uncompiled.js +3 -0
  103. package/test/dash/dash_parser_content_protection_unit.js +2 -0
  104. package/test/dash/dash_parser_live_unit.js +101 -1
  105. package/test/dash/dash_parser_manifest_unit.js +35 -1
  106. package/test/dash/dash_parser_segment_base_unit.js +2 -0
  107. package/test/dash/dash_parser_segment_list_unit.js +2 -1
  108. package/test/dash/dash_parser_segment_template_unit.js +2 -1
  109. package/test/hls/hls_live_unit.js +2 -0
  110. package/test/hls/hls_parser_unit.js +2 -0
  111. package/test/media/quality_observer_unit.js +139 -0
  112. package/test/media/segment_reference_unit.js +16 -1
  113. package/test/media/streaming_engine_integration.js +2 -1
  114. package/test/media/streaming_engine_unit.js +2 -0
  115. package/test/net/http_plugin_unit.js +20 -15
  116. package/test/offline/storage_integration.js +108 -4
  117. package/test/player_integration.js +99 -0
  118. package/test/test/util/dash_parser_util.js +4 -0
  119. package/test/test/util/fake_ad.js +7 -0
  120. package/test/test/util/fake_drm_engine.js +9 -2
  121. package/test/test/util/manifest_generator.js +3 -2
  122. package/test/test/util/test_scheme.js +14 -1
  123. package/test/text/ttml_text_parser_unit.js +47 -0
  124. package/test/ui/ui_unit.js +250 -0
  125. package/test/util/cmcd_manager_unit.js +277 -0
  126. package/ui/airplay_button.js +1 -0
  127. package/ui/audio_language_selection.js +7 -0
  128. package/ui/cast_button.js +1 -0
  129. package/ui/context_menu.js +109 -0
  130. package/ui/controls.js +41 -7
  131. package/ui/controls.less +1 -0
  132. package/ui/enums.js +4 -0
  133. package/ui/externs/ui.js +28 -1
  134. package/ui/fast_forward_button.js +14 -5
  135. package/ui/fullscreen_button.js +1 -0
  136. package/ui/less/buttons.less +0 -4
  137. package/ui/less/containers.less +74 -0
  138. package/ui/less/overflow_menu.less +0 -10
  139. package/ui/less/tooltip.less +97 -0
  140. package/ui/locales/en.json +1 -0
  141. package/ui/locales/source.json +4 -0
  142. package/ui/loop_button.js +5 -0
  143. package/ui/mute_button.js +2 -1
  144. package/ui/overflow_menu.js +5 -25
  145. package/ui/pip_button.js +5 -0
  146. package/ui/play_button.js +2 -2
  147. package/ui/playback_rate_selection.js +8 -9
  148. package/ui/resolution_selection.js +7 -0
  149. package/ui/rewind_button.js +15 -6
  150. package/ui/seek_bar.js +4 -2
  151. package/ui/settings_menu.js +36 -4
  152. package/ui/small_play_button.js +1 -0
  153. package/ui/statistics_button.js +253 -0
  154. package/ui/text_selection.js +11 -4
  155. package/ui/ui.js +30 -0
  156. package/ui/volume_bar.js +1 -1
@@ -395,6 +395,13 @@ declare namespace shaka {
395
395
  * <code>detach</code>, or <code>unload</code>.
396
396
  */
397
397
  unload (initializeMediaSource ? : boolean ) : Promise < any > ;
398
+ /**
399
+ * Provides a way to update the stream start position during the media loading
400
+ * process. Can for example be called from the <code>manifestparsed</code>
401
+ * event handler to update the start position based on information in the
402
+ * manifest.
403
+ */
404
+ updateStartTime (startTime : number ) : any ;
398
405
  /**
399
406
  * Return whether the browser provides basic support. If this returns false,
400
407
  * Shaka Player cannot be used at all. In this case, do not construct a
@@ -628,6 +635,7 @@ declare namespace shaka.ads {
628
635
  getSequenceLength ( ) : any ;
629
636
  getTimeUntilSkippable ( ) : any ;
630
637
  getVolume ( ) : any ;
638
+ isLinear ( ) : any ;
631
639
  isMuted ( ) : any ;
632
640
  isPaused ( ) : any ;
633
641
  isSkippable ( ) : any ;
@@ -653,6 +661,7 @@ declare namespace shaka.ads {
653
661
  getSequenceLength ( ) : any ;
654
662
  getTimeUntilSkippable ( ) : any ;
655
663
  getVolume ( ) : any ;
664
+ isLinear ( ) : any ;
656
665
  isMuted ( ) : any ;
657
666
  isPaused ( ) : any ;
658
667
  isSkippable ( ) : any ;
@@ -816,7 +825,7 @@ declare namespace shaka.media {
816
825
  */
817
826
  class InitSegmentReference {
818
827
  private noStructuralTyping_shaka_media_InitSegmentReference : any;
819
- constructor (uris : ( ) => string [] , startByte : number , endByte : number | null ) ;
828
+ constructor (uris : ( ) => string [] , startByte : number , endByte : number | null , mediaQuality ? : null | shaka.extern.MediaQualityInfo ) ;
820
829
  /**
821
830
  * Returns the offset from the start of the resource to the end of the
822
831
  * segment, inclusive. A value of null indicates that the segment extends
@@ -1166,14 +1175,14 @@ declare namespace shaka.net {
1166
1175
  * logic as Shaka when determining support.
1167
1176
  */
1168
1177
  static isSupported ( ) : boolean ;
1169
- static parse (uri : string , request : shaka.extern.Request , requestType : shaka.net.NetworkingEngine.RequestType , progressUpdated : shaka.extern.ProgressUpdated ) : shaka.extern.IAbortableOperation < any > ;
1178
+ static parse (uri : string , request : shaka.extern.Request , requestType : shaka.net.NetworkingEngine.RequestType , progressUpdated : shaka.extern.ProgressUpdated , headersReceived : shaka.extern.HeadersReceived ) : shaka.extern.IAbortableOperation < any > ;
1170
1179
  }
1171
1180
  }
1172
1181
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
1173
1182
  declare namespace shaka.net {
1174
1183
  class HttpXHRPlugin {
1175
1184
  private noStructuralTyping_shaka_net_HttpXHRPlugin : any;
1176
- static parse (uri : string , request : shaka.extern.Request , requestType : shaka.net.NetworkingEngine.RequestType , progressUpdated : shaka.extern.ProgressUpdated ) : shaka.extern.IAbortableOperation < any > ;
1185
+ static parse (uri : string , request : shaka.extern.Request , requestType : shaka.net.NetworkingEngine.RequestType , progressUpdated : shaka.extern.ProgressUpdated , headersReceived : shaka.extern.HeadersReceived ) : shaka.extern.IAbortableOperation < any > ;
1177
1186
  }
1178
1187
  }
1179
1188
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
@@ -1190,7 +1199,7 @@ declare namespace shaka.net {
1190
1199
  * handle the actual request. A plugin is registered using registerScheme.
1191
1200
  * Each scheme has at most one plugin to handle the request.
1192
1201
  */
1193
- constructor (onProgressUpdated ? : (a : number , b : number ) => any ) ;
1202
+ constructor (onProgressUpdated ? : (a : number , b : number ) => any , onHeadersReceived ? : shaka.net.NetworkingEngine.OnHeadersReceived , onDownloadFailed ? : shaka.net.NetworkingEngine.OnDownloadFailed ) ;
1194
1203
  /**
1195
1204
  * Clears all request filters.
1196
1205
  */
@@ -1259,6 +1268,14 @@ declare namespace shaka.net.NetworkingEngine {
1259
1268
  }
1260
1269
  }
1261
1270
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
1271
+ declare namespace shaka.net.NetworkingEngine {
1272
+ type OnDownloadFailed = (a : shaka.extern.Request , b : shaka.util.Error | null , c : number , d : boolean ) => any ;
1273
+ }
1274
+ // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
1275
+ declare namespace shaka.net.NetworkingEngine {
1276
+ type OnHeadersReceived = (a : { [ key: string ]: string } , b : shaka.extern.Request , c : shaka.net.NetworkingEngine.RequestType ) => any ;
1277
+ }
1278
+ // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
1262
1279
  declare namespace shaka.net.NetworkingEngine {
1263
1280
  /**
1264
1281
  * A pending network request. This can track the current progress of the
@@ -1559,6 +1576,16 @@ declare namespace shaka.polyfill {
1559
1576
  }
1560
1577
  }
1561
1578
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
1579
+ declare namespace shaka.polyfill {
1580
+ class RandomUUID {
1581
+ private noStructuralTyping_shaka_polyfill_RandomUUID : any;
1582
+ /**
1583
+ * Install the polyfill if needed.
1584
+ */
1585
+ static install ( ) : any ;
1586
+ }
1587
+ }
1588
+ // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
1562
1589
  declare namespace shaka.polyfill {
1563
1590
  class StorageEstimate {
1564
1591
  private noStructuralTyping_shaka_polyfill_StorageEstimate : any;
@@ -1640,6 +1667,8 @@ declare namespace shaka.text {
1640
1667
  startTime : any ;
1641
1668
  textAlign : any ;
1642
1669
  textDecoration : any ;
1670
+ textStrokeColor : any ;
1671
+ textStrokeWidth : any ;
1643
1672
  wrapLine : any ;
1644
1673
  writingMode : any ;
1645
1674
  }
@@ -1989,6 +2018,14 @@ declare namespace shaka.ui {
1989
2018
  }
1990
2019
  }
1991
2020
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
2021
+ declare namespace shaka.ui {
2022
+ class ContextMenu extends shaka.ui.Element {
2023
+ private noStructuralTyping_shaka_ui_ContextMenu : any;
2024
+ constructor (parent : HTMLElement , controls : shaka.ui.Controls ) ;
2025
+ static registerElement (name : string , factory : shaka.extern.IUIElement.Factory ) : any ;
2026
+ }
2027
+ }
2028
+ // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
1992
2029
  declare namespace shaka.ui {
1993
2030
  /**
1994
2031
  * A container for custom video controls.
@@ -2392,6 +2429,13 @@ declare namespace shaka.ui {
2392
2429
  }
2393
2430
  }
2394
2431
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
2432
+ declare namespace shaka.ui {
2433
+ class StatisticsButton extends shaka.ui.Element {
2434
+ private noStructuralTyping_shaka_ui_StatisticsButton : any;
2435
+ constructor (parent : HTMLElement , controls : shaka.ui.Controls ) ;
2436
+ }
2437
+ }
2438
+ // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
2395
2439
  declare namespace shaka.ui {
2396
2440
  class TextSelection extends shaka.ui.SettingsMenu {
2397
2441
  private noStructuralTyping_shaka_ui_TextSelection : any;
@@ -2462,6 +2506,23 @@ declare namespace shaka.util {
2462
2506
  }
2463
2507
  }
2464
2508
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
2509
+ declare namespace shaka.util.CmcdManager {
2510
+ type ManifestInfo = { format : shaka.util.CmcdManager.StreamingFormat } ;
2511
+ }
2512
+ // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
2513
+ declare namespace shaka.util.CmcdManager {
2514
+ type SegmentInfo = { bandwidth ? : number , codecs : string , duration : number , init : boolean , mimeType : string , type : string } ;
2515
+ }
2516
+ // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
2517
+ declare namespace shaka.util.CmcdManager {
2518
+ enum StreamingFormat {
2519
+ DASH = 'd' ,
2520
+ HLS = 'h' ,
2521
+ OTHER = 'o' ,
2522
+ SMOOTH = 's' ,
2523
+ }
2524
+ }
2525
+ // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
2465
2526
  declare namespace shaka.util {
2466
2527
  class ConfigUtils {
2467
2528
  private noStructuralTyping_shaka_util_ConfigUtils : any;
@@ -2666,6 +2727,7 @@ declare namespace shaka.util.Error {
2666
2727
  MEDIA_SOURCE_OPERATION_THREW = 3015.0 ,
2667
2728
  MISSING_STORAGE_CELL = 9013.0 ,
2668
2729
  MISSING_TEXT_PLUGIN = 2014.0 ,
2730
+ MODIFY_OPERATION_NOT_SUPPORTED = 9016.0 ,
2669
2731
  MP4_SIDX_INVALID_TIMESCALE = 3005.0 ,
2670
2732
  MP4_SIDX_TYPE_NOT_SUPPORTED = 3006.0 ,
2671
2733
  MP4_SIDX_WRONG_BOX_TYPE = 3004.0 ,
@@ -2860,6 +2922,120 @@ declare namespace shaka.util {
2860
2922
  }
2861
2923
  }
2862
2924
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
2925
+ declare namespace shaka.util {
2926
+ class LanguageUtils {
2927
+ private noStructuralTyping_shaka_util_LanguageUtils : any;
2928
+ /**
2929
+ * Check if |locale1| and |locale2| are language-compatible.
2930
+ * Language compatible is when the language component of each locale matches.
2931
+ * This means that no matter what region they have (or don't have) as long as
2932
+ * the language components match, they are language-compatible.
2933
+ * Examples:
2934
+ * Locale A | Locale B | Language-Compatible
2935
+ * -----------------------------------------
2936
+ * en-US | en-US | true
2937
+ * en-US | en | true
2938
+ * en-US | en-CA | true
2939
+ * en-CA | fr-CA | false
2940
+ */
2941
+ static areLanguageCompatible (locale1 : string , locale2 : string ) : boolean ;
2942
+ /**
2943
+ * Check if |locale1| and |locale2| are locale-compatible.
2944
+ * Locale-compatible is defined as all components in each locale match. Since
2945
+ * we only respect the language and region components, we only check that
2946
+ * the language and region components match.
2947
+ * Examples:
2948
+ * Locale A | Locale B | Locale Compatible
2949
+ * ---------------------------------------
2950
+ * en-US | en-US | true
2951
+ * en | en-US | false
2952
+ * en-US | en-CA | false
2953
+ */
2954
+ static areLocaleCompatible (locale1 : string , locale2 : string ) : boolean ;
2955
+ /**
2956
+ * Check if two language codes are siblings. Language codes are siblings if
2957
+ * they share the same base language while neither one is the base language.
2958
+ * For example, "en-US" and "en-CA" are siblings but "en-US" and "en" are not
2959
+ * siblings.
2960
+ */
2961
+ static areSiblings (a : string , b : string ) : boolean ;
2962
+ /**
2963
+ * Find the locale in |searchSpace| that comes closest to |target|. If no
2964
+ * locale is found to be close to |target|, then |null| will be returned.
2965
+ */
2966
+ static findClosestLocale (target : string , searchSpace : Iterable < string > ) : string | null ;
2967
+ /**
2968
+ * Get the normalized base language for a language code.
2969
+ */
2970
+ static getBase (lang : string ) : string ;
2971
+ /**
2972
+ * Get the normalized language of the given text stream. Will return 'und' if
2973
+ * a language is not found on the text stream.
2974
+ * This should always be used to get the language from a text stream.
2975
+ */
2976
+ static getLocaleForText (stream : shaka.extern.Stream ) : string ;
2977
+ /**
2978
+ * Get the normalized locale for the given variant. This will look through
2979
+ * the variant to find the locale that represents the content in the variant.
2980
+ * This will return 'und' if no language can be found.
2981
+ * This should always be used to get the locale from a variant.
2982
+ */
2983
+ static getLocaleForVariant (variant : shaka.extern.Variant ) : string ;
2984
+ /**
2985
+ * Check if |possibleParent| is the parent locale of |possibleChild|. Because
2986
+ * we do not support dialects, the parent-child relationship is a lot simpler.
2987
+ * In a parent child relationship:
2988
+ * - The parent and child have the same language-component
2989
+ * - The parent has no region-component
2990
+ * - The child has a region-component
2991
+ * Example:
2992
+ * Locale A | Locale B | Is A The parent of B?
2993
+ * --------------------------------------------
2994
+ * en-US | en-US | no
2995
+ * en-US | en | no
2996
+ * en | en-US | yes
2997
+ * en | en | no
2998
+ * en | fr | no
2999
+ */
3000
+ static isParentOf (possibleParent : string , possibleChild : string ) : boolean ;
3001
+ /**
3002
+ * Check if |localeA| shares the same parent with |localeB|. Since we don't
3003
+ * support dialect, we will only look at language and region. For two locales
3004
+ * to be siblings:
3005
+ * - Both must have language-components
3006
+ * - Both must have region-components
3007
+ * - Both must have the same language-component
3008
+ * Example:
3009
+ * Locale A | Locale B | Siblings?
3010
+ * --------------------------------------------
3011
+ * en-US | en-US | yes
3012
+ * en-US | en-CA | yes
3013
+ * en-US | en | no
3014
+ * en | en-US | no
3015
+ * en | en | no
3016
+ * en | fr | no
3017
+ */
3018
+ static isSiblingOf (localeA : string , localeB : string ) : boolean ;
3019
+ /**
3020
+ * Normalize a locale. This will take a locale and canonicalize it to a state
3021
+ * that we are prepared to work with.
3022
+ * We only support with:
3023
+ * - language
3024
+ * - language-REGION
3025
+ * If given a dialect, we will discard it. We will convert any 3-character
3026
+ * codes to 2-character codes. We will force language codes to lowercase and
3027
+ * region codes to uppercase.
3028
+ */
3029
+ static normalize (locale : string ) : string ;
3030
+ /**
3031
+ * Compute a numerical relatedness for language codes. Language codes with a
3032
+ * higher relatedness are a better match. Unrelated language codes have a
3033
+ * relatedness score of 0.
3034
+ */
3035
+ static relatedness (target : string , candidate : string ) : number ;
3036
+ }
3037
+ }
3038
+ // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/dist/shaka-player.ui.externs.js
2863
3039
  declare namespace shaka.util {
2864
3040
  class Mp4Parser {
2865
3041
  private noStructuralTyping_shaka_util_Mp4Parser : any;
@@ -3624,6 +3800,7 @@ declare namespace shaka.extern {
3624
3800
  getSequenceLength ( ) : number ;
3625
3801
  getTimeUntilSkippable ( ) : number ;
3626
3802
  getVolume ( ) : number ;
3803
+ isLinear ( ) : boolean ;
3627
3804
  isMuted ( ) : boolean ;
3628
3805
  isPaused ( ) : boolean ;
3629
3806
  isSkippable ( ) : boolean ;
@@ -3704,7 +3881,7 @@ declare namespace shaka.extern {
3704
3881
  }
3705
3882
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/manifest.js
3706
3883
  declare namespace shaka.extern {
3707
- type Stream = { audioSamplingRate : number | null , bandwidth ? : number , channelsCount : number | null , closedCaptions : Map < string , string > | null , codecs : string , createSegmentIndex : shaka.extern.CreateSegmentIndexFunction , drmInfos : shaka.extern.DrmInfo [] , emsgSchemeIdUris : string [] | null , encrypted : boolean , forced : boolean , frameRate ? : number , hdr ? : string , height ? : number , id : number , keyIds : Set < string > , kind ? : string , label : string | null , language : string , mimeType : string , originalId : string | null , pixelAspectRatio ? : string , primary : boolean , roles : string [] , segmentIndex : shaka.media.SegmentIndex | null , spatialAudio : boolean , tilesLayout ? : string , trickModeVideo : any , type : string , width ? : number } ;
3884
+ type Stream = { audioSamplingRate : number | null , bandwidth ? : number , channelsCount : number | null , closeSegmentIndex ? : ( ) => any , closedCaptions : Map < string , string > | null , codecs : string , createSegmentIndex : shaka.extern.CreateSegmentIndexFunction , drmInfos : shaka.extern.DrmInfo [] , emsgSchemeIdUris : string [] | null , encrypted : boolean , forced : boolean , frameRate ? : number , hdr ? : string , height ? : number , id : number , keyIds : Set < string > , kind ? : string , label : string | null , language : string , matchedStreams ? : any [] , mimeType : string , originalId : string | null , pixelAspectRatio ? : string , primary : boolean , roles : string [] , segmentIndex : shaka.media.SegmentIndex | null , spatialAudio : boolean , tilesLayout ? : string , trickModeVideo : any , type : string , width ? : number } ;
3708
3885
  }
3709
3886
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/manifest.js
3710
3887
  declare namespace shaka.extern {
@@ -3783,13 +3960,17 @@ declare namespace shaka.extern.ManifestParser {
3783
3960
  }
3784
3961
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/manifest_parser.js
3785
3962
  declare namespace shaka.extern.ManifestParser {
3786
- type PlayerInterface = { enableLowLatencyMode : ( ) => any , filter : (a : shaka.extern.Manifest ) => Promise < any > , isAutoLowLatencyMode : ( ) => boolean , isLowLatencyMode : ( ) => boolean , makeTextStreamsForClosedCaptions : (a : shaka.extern.Manifest ) => any , networkingEngine : shaka.net.NetworkingEngine , onError : (a : shaka.util.Error ) => any , onEvent : shaka.util.EventManager.ListenerType , onTimelineRegionAdded : (a : shaka.extern.TimelineRegionInfo ) => any } ;
3963
+ type PlayerInterface = { enableLowLatencyMode : ( ) => any , filter : (a : shaka.extern.Manifest ) => Promise < any > , isAutoLowLatencyMode : ( ) => boolean , isLowLatencyMode : ( ) => boolean , makeTextStreamsForClosedCaptions : (a : shaka.extern.Manifest ) => any , modifyManifestRequest : (a : shaka.extern.Request , b : shaka.util.CmcdManager.ManifestInfo ) => any , modifySegmentRequest : (a : shaka.extern.Request , b : shaka.util.CmcdManager.SegmentInfo ) => any , networkingEngine : shaka.net.NetworkingEngine , onError : (a : shaka.util.Error ) => any , onEvent : shaka.util.EventManager.ListenerType , onTimelineRegionAdded : (a : shaka.extern.TimelineRegionInfo ) => any } ;
3787
3964
  }
3788
3965
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/mp4_parser.js
3789
3966
  declare namespace shaka.extern {
3790
3967
  type ParsedBox = { flags : number | null , has64BitSize : boolean , parser : shaka.util.Mp4Parser , partialOkay : boolean , reader : shaka.util.DataViewReader , size : number , start : number , version : number | null } ;
3791
3968
  }
3792
3969
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/net.js
3970
+ declare namespace shaka.extern {
3971
+ type HeadersReceived = (a : { [ key: string ]: string } ) => any ;
3972
+ }
3973
+ // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/net.js
3793
3974
  declare namespace shaka.extern {
3794
3975
  type ProgressUpdated = (a : number , b : number , c : number ) => any ;
3795
3976
  }
@@ -3809,7 +3990,7 @@ declare namespace shaka.extern {
3809
3990
  }
3810
3991
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/net.js
3811
3992
  declare namespace shaka.extern {
3812
- type Response = { data : ArrayBuffer | ArrayBufferView , fromCache ? : boolean , headers : { [ key: string ]: string } , timeMs ? : number , uri : string } ;
3993
+ type Response = { data : ArrayBuffer | ArrayBufferView , fromCache ? : boolean , headers : { [ key: string ]: string } , status ? : number , timeMs ? : number , uri : string } ;
3813
3994
  }
3814
3995
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/net.js
3815
3996
  declare namespace shaka.extern {
@@ -3826,7 +4007,7 @@ declare namespace shaka.extern {
3826
4007
  }
3827
4008
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/net.js
3828
4009
  declare namespace shaka.extern {
3829
- type SchemePlugin = (a : string , b : shaka.extern.Request , c : shaka.net.NetworkingEngine.RequestType , d : shaka.extern.ProgressUpdated ) => shaka.extern.IAbortableOperation < shaka.extern.Response > ;
4010
+ type SchemePlugin = (a : string , b : shaka.extern.Request , c : shaka.net.NetworkingEngine.RequestType , d : shaka.extern.ProgressUpdated , e : shaka.extern.HeadersReceived ) => shaka.extern.IAbortableOperation < shaka.extern.Response > ;
3830
4011
  }
3831
4012
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/offline.js
3832
4013
  declare namespace shaka.extern {
@@ -3860,7 +4041,7 @@ declare namespace shaka.extern {
3860
4041
  }
3861
4042
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/offline.js
3862
4043
  declare namespace shaka.extern {
3863
- type ManifestDB = { appMetadata : object | null , creationTime : number , drmInfo : shaka.extern.DrmInfo | null , duration : number , expiration : number , originalManifestUri : string , sessionIds : string [] , size : number , streams : shaka.extern.StreamDB [] } ;
4044
+ type ManifestDB = { appMetadata : object | null , creationTime : number , drmInfo : shaka.extern.DrmInfo | null , duration : number , expiration : number , isIncomplete ? : boolean , originalManifestUri : string , sessionIds : string [] , size : number , streams : shaka.extern.StreamDB [] } ;
3864
4045
  }
3865
4046
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/offline.js
3866
4047
  declare namespace shaka.extern {
@@ -3868,7 +4049,7 @@ declare namespace shaka.extern {
3868
4049
  }
3869
4050
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/offline.js
3870
4051
  declare namespace shaka.extern {
3871
- type SegmentDB = { appendWindowEnd : number , appendWindowStart : number , dataKey : number , endTime : number , initSegmentKey : number | null , startTime : number , tilesLayout : string | null , timestampOffset : number } ;
4052
+ type SegmentDB = { appendWindowEnd : number , appendWindowStart : number , dataKey : number , endTime : number , initSegmentKey : number | null , pendingInitSegmentRefId ? : string , pendingSegmentRefId ? : string , startTime : number , tilesLayout : string | null , timestampOffset : number } ;
3872
4053
  }
3873
4054
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/offline.js
3874
4055
  declare namespace shaka.extern {
@@ -3938,6 +4119,10 @@ declare namespace shaka.extern {
3938
4119
  * @param onRemove A callback for when a segment is removed from the cell. The key of the segment will be passed to the callback.
3939
4120
  */
3940
4121
  removeSegments (keys : number [] , onRemove : (a : number ) => any ) : Promise < any > ;
4122
+ /**
4123
+ * Updates the given manifest, stored at the given key.
4124
+ */
4125
+ updateManifest (key : number , manifest : shaka.extern.ManifestDB ) : Promise < any > ;
3941
4126
  /**
3942
4127
  * Replace the expiration time of the manifest stored under |key| with
3943
4128
  * |newExpiration|. If no manifest is found under |key| then this should
@@ -3992,7 +4177,7 @@ declare namespace shaka.extern {
3992
4177
  }
3993
4178
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/offline.js
3994
4179
  declare namespace shaka.extern {
3995
- type StoredContent = { appMetadata : object | null , duration : number , expiration : number , offlineUri : string | null , originalManifestUri : string , size : number , tracks : shaka.extern.TrackList } ;
4180
+ type StoredContent = { appMetadata : object | null , duration : number , expiration : number , isIncomplete : boolean , offlineUri : string | null , originalManifestUri : string , size : number , tracks : shaka.extern.TrackList } ;
3996
4181
  }
3997
4182
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/offline.js
3998
4183
  declare namespace shaka.extern {
@@ -4040,7 +4225,11 @@ declare namespace shaka.extern {
4040
4225
  }
4041
4226
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/player.js
4042
4227
  declare namespace shaka.extern {
4043
- type AbrConfiguration = { bandwidthDowngradeTarget : number , bandwidthUpgradeTarget : number , defaultBandwidthEstimate : number , enabled : boolean , restrictions : shaka.extern.Restrictions , switchInterval : number , useNetworkInformation : boolean } ;
4228
+ type AbrConfiguration = { advanced : shaka.extern.AdvancedAbrConfiguration , bandwidthDowngradeTarget : number , bandwidthUpgradeTarget : number , defaultBandwidthEstimate : number , enabled : boolean , restrictions : shaka.extern.Restrictions , switchInterval : number , useNetworkInformation : boolean } ;
4229
+ }
4230
+ // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/player.js
4231
+ declare namespace shaka.extern {
4232
+ type AdvancedAbrConfiguration = { fastHalfLife : number , minBytes : number , minTotalBytes : number , slowHalfLife : number } ;
4044
4233
  }
4045
4234
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/player.js
4046
4235
  declare namespace shaka.extern {
@@ -4059,6 +4248,10 @@ declare namespace shaka.extern {
4059
4248
  type Chapter = { endTime : number , startTime : number , title : string } ;
4060
4249
  }
4061
4250
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/player.js
4251
+ declare namespace shaka.extern {
4252
+ type CmcdConfiguration = { contentId : string , enabled : boolean , sessionId : string , useHeaders : boolean } ;
4253
+ }
4254
+ // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/player.js
4062
4255
  declare namespace shaka.extern {
4063
4256
  type DashManifestConfiguration = { autoCorrectDrift : boolean , clockSyncUri : string , disableXlinkProcessing : boolean , ignoreDrmInfo : boolean , ignoreEmptyAdaptationSet : boolean , ignoreMaxSegmentDuration : boolean , ignoreMinBufferTime : boolean , ignoreSuggestedPresentationDelay : boolean , initialSegmentLimit : number , keySystemsByURI : { [ key: string ]: string } , manifestPreprocessor : (a : Element ) => any , xlinkFailGracefully : boolean } ;
4064
4257
  }
@@ -4076,7 +4269,7 @@ declare namespace shaka.extern {
4076
4269
  }
4077
4270
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/player.js
4078
4271
  declare namespace shaka.extern {
4079
- type HlsManifestConfiguration = { ignoreImageStreamFailures : boolean , ignoreTextStreamFailures : boolean , useFullSegmentsForStartTime : boolean } ;
4272
+ type HlsManifestConfiguration = { defaultAudioCodec : string , defaultVideoCodec : string , ignoreImageStreamFailures : boolean , ignoreTextStreamFailures : boolean , useFullSegmentsForStartTime : boolean } ;
4080
4273
  }
4081
4274
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/player.js
4082
4275
  declare namespace shaka.extern {
@@ -4091,12 +4284,16 @@ declare namespace shaka.extern {
4091
4284
  type ManifestConfiguration = { availabilityWindowOverride : number , dash : shaka.extern.DashManifestConfiguration , defaultPresentationDelay : number , disableAudio : boolean , disableText : boolean , disableThumbnails : boolean , disableVideo : boolean , hls : shaka.extern.HlsManifestConfiguration , retryParameters : shaka.extern.RetryParameters } ;
4092
4285
  }
4093
4286
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/player.js
4287
+ declare namespace shaka.extern {
4288
+ type MediaQualityInfo = { audioSamplingRate : number | null , bandwidth : number , channelsCount : number | null , codecs : string , contentType : string , frameRate : number | null , height : number | null , mimeType : string | null , pixelAspectRatio : string | null , width : number | null } ;
4289
+ }
4290
+ // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/player.js
4094
4291
  declare namespace shaka.extern {
4095
4292
  type OfflineConfiguration = { downloadSizeCallback : (a : number ) => Promise < boolean > , progressCallback : (a : shaka.extern.StoredContent , b : number ) => any , trackSelectionCallback : (a : shaka.extern.TrackList ) => Promise < shaka.extern.TrackList > , usePersistentLicense : boolean } ;
4096
4293
  }
4097
4294
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/player.js
4098
4295
  declare namespace shaka.extern {
4099
- type PlayerConfiguration = { abr : shaka.extern.AbrConfiguration , abrFactory : shaka.extern.AbrManager.Factory , drm : shaka.extern.DrmConfiguration , manifest : shaka.extern.ManifestConfiguration , offline : shaka.extern.OfflineConfiguration , playRangeEnd : number , playRangeStart : number , preferForcedSubs : boolean , preferredAudioChannelCount : number , preferredAudioCodecs : string [] , preferredAudioLanguage : string , preferredDecodingAttributes : string [] , preferredTextLanguage : string , preferredTextRole : string , preferredVariantRole : string , preferredVideoCodecs : string [] , restrictions : shaka.extern.Restrictions , streaming : shaka.extern.StreamingConfiguration , textDisplayFactory : shaka.extern.TextDisplayer.Factory } ;
4296
+ type PlayerConfiguration = { abr : shaka.extern.AbrConfiguration , abrFactory : shaka.extern.AbrManager.Factory , cmcd : shaka.extern.CmcdConfiguration , drm : shaka.extern.DrmConfiguration , manifest : shaka.extern.ManifestConfiguration , offline : shaka.extern.OfflineConfiguration , playRangeEnd : number , playRangeStart : number , preferForcedSubs : boolean , preferredAudioChannelCount : number , preferredAudioCodecs : string [] , preferredAudioLanguage : string , preferredDecodingAttributes : string [] , preferredTextLanguage : string , preferredTextRole : string , preferredVariantRole : string , preferredVideoCodecs : string [] , restrictions : shaka.extern.Restrictions , streaming : shaka.extern.StreamingConfiguration , textDisplayFactory : shaka.extern.TextDisplayer.Factory } ;
4100
4297
  }
4101
4298
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/player.js
4102
4299
  declare namespace shaka.extern {
@@ -4112,7 +4309,7 @@ declare namespace shaka.extern {
4112
4309
  }
4113
4310
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/player.js
4114
4311
  declare namespace shaka.extern {
4115
- type StreamingConfiguration = { alwaysStreamText : boolean , autoLowLatencyMode : boolean , bufferBehind : number , bufferingGoal : number , durationBackoff : number , failureCallback : (a : shaka.util.Error ) => any , forceHTTPS : boolean , forceTransmuxTS : boolean , gapDetectionThreshold : number , ignoreTextStreamFailures : boolean , inaccurateManifestTolerance : number , jumpLargeGaps : boolean , lowLatencyMode : boolean , preferNativeHls : boolean , rebufferingGoal : number , retryParameters : shaka.extern.RetryParameters , safeSeekOffset : number , smallGapLimit : number , stallEnabled : boolean , stallSkip : number , stallThreshold : number , startAtSegmentBoundary : boolean , updateIntervalSeconds : number , useNativeHlsOnSafari : boolean } ;
4312
+ type StreamingConfiguration = { alwaysStreamText : boolean , autoLowLatencyMode : boolean , bufferBehind : number , bufferingGoal : number , dispatchAllEmsgBoxes : boolean , durationBackoff : number , failureCallback : (a : shaka.util.Error ) => any , forceHTTPS : boolean , forceTransmuxTS : boolean , gapDetectionThreshold : number , ignoreTextStreamFailures : boolean , inaccurateManifestTolerance : number , jumpLargeGaps : boolean , lowLatencyMode : boolean , observeQualityChanges : boolean , preferNativeHls : boolean , rebufferingGoal : number , retryParameters : shaka.extern.RetryParameters , safeSeekOffset : number , smallGapLimit : number , stallEnabled : boolean , stallSkip : number , stallThreshold : number , startAtSegmentBoundary : boolean , updateIntervalSeconds : number , useNativeHlsOnSafari : boolean } ;
4116
4313
  }
4117
4314
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/shaka/player.js
4118
4315
  declare namespace shaka.extern {
@@ -4285,6 +4482,14 @@ declare namespace shaka.extern {
4285
4482
  * and line through. Empty array means no decoration.
4286
4483
  */
4287
4484
  textDecoration : shaka.text.Cue.textDecoration [] ;
4485
+ /**
4486
+ * Text stroke color as a CSS color, e.g. "#FFFFFF" or "white".
4487
+ */
4488
+ textStrokeColor : string ;
4489
+ /**
4490
+ * Text stroke width as a CSS stroke-width value.
4491
+ */
4492
+ textStrokeWidth : string ;
4288
4493
  /**
4289
4494
  * Whether or not line wrapping should be applied to the cue.
4290
4495
  */
@@ -4567,7 +4772,7 @@ nameSpan : HTMLElement ;
4567
4772
  }
4568
4773
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/ui/externs/ui.js
4569
4774
  declare namespace shaka.extern {
4570
- type UIConfiguration = { addBigPlayButton : boolean , addSeekBar : boolean , castReceiverAppId : string , clearBufferOnQualityChange : boolean , controlPanelElements : string [] , doubleClickForFullscreen : boolean , enableFullscreenOnRotation : boolean , enableKeyboardPlaybackControls : boolean , fadeDelay : number , forceLandscapeOnFullscreen : boolean , overflowMenuButtons : string [] , seekBarColors : shaka.extern.UISeekBarColors , showUnbufferedStart : boolean , trackLabelFormat : shaka.ui.Overlay.TrackLabelFormat , volumeBarColors : shaka.extern.UIVolumeBarColors } ;
4775
+ type UIConfiguration = { addBigPlayButton : boolean , addSeekBar : boolean , castReceiverAppId : string , clearBufferOnQualityChange : boolean , contextMenuElements : string [] , controlPanelElements : string [] , customContextMenu : boolean , doubleClickForFullscreen : boolean , enableFullscreenOnRotation : boolean , enableKeyboardPlaybackControls : boolean , enableTooltips : boolean , fadeDelay : number , fastForwardRates : number [] , forceLandscapeOnFullscreen : boolean , overflowMenuButtons : string [] , playbackRates : number [] , rewindRates : number [] , seekBarColors : shaka.extern.UISeekBarColors , showUnbufferedStart : boolean , singleClickForPlayAndPause : boolean , statisticsList : string [] , trackLabelFormat : shaka.ui.Overlay.TrackLabelFormat , volumeBarColors : shaka.extern.UIVolumeBarColors } ;
4571
4776
  }
4572
4777
  // Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/ui/externs/ui.js
4573
4778
  declare namespace shaka.extern {