shaka-player 4.9.35 → 4.9.36

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 (74) hide show
  1. package/AUTHORS +1 -0
  2. package/CONTRIBUTORS +1 -0
  3. package/README.md +9 -3
  4. package/dist/controls.css +1 -1
  5. package/dist/controls.css.map +1 -1
  6. package/dist/deps.js +5 -5
  7. package/dist/locales.js +36 -36
  8. package/dist/shaka-player.compiled.d.ts +1 -0
  9. package/dist/shaka-player.compiled.debug.d.ts +1 -0
  10. package/dist/shaka-player.compiled.debug.externs.js +4 -3
  11. package/dist/shaka-player.compiled.debug.js +436 -421
  12. package/dist/shaka-player.compiled.debug.map +3 -3
  13. package/dist/shaka-player.compiled.externs.js +4 -3
  14. package/dist/shaka-player.compiled.js +1263 -1251
  15. package/dist/shaka-player.compiled.map +3 -3
  16. package/dist/shaka-player.dash.d.ts +4099 -0
  17. package/dist/shaka-player.dash.debug.d.ts +4099 -0
  18. package/dist/shaka-player.dash.debug.externs.js +4188 -0
  19. package/dist/shaka-player.dash.debug.js +2161 -0
  20. package/dist/shaka-player.dash.debug.map +8 -0
  21. package/dist/shaka-player.dash.externs.js +4188 -0
  22. package/dist/shaka-player.dash.js +1007 -0
  23. package/dist/shaka-player.dash.map +8 -0
  24. package/dist/shaka-player.hls.d.ts +4196 -0
  25. package/dist/shaka-player.hls.debug.d.ts +4196 -0
  26. package/dist/shaka-player.hls.debug.externs.js +4403 -0
  27. package/dist/shaka-player.hls.debug.js +2243 -0
  28. package/dist/shaka-player.hls.debug.map +8 -0
  29. package/dist/shaka-player.hls.externs.js +4403 -0
  30. package/dist/shaka-player.hls.js +1076 -0
  31. package/dist/shaka-player.hls.map +8 -0
  32. package/dist/shaka-player.ui.d.ts +1 -0
  33. package/dist/shaka-player.ui.debug.d.ts +1 -0
  34. package/dist/shaka-player.ui.debug.externs.js +4 -3
  35. package/dist/shaka-player.ui.debug.js +460 -445
  36. package/dist/shaka-player.ui.debug.map +3 -3
  37. package/dist/shaka-player.ui.externs.js +4 -3
  38. package/dist/shaka-player.ui.js +1462 -1453
  39. package/dist/shaka-player.ui.map +3 -3
  40. package/externs/shaka/player.js +8 -4
  41. package/lib/cast/cast_proxy.js +48 -10
  42. package/lib/cea/cea708_service.js +9 -16
  43. package/lib/dash/dash_parser.js +23 -16
  44. package/lib/dash/segment_template.js +41 -40
  45. package/lib/hls/hls_parser.js +2 -2
  46. package/lib/media/content_workarounds.js +110 -72
  47. package/lib/media/drm_engine.js +72 -11
  48. package/lib/media/gap_jumping_controller.js +14 -1
  49. package/lib/media/media_source_engine.js +29 -11
  50. package/lib/media/region_timeline.js +4 -3
  51. package/lib/media/streaming_engine.js +37 -11
  52. package/lib/net/http_plugin_utils.js +1 -1
  53. package/lib/net/networking_engine.js +8 -0
  54. package/lib/net/networking_utils.js +1 -0
  55. package/lib/player.js +109 -37
  56. package/lib/polyfill/patchedmediakeys_apple.js +21 -0
  57. package/lib/text/cue.js +6 -2
  58. package/lib/text/mp4_ttml_parser.js +94 -6
  59. package/lib/text/ui_text_displayer.js +35 -4
  60. package/lib/transmuxer/ac3_transmuxer.js +6 -1
  61. package/lib/util/config_utils.js +13 -3
  62. package/lib/util/drm_utils.js +8 -0
  63. package/lib/util/error.js +6 -0
  64. package/lib/util/mp4_generator.js +19 -4
  65. package/lib/util/periods.js +4 -2
  66. package/lib/util/platform.js +60 -12
  67. package/lib/util/player_configuration.js +6 -1
  68. package/lib/util/stream_utils.js +18 -0
  69. package/lib/util/tXml.js +3 -2
  70. package/package.json +3 -3
  71. package/ui/controls.js +2 -6
  72. package/ui/less/thumbnails.less +1 -0
  73. package/ui/statistics_button.js +3 -1
  74. package/ui/ui.js +44 -35
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shaka-player",
3
3
  "description": "DASH/EME video player library",
4
- "version": "4.9.35",
4
+ "version": "4.9.36",
5
5
  "homepage": "https://github.com/shaka-project/shaka-player",
6
6
  "author": "Google",
7
7
  "maintainers": [
@@ -43,7 +43,7 @@
43
43
  "karma-coverage": "^2.2.0",
44
44
  "karma-jasmine": "^4.0.1",
45
45
  "karma-jasmine-ajax": "^0.1.13",
46
- "karma-local-wd-launcher": "^1.6.7",
46
+ "karma-local-wd-launcher": "^1.6.9",
47
47
  "karma-opera-launcher": "^1.0.0",
48
48
  "karma-sourcemap-loader": "^0.3.8",
49
49
  "karma-spec-reporter": "^0.0.34",
@@ -105,7 +105,7 @@
105
105
  "prepublishOnly": "python build/checkversion.py && python build/all.py --force"
106
106
  },
107
107
  "dependencies": {
108
- "eme-encryption-scheme-polyfill": "^2.1.6"
108
+ "eme-encryption-scheme-polyfill": "^2.2.1"
109
109
  },
110
110
  "clean-package": {
111
111
  "remove": [
package/ui/controls.js CHANGED
@@ -1613,12 +1613,8 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
1613
1613
  goog.asserts.assert(
1614
1614
  this.seekBar_, 'Caller of seek_ must check for seekBar_ first!');
1615
1615
 
1616
- this.seekBar_.changeTo(currentTime);
1617
-
1618
- if (this.isOpaque()) {
1619
- // Only update the time and seek range if it's visible.
1620
- this.updateTimeAndSeekRange_();
1621
- }
1616
+ this.video_.currentTime = currentTime;
1617
+ this.updateTimeAndSeekRange_();
1622
1618
  }
1623
1619
 
1624
1620
  /**
@@ -8,6 +8,7 @@
8
8
  visibility: hidden;
9
9
  width: 15%;
10
10
  z-index: 1;
11
+ pointer-events: none;
11
12
 
12
13
  #shaka-player-ui-thumbnail-image {
13
14
  position: absolute;
@@ -119,7 +119,9 @@ shaka.ui.StatisticsButton = class extends shaka.ui.Element {
119
119
 
120
120
  const parseBytesDownloaded = (name) => {
121
121
  const bytes = parseInt(this.currentStats_[name], 10);
122
- if (bytes > 1e6) {
122
+ if (bytes > 2 * 1e9) {
123
+ return (bytes / 1e9).toFixed(2) + 'GB';
124
+ } else if (bytes > 1e6) {
123
125
  return (bytes / 1e6).toFixed(2) + 'MB';
124
126
  } else if (bytes > 1e3) {
125
127
  return (bytes / 1e3).toFixed(2) + 'KB';
package/ui/ui.js CHANGED
@@ -41,6 +41,35 @@ shaka.ui.Overlay = class {
41
41
  /** @private {!shaka.extern.UIConfiguration} */
42
42
  this.config_ = this.defaultConfig_();
43
43
 
44
+ // Get and configure cast app id.
45
+ let castAppId = '';
46
+
47
+ // Get and configure cast Android Receiver Compatibility
48
+ let castAndroidReceiverCompatible = false;
49
+
50
+ // Cast receiver id can be specified on either container or video.
51
+ // It should not be provided on both. If it was, we will use the last
52
+ // one we saw.
53
+ if (videoContainer['dataset'] &&
54
+ videoContainer['dataset']['shakaPlayerCastReceiverId']) {
55
+ const dataSet = videoContainer['dataset'];
56
+ castAppId = dataSet['shakaPlayerCastReceiverId'];
57
+ castAndroidReceiverCompatible =
58
+ dataSet['shakaPlayerCastAndroidReceiverCompatible'] === 'true';
59
+ } else if (video['dataset'] &&
60
+ video['dataset']['shakaPlayerCastReceiverId']) {
61
+ const dataSet = video['dataset'];
62
+ castAppId = dataSet['shakaPlayerCastReceiverId'];
63
+ castAndroidReceiverCompatible =
64
+ dataSet['shakaPlayerCastAndroidReceiverCompatible'] === 'true';
65
+ }
66
+
67
+ if (castAppId.length) {
68
+ this.config_.castReceiverAppId = castAppId;
69
+ this.config_.castAndroidReceiverCompatible =
70
+ castAndroidReceiverCompatible;
71
+ }
72
+
44
73
  // Make sure this container is discoverable and that the UI can be reached
45
74
  // through it.
46
75
  videoContainer['dataset']['shakaPlayerContainer'] = '';
@@ -55,10 +84,6 @@ shaka.ui.Overlay = class {
55
84
  this.controls_ = new shaka.ui.Controls(
56
85
  player, videoContainer, video, vrCanvas, this.config_);
57
86
 
58
- // Run the initial setup so that no configure() call is required for default
59
- // settings.
60
- this.configure({});
61
-
62
87
  // If the browser's native controls are disabled, use UI TextDisplayer.
63
88
  if (!video.controls) {
64
89
  player.setVideoContainer(videoContainer);
@@ -130,18 +155,29 @@ shaka.ui.Overlay = class {
130
155
 
131
156
  goog.asserts.assert(typeof(config) == 'object', 'Should be an object!');
132
157
 
158
+ const newConfig = /** @type {!shaka.extern.UIConfiguration} */(
159
+ Object.assign({}, this.config_));
133
160
  shaka.util.ConfigUtils.mergeConfigObjects(
134
- this.config_, config, this.defaultConfig_(),
161
+ newConfig, config, this.defaultConfig_(),
135
162
  /* overrides= */ {}, /* path= */ '');
136
163
 
137
164
  // If a cast receiver app id has been given, add a cast button to the UI
138
- if (this.config_.castReceiverAppId &&
139
- !this.config_.overflowMenuButtons.includes('cast')) {
140
- this.config_.overflowMenuButtons.push('cast');
165
+ if (newConfig.castReceiverAppId &&
166
+ !newConfig.overflowMenuButtons.includes('cast')) {
167
+ newConfig.overflowMenuButtons.push('cast');
141
168
  }
142
169
 
143
170
  goog.asserts.assert(this.player_ != null, 'Should have a player!');
144
171
 
172
+ const diff = shaka.util.ConfigUtils.getDifferenceFromConfigObjects(
173
+ newConfig, this.config_);
174
+ if (!Object.keys(diff).length) {
175
+ // No changes
176
+ return;
177
+ }
178
+
179
+ this.config_ = newConfig;
180
+
145
181
  this.controls_.configure(this.config_);
146
182
 
147
183
  this.controls_.dispatchEvent(new shaka.util.FakeEvent('uiupdated'));
@@ -432,33 +468,6 @@ shaka.ui.Overlay = class {
432
468
  // Attach Canvas used for LCEVC Decoding
433
469
  player.attachCanvas(/** @type {HTMLCanvasElement} */(lcevcCanvas));
434
470
 
435
- // Get and configure cast app id.
436
- let castAppId = '';
437
-
438
- // Get and configure cast Android Receiver Compatibility
439
- let castAndroidReceiverCompatible = false;
440
-
441
- // Cast receiver id can be specified on either container or video.
442
- // It should not be provided on both. If it was, we will use the last
443
- // one we saw.
444
- if (container['dataset'] &&
445
- container['dataset']['shakaPlayerCastReceiverId']) {
446
- castAppId = container['dataset']['shakaPlayerCastReceiverId'];
447
- castAndroidReceiverCompatible =
448
- container['dataset']['shakaPlayerCastAndroidReceiverCompatible'] ===
449
- 'true';
450
- } else if (video['dataset'] &&
451
- video['dataset']['shakaPlayerCastReceiverId']) {
452
- castAppId = video['dataset']['shakaPlayerCastReceiverId'];
453
- castAndroidReceiverCompatible =
454
- video['dataset']['shakaPlayerCastAndroidReceiverCompatible'] === 'true';
455
- }
456
-
457
- if (castAppId.length) {
458
- ui.configure({castReceiverAppId: castAppId,
459
- castAndroidReceiverCompatible: castAndroidReceiverCompatible});
460
- }
461
-
462
471
  if (shaka.util.Dom.asHTMLMediaElement(video).controls) {
463
472
  ui.getControls().setEnabledNativeControls(true);
464
473
  }