shaka-player 3.3.1 → 3.3.2

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 (49) hide show
  1. package/.github/workflows/build_and_test.yaml +73 -0
  2. package/.github/workflows/release.yaml +53 -0
  3. package/CHANGELOG.md +13 -1
  4. package/build/checkversion.py +1 -1
  5. package/build/test.py +6 -0
  6. package/dist/controls.css +1 -1
  7. package/dist/deps.js +4 -4
  8. package/dist/locales.js +29 -29
  9. package/dist/shaka-player.compiled.d.ts +2 -1
  10. package/dist/shaka-player.compiled.debug.d.ts +2 -1
  11. package/dist/shaka-player.compiled.debug.externs.js +17 -12
  12. package/dist/shaka-player.compiled.debug.js +93 -90
  13. package/dist/shaka-player.compiled.debug.map +4 -4
  14. package/dist/shaka-player.compiled.externs.js +17 -12
  15. package/dist/shaka-player.compiled.js +687 -686
  16. package/dist/shaka-player.compiled.map +3 -3
  17. package/dist/shaka-player.ui.d.ts +4 -12
  18. package/dist/shaka-player.ui.debug.d.ts +4 -12
  19. package/dist/shaka-player.ui.debug.externs.js +19 -23
  20. package/dist/shaka-player.ui.debug.js +107 -105
  21. package/dist/shaka-player.ui.debug.map +4 -4
  22. package/dist/shaka-player.ui.externs.js +19 -23
  23. package/dist/shaka-player.ui.js +952 -952
  24. package/dist/shaka-player.ui.map +2 -2
  25. package/karma.conf.js +19 -15
  26. package/lib/ads/ad_manager.js +1 -0
  27. package/lib/cast/cast_proxy.js +3 -0
  28. package/lib/cast/cast_receiver.js +3 -0
  29. package/lib/dash/dash_parser.js +31 -19
  30. package/lib/hls/manifest_text_parser.js +1 -0
  31. package/lib/media/quality_observer.js +17 -34
  32. package/lib/media/region_observer.js +39 -33
  33. package/lib/media/region_timeline.js +17 -19
  34. package/lib/media/streaming_engine.js +1 -1
  35. package/lib/net/networking_engine.js +4 -0
  36. package/lib/offline/storage.js +8 -9
  37. package/lib/player.js +32 -10
  38. package/lib/util/fake_event_target.js +21 -1
  39. package/package.json +3 -6
  40. package/test/dash/dash_parser_live_unit.js +43 -0
  41. package/test/dash/dash_parser_manifest_unit.js +2 -1
  42. package/test/hls/hls_parser_unit.js +74 -0
  43. package/test/media/quality_observer_unit.js +4 -1
  44. package/test/media/region_observer_unit.js +40 -5
  45. package/test/media/region_timeline_unit.js +40 -22
  46. package/test/test/util/util.js +10 -7
  47. package/test/ui/text_displayer_layout_unit.js +8 -7
  48. package/ui/controls.js +3 -0
  49. package/ui/localization.js +12 -36
@@ -23,17 +23,18 @@ goog.require('shaka.util.LanguageUtils');
23
23
  * If a string is not available, it will return the localized
24
24
  * form in the closest related locale.
25
25
  *
26
- * @implements {EventTarget}
27
26
  * @final
28
27
  * @export
29
28
  */
30
- shaka.ui.Localization = class {
29
+ shaka.ui.Localization = class extends shaka.util.FakeEventTarget {
31
30
  /**
32
31
  * @param {string} fallbackLocale
33
32
  * The fallback locale that should be used. It will be assumed that this
34
33
  * locale should have entries for just about every request.
35
34
  */
36
35
  constructor(fallbackLocale) {
36
+ super();
37
+
37
38
  /** @private {string} */
38
39
  this.fallbackLocale_ = shaka.util.LanguageUtils.normalize(fallbackLocale);
39
40
 
@@ -62,41 +63,16 @@ shaka.ui.Localization = class {
62
63
  * @private {!Map.<string, !Map.<string, string>>}
63
64
  */
64
65
  this.localizations_ = new Map();
65
-
66
- /**
67
- * The event target that we will wrap so that we can fire events
68
- * without having to manage the listeners directly.
69
- *
70
- * @private {!EventTarget}
71
- */
72
- this.events_ = new shaka.util.FakeEventTarget();
73
- }
74
-
75
- /**
76
- * @override
77
- * @export
78
- */
79
- addEventListener(type, listener, options) {
80
- this.events_.addEventListener(type, listener, options);
81
- }
82
-
83
- /**
84
- * @override
85
- * @export
86
- */
87
- removeEventListener(type, listener, options) {
88
- // Apparently Closure says we can be passed a null |option|, but we can't
89
- // pass a null option, so if we get have a null-like |option|, force it to
90
- // be undefined.
91
- this.events_.removeEventListener(type, listener, options || undefined);
92
66
  }
93
67
 
94
68
  /**
95
69
  * @override
96
70
  * @export
97
71
  */
98
- dispatchEvent(event) {
99
- return this.events_.dispatchEvent(event);
72
+ release() {
73
+ // Placeholder so that readers know this implements IReleasable (via
74
+ // FakeEventTarget)
75
+ super.release();
100
76
  }
101
77
 
102
78
  /**
@@ -130,7 +106,7 @@ shaka.ui.Localization = class {
130
106
  (locale) => !this.localizations_.has(locale));
131
107
 
132
108
  if (missing.length) {
133
- this.events_.dispatchEvent(new shaka.util.FakeEvent(
109
+ this.dispatchEvent(new shaka.util.FakeEvent(
134
110
  Class.UNKNOWN_LOCALES,
135
111
  (new Map()).set('locales', missing)));
136
112
  }
@@ -141,7 +117,7 @@ shaka.ui.Localization = class {
141
117
 
142
118
  const data = (new Map()).set(
143
119
  'locales', found.length ? found : [this.fallbackLocale_]);
144
- this.events_.dispatchEvent(new shaka.util.FakeEvent(
120
+ this.dispatchEvent(new shaka.util.FakeEvent(
145
121
  Class.LOCALE_CHANGED,
146
122
  data));
147
123
  }
@@ -193,7 +169,7 @@ shaka.ui.Localization = class {
193
169
  // data from.
194
170
  this.updateCurrentMap_();
195
171
 
196
- this.events_.dispatchEvent(new FakeEvent(Class.LOCALE_UPDATED));
172
+ this.dispatchEvent(new FakeEvent(Class.LOCALE_UPDATED));
197
173
 
198
174
  return this;
199
175
  }
@@ -249,7 +225,7 @@ shaka.ui.Localization = class {
249
225
  // Make a copy to avoid leaking references.
250
226
  .set('locales', Array.from(this.currentLocales_))
251
227
  .set('missing', id);
252
- this.events_.dispatchEvent(new FakeEvent(Class.UNKNOWN_LOCALIZATION, data));
228
+ this.dispatchEvent(new FakeEvent(Class.UNKNOWN_LOCALIZATION, data));
253
229
 
254
230
  return '';
255
231
  }
@@ -377,7 +353,7 @@ shaka.ui.Localization = class {
377
353
  // an array.
378
354
  .set('missing', Array.from(missing));
379
355
 
380
- this.events_.dispatchEvent(new shaka.util.FakeEvent(
356
+ this.dispatchEvent(new shaka.util.FakeEvent(
381
357
  shaka.ui.Localization.MISSING_LOCALIZATIONS,
382
358
  data));
383
359
  }