shaka-player 3.3.6 → 3.3.9

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 (143) hide show
  1. package/.github/workflows/build-and-test.yaml +67 -15
  2. package/.github/workflows/compute-incremental-coverage.py +251 -0
  3. package/.github/workflows/report-incremental-coverage.yaml +39 -0
  4. package/.github/workflows/selenium-lab-tests.yaml +44 -1
  5. package/AUTHORS +2 -0
  6. package/CHANGELOG.md +36 -0
  7. package/CONTRIBUTORS +4 -0
  8. package/README.md +20 -6
  9. package/demo/index.html +0 -2
  10. package/demo/main.js +3 -3
  11. package/dist/controls.css +1 -1
  12. package/dist/demo.compiled.debug.js +2 -2
  13. package/dist/demo.compiled.debug.map +2 -2
  14. package/dist/demo.compiled.js +2 -2
  15. package/dist/demo.compiled.map +2 -2
  16. package/dist/deps.js +2 -2
  17. package/dist/locales.js +32 -32
  18. package/dist/shaka-player.compiled.d.ts +12 -1
  19. package/dist/shaka-player.compiled.debug.d.ts +12 -1
  20. package/dist/shaka-player.compiled.debug.externs.js +49 -38
  21. package/dist/shaka-player.compiled.debug.js +112 -101
  22. package/dist/shaka-player.compiled.debug.map +4 -4
  23. package/dist/shaka-player.compiled.externs.js +49 -38
  24. package/dist/shaka-player.compiled.js +778 -773
  25. package/dist/shaka-player.compiled.map +4 -4
  26. package/dist/shaka-player.ui.d.ts +12 -1
  27. package/dist/shaka-player.ui.debug.d.ts +12 -1
  28. package/dist/shaka-player.ui.debug.externs.js +49 -38
  29. package/dist/shaka-player.ui.debug.js +127 -116
  30. package/dist/shaka-player.ui.debug.map +4 -4
  31. package/dist/shaka-player.ui.externs.js +49 -38
  32. package/dist/shaka-player.ui.js +903 -899
  33. package/dist/shaka-player.ui.map +4 -4
  34. package/docs/tutorials/welcome.md +6 -3
  35. package/karma.conf.js +3 -11
  36. package/lib/ads/client_side_ad_manager.js +1 -1
  37. package/lib/dash/dash_parser.js +5 -0
  38. package/lib/hls/hls_parser.js +6 -2
  39. package/lib/media/drm_engine.js +1 -1
  40. package/lib/media/presentation_timeline.js +24 -1
  41. package/lib/media/streaming_engine.js +1 -0
  42. package/lib/player.js +1 -6
  43. package/lib/polyfill/media_capabilities.js +3 -0
  44. package/lib/polyfill/videoplaybackquality.js +3 -1
  45. package/lib/text/cue.js +0 -5
  46. package/lib/text/simple_text_displayer.js +21 -9
  47. package/lib/text/ui_text_displayer.js +83 -19
  48. package/lib/util/buffer_utils.js +3 -0
  49. package/lib/util/object_utils.js +1 -0
  50. package/lib/util/platform.js +41 -1
  51. package/lib/util/stream_utils.js +24 -3
  52. package/lib/util/string_utils.js +102 -13
  53. package/maintained-branches.md +15 -0
  54. package/package.json +6 -5
  55. package/test/text/simple_text_displayer_unit.js +27 -0
  56. package/test/text/ui_text_displayer_unit.js +65 -0
  57. package/test/util/string_utils_unit.js +46 -8
  58. package/ui/text_selection.js +2 -2
  59. package/app-engine/README.md +0 -9
  60. package/app-engine/demo-version-index/README.md +0 -14
  61. package/app-engine/demo-version-index/app.yaml +0 -2
  62. package/app-engine/demo-version-index/main.py +0 -162
  63. package/app-engine/demo-version-index/requirements.txt +0 -6
  64. package/app-engine/demo-version-index/templates/index.html +0 -114
  65. package/app-engine/shaka-player-demo/README.md +0 -18
  66. package/app-engine/shaka-player-demo/app.yaml +0 -61
  67. package/app-engine/shaka-player-demo/main.py +0 -95
  68. package/app-engine/shaka-player-demo/posters/10yo.png +0 -0
  69. package/app-engine/shaka-player-demo/posters/10yo.xcf +0 -0
  70. package/app-engine/shaka-player-demo/posters/1yo.jpg +0 -0
  71. package/app-engine/shaka-player-demo/posters/2yo.png +0 -0
  72. package/app-engine/shaka-player-demo/posters/2yo.xcf +0 -0
  73. package/app-engine/shaka-player-demo/posters/3yo.png +0 -0
  74. package/app-engine/shaka-player-demo/posters/3yo.xcf +0 -0
  75. package/app-engine/shaka-player-demo/posters/4yo.png +0 -0
  76. package/app-engine/shaka-player-demo/posters/4yo.xcf +0 -0
  77. package/app-engine/shaka-player-demo/posters/5yo.png +0 -0
  78. package/app-engine/shaka-player-demo/posters/5yo.xcf +0 -0
  79. package/app-engine/shaka-player-demo/posters/6yo.png +0 -0
  80. package/app-engine/shaka-player-demo/posters/6yo.xcf +0 -0
  81. package/app-engine/shaka-player-demo/posters/7yo.png +0 -0
  82. package/app-engine/shaka-player-demo/posters/7yo.xcf +0 -0
  83. package/app-engine/shaka-player-demo/posters/8yo.png +0 -0
  84. package/app-engine/shaka-player-demo/posters/8yo.xcf +0 -0
  85. package/app-engine/shaka-player-demo/posters/9yo.png +0 -0
  86. package/app-engine/shaka-player-demo/posters/9yo.xcf +0 -0
  87. package/app-engine/shaka-player-demo/posters/audioOnly.gif +0 -0
  88. package/app-engine/shaka-player-demo/posters/audioRickRoll.gif +0 -0
  89. package/app-engine/shaka-player-demo/posters/colorbars.gif +0 -0
  90. package/app-engine/shaka-player-demo/posters/fireworks.jpg +0 -0
  91. package/app-engine/shaka-player-demo/posters/party-hat.png +0 -0
  92. package/app-engine/shaka-player-demo/posters/sources.txt +0 -46
  93. package/app-engine/shaka-player-demo/posters/standard.png +0 -0
  94. package/app-engine/shaka-player-demo/posters/trek.jpg +0 -0
  95. package/app-engine/shaka-player-demo/posters/valentines.png +0 -0
  96. package/app-engine/shaka-player-demo/posters/zombie.jpg +0 -0
  97. package/app-engine/shaka-player-demo/posters.py +0 -110
  98. package/app-engine/shaka-player-demo/requirements.txt +0 -5
  99. package/app-engine/shaka-player-demo/time.txt +0 -1
  100. package/build/README.md +0 -127
  101. package/build/__init__.py +0 -0
  102. package/build/all.py +0 -150
  103. package/build/apps.py +0 -186
  104. package/build/build.py +0 -392
  105. package/build/check.py +0 -354
  106. package/build/checkversion.py +0 -84
  107. package/build/compiler.py +0 -513
  108. package/build/conformance.textproto +0 -335
  109. package/build/docker/Dockerfile +0 -20
  110. package/build/docker/docker-compose.yml +0 -10
  111. package/build/docs.py +0 -54
  112. package/build/eslint-plugin-shaka-rules/arg-comment-spacing.js +0 -72
  113. package/build/eslint-plugin-shaka-rules/index.js +0 -24
  114. package/build/eslint-plugin-shaka-rules/package.json +0 -7
  115. package/build/eslint-plugin-shaka-rules/private.js +0 -109
  116. package/build/gendeps.py +0 -71
  117. package/build/generateExterns.js +0 -867
  118. package/build/generateLocalizations.py +0 -262
  119. package/build/generateTsDefs.py +0 -137
  120. package/build/install-linux-prereqs.sh +0 -136
  121. package/build/license-header +0 -5
  122. package/build/misspellings.txt +0 -38
  123. package/build/pixelsChanged.js +0 -35
  124. package/build/shaka-lab.yaml +0 -163
  125. package/build/shakaBuildHelpers.py +0 -356
  126. package/build/stats.py +0 -816
  127. package/build/subprocessWindowsPatch.py +0 -103
  128. package/build/test.py +0 -541
  129. package/build/types/ads +0 -8
  130. package/build/types/cast +0 -6
  131. package/build/types/cea +0 -13
  132. package/build/types/complete +0 -9
  133. package/build/types/core +0 -108
  134. package/build/types/dash +0 -8
  135. package/build/types/hls +0 -9
  136. package/build/types/manifests +0 -5
  137. package/build/types/networking +0 -6
  138. package/build/types/offline +0 -22
  139. package/build/types/polyfill +0 -21
  140. package/build/types/text +0 -11
  141. package/build/types/ui +0 -39
  142. package/build/updateScreenshots.py +0 -85
  143. package/build/wrapper.template.js +0 -52
package/dist/deps.js CHANGED
@@ -126,7 +126,7 @@ goog.addDependency('../../../../lib/polyfill/random_uuid.js', ['shaka.polyfill.R
126
126
  goog.addDependency('../../../../lib/polyfill/storage_estimate.js', ['shaka.polyfill.StorageEstimate'], ['shaka.polyfill'], {'lang': 'es8'});
127
127
  goog.addDependency('../../../../lib/polyfill/symbol.js', ['shaka.polyfill.Symbol'], ['shaka.log', 'shaka.polyfill'], {'lang': 'es6'});
128
128
  goog.addDependency('../../../../lib/polyfill/video_play_promise.js', ['shaka.polyfill.VideoPlayPromise'], ['shaka.log', 'shaka.polyfill'], {'lang': 'es6'});
129
- goog.addDependency('../../../../lib/polyfill/videoplaybackquality.js', ['shaka.polyfill.VideoPlaybackQuality'], ['shaka.polyfill'], {'lang': 'es6'});
129
+ goog.addDependency('../../../../lib/polyfill/videoplaybackquality.js', ['shaka.polyfill.VideoPlaybackQuality'], ['shaka.polyfill', 'shaka.util.Platform'], {'lang': 'es6'});
130
130
  goog.addDependency('../../../../lib/polyfill/vttcue.js', ['shaka.polyfill.VTTCue'], ['shaka.log', 'shaka.polyfill'], {'lang': 'es6'});
131
131
  goog.addDependency('../../../../lib/routing/node.js', ['shaka.routing.Node'], []);
132
132
  goog.addDependency('../../../../lib/routing/payload.js', ['shaka.routing.Payload'], []);
@@ -183,7 +183,7 @@ goog.addDependency('../../../../lib/util/public_promise.js', ['shaka.util.Public
183
183
  goog.addDependency('../../../../lib/util/state_history.js', ['shaka.util.StateHistory'], ['goog.asserts', 'shaka.log'], {'lang': 'es6'});
184
184
  goog.addDependency('../../../../lib/util/stats.js', ['shaka.util.Stats'], ['shaka.util.StateHistory', 'shaka.util.SwitchHistory'], {'lang': 'es6'});
185
185
  goog.addDependency('../../../../lib/util/stream_utils.js', ['shaka.util.StreamUtils'], ['goog.asserts', 'shaka.log', 'shaka.text.TextEngine', 'shaka.util.Functional', 'shaka.util.LanguageUtils', 'shaka.util.ManifestParserUtils', 'shaka.util.MimeUtils', 'shaka.util.MultiMap', 'shaka.util.Platform'], {'lang': 'es8'});
186
- goog.addDependency('../../../../lib/util/string_utils.js', ['shaka.util.StringUtils'], ['goog.asserts', 'shaka.log', 'shaka.util.BufferUtils', 'shaka.util.Error', 'shaka.util.Lazy'], {'lang': 'es6'});
186
+ goog.addDependency('../../../../lib/util/string_utils.js', ['shaka.util.StringUtils'], ['goog.asserts', 'shaka.log', 'shaka.util.BufferUtils', 'shaka.util.Error', 'shaka.util.Lazy', 'shaka.util.Platform'], {'lang': 'es6'});
187
187
  goog.addDependency('../../../../lib/util/switch_history.js', ['shaka.util.SwitchHistory'], [], {'lang': 'es6'});
188
188
  goog.addDependency('../../../../lib/util/text_parser.js', ['shaka.util.TextParser'], ['goog.asserts'], {'lang': 'es6'});
189
189
  goog.addDependency('../../../../lib/util/timer.js', ['shaka.util.Timer'], ['shaka.util.DelayedTick'], {'lang': 'es6'});
package/dist/locales.js CHANGED
@@ -720,44 +720,44 @@ shaka.ui.Locales.addTo = function(localization) {
720
720
  * @const
721
721
  */
722
722
  shaka.ui.Locales.Ids = {
723
- PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
724
- UNMUTE: 'UNMUTE',
725
- AD_PROGRESS: 'AD_PROGRESS',
726
- UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
727
- LIVE: 'LIVE',
728
- ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
729
- SKIP_AD: 'SKIP_AD',
730
- AUTO_QUALITY: 'AUTO_QUALITY',
731
- FAST_FORWARD: 'FAST_FORWARD',
732
723
  REPLAY: 'REPLAY',
733
- LANGUAGE: 'LANGUAGE',
734
- CAPTIONS: 'CAPTIONS',
735
- OFF: 'OFF',
736
- FULL_SCREEN: 'FULL_SCREEN',
737
- REWIND: 'REWIND',
738
- SUBTITLE_FORCED: 'SUBTITLE_FORCED',
739
- ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
740
- STATISTICS: 'STATISTICS',
741
- SEEK: 'SEEK',
724
+ LOOP: 'LOOP',
742
725
  VOLUME: 'VOLUME',
743
- MUTE: 'MUTE',
744
- PAUSE: 'PAUSE',
745
- PLAY: 'PLAY',
726
+ AIRPLAY: 'AIRPLAY',
727
+ REWIND: 'REWIND',
728
+ EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
729
+ ON: 'ON',
746
730
  SKIP_TO_LIVE: 'SKIP_TO_LIVE',
747
- BACK: 'BACK',
748
- AD_DURATION: 'AD_DURATION',
731
+ STATISTICS: 'STATISTICS',
732
+ SKIP_AD: 'SKIP_AD',
733
+ EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
734
+ OFF: 'OFF',
735
+ LANGUAGE: 'LANGUAGE',
736
+ ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE',
737
+ EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
738
+ UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
749
739
  AD_TIME: 'AD_TIME',
750
- CAST: 'CAST',
751
- LOOP: 'LOOP',
740
+ CAPTIONS: 'CAPTIONS',
752
741
  MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES',
753
- EXIT_LOOP_MODE: 'EXIT_LOOP_MODE',
742
+ SUBTITLE_FORCED: 'SUBTITLE_FORCED',
743
+ NOT_APPLICABLE: 'NOT_APPLICABLE',
754
744
  RESOLUTION: 'RESOLUTION',
755
- ON: 'ON',
756
- EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN',
745
+ BACK: 'BACK',
746
+ LIVE: 'LIVE',
747
+ ENTER_LOOP_MODE: 'ENTER_LOOP_MODE',
748
+ CAST: 'CAST',
757
749
  PLAYBACK_RATE: 'PLAYBACK_RATE',
758
- AIRPLAY: 'AIRPLAY',
759
- EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE',
760
- NOT_APPLICABLE: 'NOT_APPLICABLE',
761
750
  MORE_SETTINGS: 'MORE_SETTINGS',
762
- UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE',
751
+ AUTO_QUALITY: 'AUTO_QUALITY',
752
+ UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE',
753
+ PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE',
754
+ AD_DURATION: 'AD_DURATION',
755
+ SEEK: 'SEEK',
756
+ UNMUTE: 'UNMUTE',
757
+ FAST_FORWARD: 'FAST_FORWARD',
758
+ PLAY: 'PLAY',
759
+ AD_PROGRESS: 'AD_PROGRESS',
760
+ FULL_SCREEN: 'FULL_SCREEN',
761
+ PAUSE: 'PAUSE',
762
+ MUTE: 'MUTE',
763
763
  };
@@ -930,6 +930,17 @@ declare namespace shaka.media {
930
930
  getSegmentAvailabilityStart ( ) : number ;
931
931
  isInProgress ( ) : boolean ;
932
932
  isLive ( ) : boolean ;
933
+ /**
934
+ * Lock the presentation timeline's start time. After this is called, no
935
+ * further adjustments to presentationStartTime_ will be permitted.
936
+ * This should be called after all Periods have been parsed, and all calls to
937
+ * notifySegments() from the initial manifest parse have been made.
938
+ * Without this, we can get assertion failures in SegmentIndex for certain
939
+ * DAI content. If DAI adds ad segments to the manifest faster than
940
+ * real-time, adjustments to presentationStartTime_ can cause availability
941
+ * windows to jump around on updates.
942
+ */
943
+ lockStartTime ( ) : any ;
933
944
  /**
934
945
  * Gives PresentationTimeline a Stream's maximum segment duration so it can
935
946
  * size and position the segment availability window. This function should be
@@ -1680,7 +1691,7 @@ declare namespace shaka.text {
1680
1691
  linePadding : any ;
1681
1692
  nestedCues : any ;
1682
1693
  opacity : any ;
1683
- payload : string ;
1694
+ payload : any ;
1684
1695
  position : any ;
1685
1696
  positionAlign : any ;
1686
1697
  region : any ;
@@ -930,6 +930,17 @@ declare namespace shaka.media {
930
930
  getSegmentAvailabilityStart ( ) : number ;
931
931
  isInProgress ( ) : boolean ;
932
932
  isLive ( ) : boolean ;
933
+ /**
934
+ * Lock the presentation timeline's start time. After this is called, no
935
+ * further adjustments to presentationStartTime_ will be permitted.
936
+ * This should be called after all Periods have been parsed, and all calls to
937
+ * notifySegments() from the initial manifest parse have been made.
938
+ * Without this, we can get assertion failures in SegmentIndex for certain
939
+ * DAI content. If DAI adds ad segments to the manifest faster than
940
+ * real-time, adjustments to presentationStartTime_ can cause availability
941
+ * windows to jump around on updates.
942
+ */
943
+ lockStartTime ( ) : any ;
933
944
  /**
934
945
  * Gives PresentationTimeline a Stream's maximum segment duration so it can
935
946
  * size and position the segment availability window. This function should be
@@ -1680,7 +1691,7 @@ declare namespace shaka.text {
1680
1691
  linePadding : any ;
1681
1692
  nestedCues : any ;
1682
1693
  opacity : any ;
1683
- payload : string ;
1694
+ payload : any ;
1684
1695
  position : any ;
1685
1696
  positionAlign : any ;
1686
1697
  region : any ;
@@ -61,7 +61,6 @@ shaka.text.Cue.prototype.direction;
61
61
  shaka.text.Cue.prototype.endTime;
62
62
  /**
63
63
  * @override
64
- * @type {string}
65
64
  */
66
65
  shaka.text.Cue.prototype.payload;
67
66
  /**
@@ -386,6 +385,7 @@ shaka.util.BufferUtils = class {
386
385
  * @param {?BufferSource} arr1
387
386
  * @param {?BufferSource} arr2
388
387
  * @return {boolean}
388
+ * @suppress {strictMissingProperties}
389
389
  */
390
390
  static equal(arr1, arr2) {}
391
391
  /**
@@ -653,6 +653,43 @@ shaka.util.Error.Code = {
653
653
  'SS_AD_MANAGER_NOT_INITIALIZED': 10003,
654
654
  'CURRENT_DAI_REQUEST_NOT_FINISHED': 10004
655
655
  };
656
+ /**
657
+ * A timer allows a single function to be executed at a later time or at
658
+ * regular intervals.
659
+ * @final
660
+ */
661
+ shaka.util.Timer = class {
662
+ /**
663
+ * Create a new timer. A timer is committed to a single callback function.
664
+ * While there is no technical reason to do this, it is far easier to
665
+ * understand and use timers when they are connected to one functional idea.
666
+ * @param {function()} onTick
667
+ */
668
+ constructor(onTick) {}
669
+ /**
670
+ * Have the timer call |onTick| now.
671
+ * @return {!shaka.util.Timer}
672
+ */
673
+ tickNow() {}
674
+ /**
675
+ * Have the timer call |onTick| after |seconds| has elapsed unless |stop| is
676
+ * called first.
677
+ * @param {number} seconds
678
+ * @return {!shaka.util.Timer}
679
+ */
680
+ tickAfter(seconds) {}
681
+ /**
682
+ * Have the timer call |onTick| every |seconds| until |stop| is called.
683
+ * @param {number} seconds
684
+ * @return {!shaka.util.Timer}
685
+ */
686
+ tickEvery(seconds) {}
687
+ /**
688
+ * Stop the timer and clear the previous behaviour. The timer is still usable
689
+ * after calling |stop|.
690
+ */
691
+ stop() {}
692
+ };
656
693
  /**
657
694
  * @namespace shaka.util.StringUtils
658
695
  * @summary A set of string utility functions.
@@ -923,43 +960,6 @@ shaka.util.LanguageUtils = class {
923
960
  */
924
961
  static findClosestLocale(target, searchSpace) {}
925
962
  };
926
- /**
927
- * A timer allows a single function to be executed at a later time or at
928
- * regular intervals.
929
- * @final
930
- */
931
- shaka.util.Timer = class {
932
- /**
933
- * Create a new timer. A timer is committed to a single callback function.
934
- * While there is no technical reason to do this, it is far easier to
935
- * understand and use timers when they are connected to one functional idea.
936
- * @param {function()} onTick
937
- */
938
- constructor(onTick) {}
939
- /**
940
- * Have the timer call |onTick| now.
941
- * @return {!shaka.util.Timer}
942
- */
943
- tickNow() {}
944
- /**
945
- * Have the timer call |onTick| after |seconds| has elapsed unless |stop| is
946
- * called first.
947
- * @param {number} seconds
948
- * @return {!shaka.util.Timer}
949
- */
950
- tickAfter(seconds) {}
951
- /**
952
- * Have the timer call |onTick| every |seconds| until |stop| is called.
953
- * @param {number} seconds
954
- * @return {!shaka.util.Timer}
955
- */
956
- tickEvery(seconds) {}
957
- /**
958
- * Stop the timer and clear the previous behaviour. The timer is still usable
959
- * after calling |stop|.
960
- */
961
- stop() {}
962
- };
963
963
  /**
964
964
  * @summary
965
965
  * <p>
@@ -1833,6 +1833,17 @@ shaka.media.PresentationTimeline = class {
1833
1833
  * @param {!Array.<!shaka.media.SegmentReference>} references
1834
1834
  */
1835
1835
  notifySegments(references) {}
1836
+ /**
1837
+ * Lock the presentation timeline's start time. After this is called, no
1838
+ * further adjustments to presentationStartTime_ will be permitted.
1839
+ * This should be called after all Periods have been parsed, and all calls to
1840
+ * notifySegments() from the initial manifest parse have been made.
1841
+ * Without this, we can get assertion failures in SegmentIndex for certain
1842
+ * DAI content. If DAI adds ad segments to the manifest faster than
1843
+ * real-time, adjustments to presentationStartTime_ can cause availability
1844
+ * windows to jump around on updates.
1845
+ */
1846
+ lockStartTime() {}
1836
1847
  /**
1837
1848
  * Gives PresentationTimeline a Stream's minimum segment start time.
1838
1849
  * @param {number} startTime