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.
- package/.github/workflows/build_and_test.yaml +73 -0
- package/.github/workflows/release.yaml +53 -0
- package/CHANGELOG.md +13 -1
- package/build/checkversion.py +1 -1
- package/build/test.py +6 -0
- package/dist/controls.css +1 -1
- package/dist/deps.js +4 -4
- package/dist/locales.js +29 -29
- package/dist/shaka-player.compiled.d.ts +2 -1
- package/dist/shaka-player.compiled.debug.d.ts +2 -1
- package/dist/shaka-player.compiled.debug.externs.js +17 -12
- package/dist/shaka-player.compiled.debug.js +93 -90
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +17 -12
- package/dist/shaka-player.compiled.js +687 -686
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.d.ts +4 -12
- package/dist/shaka-player.ui.debug.d.ts +4 -12
- package/dist/shaka-player.ui.debug.externs.js +19 -23
- package/dist/shaka-player.ui.debug.js +107 -105
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +19 -23
- package/dist/shaka-player.ui.js +952 -952
- package/dist/shaka-player.ui.map +2 -2
- package/karma.conf.js +19 -15
- package/lib/ads/ad_manager.js +1 -0
- package/lib/cast/cast_proxy.js +3 -0
- package/lib/cast/cast_receiver.js +3 -0
- package/lib/dash/dash_parser.js +31 -19
- package/lib/hls/manifest_text_parser.js +1 -0
- package/lib/media/quality_observer.js +17 -34
- package/lib/media/region_observer.js +39 -33
- package/lib/media/region_timeline.js +17 -19
- package/lib/media/streaming_engine.js +1 -1
- package/lib/net/networking_engine.js +4 -0
- package/lib/offline/storage.js +8 -9
- package/lib/player.js +32 -10
- package/lib/util/fake_event_target.js +21 -1
- package/package.json +3 -6
- package/test/dash/dash_parser_live_unit.js +43 -0
- package/test/dash/dash_parser_manifest_unit.js +2 -1
- package/test/hls/hls_parser_unit.js +74 -0
- package/test/media/quality_observer_unit.js +4 -1
- package/test/media/region_observer_unit.js +40 -5
- package/test/media/region_timeline_unit.js +40 -22
- package/test/test/util/util.js +10 -7
- package/test/ui/text_displayer_layout_unit.js +8 -7
- package/ui/controls.js +3 -0
- package/ui/localization.js +12 -36
package/ui/localization.js
CHANGED
|
@@ -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
|
-
|
|
99
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
356
|
+
this.dispatchEvent(new shaka.util.FakeEvent(
|
|
381
357
|
shaka.ui.Localization.MISSING_LOCALIZATIONS,
|
|
382
358
|
data));
|
|
383
359
|
}
|