shaka-player 4.9.13 → 4.10.1

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 (91) hide show
  1. package/README.md +4 -0
  2. package/dist/controls.css +2 -2
  3. package/dist/controls.css.map +1 -1
  4. package/dist/deps.js +24 -19
  5. package/dist/locales.js +46 -35
  6. package/dist/shaka-player.compiled.d.ts +291 -12
  7. package/dist/shaka-player.compiled.debug.d.ts +291 -12
  8. package/dist/shaka-player.compiled.debug.externs.js +443 -6
  9. package/dist/shaka-player.compiled.debug.js +651 -556
  10. package/dist/shaka-player.compiled.debug.map +4 -4
  11. package/dist/shaka-player.compiled.externs.js +443 -6
  12. package/dist/shaka-player.compiled.js +1325 -1270
  13. package/dist/shaka-player.compiled.map +4 -4
  14. package/dist/shaka-player.ui.d.ts +306 -13
  15. package/dist/shaka-player.ui.debug.d.ts +306 -13
  16. package/dist/shaka-player.ui.debug.externs.js +477 -18
  17. package/dist/shaka-player.ui.debug.js +799 -681
  18. package/dist/shaka-player.ui.debug.map +4 -4
  19. package/dist/shaka-player.ui.externs.js +477 -18
  20. package/dist/shaka-player.ui.js +1600 -1533
  21. package/dist/shaka-player.ui.map +4 -4
  22. package/externs/shaka/ads.js +21 -1
  23. package/externs/shaka/manifest.js +20 -1
  24. package/externs/shaka/manifest_parser.js +18 -1
  25. package/externs/shaka/player.js +164 -50
  26. package/lib/ads/ad_manager.js +225 -10
  27. package/lib/ads/ad_utils.js +323 -0
  28. package/lib/ads/ads_stats.js +24 -0
  29. package/lib/ads/client_side_ad_manager.js +42 -34
  30. package/lib/ads/interstitial_ad.js +292 -0
  31. package/lib/ads/interstitial_ad_manager.js +772 -0
  32. package/lib/ads/media_tailor_ad_manager.js +19 -22
  33. package/lib/ads/server_side_ad_manager.js +12 -15
  34. package/lib/cast/cast_utils.js +1 -0
  35. package/lib/cea/cea_utils.js +12 -0
  36. package/lib/cea/mp4_cea_parser.js +17 -0
  37. package/lib/dash/dash_parser.js +81 -28
  38. package/lib/dash/segment_base.js +3 -0
  39. package/lib/hls/hls_parser.js +429 -121
  40. package/lib/hls/manifest_text_parser.js +1 -0
  41. package/lib/media/adaptation_set_criteria.js +31 -1
  42. package/lib/media/drm_engine.js +16 -2
  43. package/lib/media/manifest_filterer.js +7 -5
  44. package/lib/media/preload_manager.js +8 -10
  45. package/lib/media/presentation_timeline.js +37 -5
  46. package/lib/media/quality_observer.js +68 -2
  47. package/lib/media/segment_reference.js +1 -1
  48. package/lib/media/segment_utils.js +33 -1
  49. package/lib/media/streaming_engine.js +120 -43
  50. package/lib/mss/mss_parser.js +13 -2
  51. package/lib/net/networking_engine.js +1 -0
  52. package/lib/offline/manifest_converter.js +3 -0
  53. package/lib/offline/offline_manifest_parser.js +5 -0
  54. package/lib/offline/storage.js +2 -0
  55. package/lib/player.js +498 -165
  56. package/lib/util/fake_event.js +1 -0
  57. package/lib/util/manifest_parser_utils.js +9 -2
  58. package/lib/util/mp4_box_parsers.js +32 -0
  59. package/lib/util/player_configuration.js +21 -9
  60. package/lib/util/stats.js +43 -0
  61. package/package.json +1 -1
  62. package/shaka-player.uncompiled.js +2 -0
  63. package/ui/ad_counter.js +3 -3
  64. package/ui/ad_position.js +3 -3
  65. package/ui/ad_statistics_button.js +237 -0
  66. package/ui/audio_language_selection.js +8 -4
  67. package/ui/controls.js +6 -3
  68. package/ui/element.js +3 -3
  69. package/ui/enums.js +1 -0
  70. package/ui/externs/ui.js +3 -0
  71. package/ui/language_utils.js +48 -3
  72. package/ui/less/containers.less +32 -0
  73. package/ui/less/thumbnails.less +13 -0
  74. package/ui/locales/en.json +2 -0
  75. package/ui/locales/es-419.json +2 -0
  76. package/ui/locales/es.json +3 -0
  77. package/ui/locales/fr.json +1 -0
  78. package/ui/locales/pl.json +1 -0
  79. package/ui/locales/pt-BR.json +1 -0
  80. package/ui/locales/pt-PT.json +1 -0
  81. package/ui/locales/source.json +8 -0
  82. package/ui/mute_button.js +4 -4
  83. package/ui/overflow_menu.js +3 -3
  84. package/ui/play_button.js +5 -7
  85. package/ui/presentation_time.js +3 -3
  86. package/ui/save_video_frame_button.js +196 -0
  87. package/ui/seek_bar.js +75 -20
  88. package/ui/skip_ad_button.js +4 -4
  89. package/ui/statistics_button.js +14 -2
  90. package/ui/ui.js +15 -0
  91. package/ui/volume_bar.js +4 -4
@@ -0,0 +1,292 @@
1
+ /*! @license
2
+ * Shaka Player
3
+ * Copyright 2016 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+
8
+ goog.provide('shaka.ads.InterstitialAd');
9
+
10
+ /**
11
+ * @implements {shaka.extern.IAd}
12
+ * @export
13
+ */
14
+ shaka.ads.InterstitialAd = class {
15
+ /**
16
+ * @param {HTMLMediaElement} video
17
+ * @param {boolean} isSkippable
18
+ * @param {function()} onSkip
19
+ * @param {number} sequenceLength
20
+ * @param {number} adPosition
21
+ */
22
+ constructor(video, isSkippable, onSkip, sequenceLength, adPosition) {
23
+ /** @private {HTMLMediaElement} */
24
+ this.video_ = video;
25
+
26
+ /** @private {boolean} */
27
+ this.isSkippable_ = isSkippable;
28
+
29
+ /** @private {function()} */
30
+ this.onSkip_ = onSkip;
31
+
32
+ /** @private {number} */
33
+ this.sequenceLength_ = sequenceLength;
34
+
35
+ /** @private {number} */
36
+ this.adPosition_ = adPosition;
37
+ }
38
+
39
+
40
+ /**
41
+ * @override
42
+ * @export
43
+ */
44
+ getDuration() {
45
+ const duration = this.video_.duration;
46
+ if (isNaN(duration)) {
47
+ return -1;
48
+ }
49
+ return duration;
50
+ }
51
+
52
+ /**
53
+ * @override
54
+ * @export
55
+ */
56
+ getMinSuggestedDuration() {
57
+ return this.getDuration();
58
+ }
59
+
60
+ /**
61
+ * @override
62
+ * @export
63
+ */
64
+ getRemainingTime() {
65
+ const duration = this.video_.duration;
66
+ if (isNaN(duration)) {
67
+ return -1;
68
+ }
69
+ return duration - this.video_.currentTime;
70
+ }
71
+
72
+ /**
73
+ * @override
74
+ * @export
75
+ */
76
+ isPaused() {
77
+ return this.video_.paused;
78
+ }
79
+
80
+ /**
81
+ * @override
82
+ * @export
83
+ */
84
+ isSkippable() {
85
+ return this.isSkippable_;
86
+ }
87
+
88
+ /**
89
+ * @override
90
+ * @export
91
+ */
92
+ getTimeUntilSkippable() {
93
+ if (this.isSkippable_) {
94
+ return 0;
95
+ }
96
+ return Math.max(this.getRemainingTime(), 0);
97
+ }
98
+
99
+ /**
100
+ * @override
101
+ * @export
102
+ */
103
+ canSkipNow() {
104
+ return this.getTimeUntilSkippable() == 0;
105
+ }
106
+
107
+ /**
108
+ * @override
109
+ * @export
110
+ */
111
+ skip() {
112
+ this.onSkip_();
113
+ }
114
+
115
+ /**
116
+ * @override
117
+ * @export
118
+ */
119
+ pause() {
120
+ return this.video_.pause();
121
+ }
122
+
123
+ /**
124
+ * @override
125
+ * @export
126
+ */
127
+ play() {
128
+ return this.video_.play();
129
+ }
130
+
131
+
132
+ /**
133
+ * @override
134
+ * @export
135
+ */
136
+ getVolume() {
137
+ return this.video_.volume;
138
+ }
139
+
140
+ /**
141
+ * @override
142
+ * @export
143
+ */
144
+ setVolume(volume) {
145
+ this.video_.volume = volume;
146
+ }
147
+
148
+ /**
149
+ * @override
150
+ * @export
151
+ */
152
+ isMuted() {
153
+ return this.video_.muted;
154
+ }
155
+
156
+ /**
157
+ * @override
158
+ * @export
159
+ */
160
+ isLinear() {
161
+ return true;
162
+ }
163
+
164
+ /**
165
+ * @override
166
+ * @export
167
+ */
168
+ resize(width, height) {
169
+ // Nothing
170
+ }
171
+
172
+ /**
173
+ * @override
174
+ * @export
175
+ */
176
+ setMuted(muted) {
177
+ this.video_.muted = muted;
178
+ }
179
+
180
+
181
+ /**
182
+ * @override
183
+ * @export
184
+ */
185
+ getSequenceLength() {
186
+ return this.sequenceLength_;
187
+ }
188
+
189
+ /**
190
+ * @override
191
+ * @export
192
+ */
193
+ getPositionInSequence() {
194
+ return this.adPosition_;
195
+ }
196
+
197
+ /**
198
+ * @override
199
+ * @export
200
+ */
201
+ getTitle() {
202
+ return '';
203
+ }
204
+
205
+ /**
206
+ * @override
207
+ * @export
208
+ */
209
+ getDescription() {
210
+ return '';
211
+ }
212
+
213
+ /**
214
+ * @override
215
+ * @export
216
+ */
217
+ getVastMediaBitrate() {
218
+ return 0;
219
+ }
220
+
221
+ /**
222
+ * @override
223
+ * @export
224
+ */
225
+ getVastMediaHeight() {
226
+ return 0;
227
+ }
228
+
229
+ /**
230
+ * @override
231
+ * @export
232
+ */
233
+ getVastMediaWidth() {
234
+ return 0;
235
+ }
236
+
237
+ /**
238
+ * @override
239
+ * @export
240
+ */
241
+ getAdId() {
242
+ return '';
243
+ }
244
+
245
+ /**
246
+ * @override
247
+ * @export
248
+ */
249
+ getCreativeAdId() {
250
+ return '';
251
+ }
252
+
253
+ /**
254
+ * @override
255
+ * @export
256
+ */
257
+ getAdvertiserName() {
258
+ return '';
259
+ }
260
+
261
+ /**
262
+ * @override
263
+ * @export
264
+ */
265
+ getMediaUrl() {
266
+ return null;
267
+ }
268
+
269
+ /**
270
+ * @override
271
+ * @export
272
+ */
273
+ getTimeOffset() {
274
+ return 0;
275
+ }
276
+
277
+ /**
278
+ * @override
279
+ * @export
280
+ */
281
+ getPodIndex() {
282
+ return 0;
283
+ }
284
+
285
+ /**
286
+ * @override
287
+ * @export
288
+ */
289
+ release() {
290
+ this.video_ = null;
291
+ }
292
+ };