shaka-player 4.3.9 → 4.3.10

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/karma.conf.js CHANGED
@@ -351,6 +351,8 @@ module.exports = (config) => {
351
351
  },
352
352
 
353
353
  babelPreprocessor: {
354
+ // Cache results in .babel-cache
355
+ cachePath: '.babel-cache',
354
356
  options: {
355
357
  presets: ['@babel/preset-env'],
356
358
  // Add source maps so that backtraces refer to the original code.
@@ -33,6 +33,9 @@ shaka.ads.ClientSideAdManager = class {
33
33
  /** @private {HTMLMediaElement} */
34
34
  this.video_ = video;
35
35
 
36
+ /** @private {boolean} */
37
+ this.videoPlayed_ = false;
38
+
36
39
  /** @private {ResizeObserver} */
37
40
  this.resizeObserver_ = null;
38
41
 
@@ -82,6 +85,10 @@ shaka.ads.ClientSideAdManager = class {
82
85
  this.eventManager_.listen(this.video_, 'ended', () => {
83
86
  this.adsLoader_.contentComplete();
84
87
  });
88
+
89
+ this.eventManager_.listenOnce(this.video_, 'play', () => {
90
+ this.videoPlayed_ = true;
91
+ });
85
92
  }
86
93
 
87
94
  /**
@@ -219,9 +226,14 @@ shaka.ads.ClientSideAdManager = class {
219
226
  // seen the ads actually play until requestAds() is called.
220
227
  // Note: We listen for a play event to avoid autoplay issues that might
221
228
  // crash IMA.
222
- this.eventManager_.listenOnce(this.video_, 'play', () => {
229
+ if (this.videoPlayed_) {
223
230
  this.imaAdsManager_.start();
224
- });
231
+ } else {
232
+ this.eventManager_.listenOnce(this.video_, 'play', () => {
233
+ this.videoPlayed_ = true;
234
+ this.imaAdsManager_.start();
235
+ });
236
+ }
225
237
  } catch (adError) {
226
238
  // If there was a problem with the VAST response,
227
239
  // we we won't be getting an ad. Hide ad UI if we showed it already
package/lib/player.js CHANGED
@@ -7020,7 +7020,7 @@ shaka.Player.TYPICAL_BUFFERING_THRESHOLD_ = 0.5;
7020
7020
  * @define {string} A version number taken from git at compile time.
7021
7021
  * @export
7022
7022
  */
7023
- shaka.Player.version = 'v4.3.9-uncompiled';
7023
+ shaka.Player.version = 'v4.3.10-uncompiled';
7024
7024
 
7025
7025
  // Initialize the deprecation system using the version string we just set
7026
7026
  // on the player.
@@ -214,6 +214,7 @@ shaka.util.Platform = class {
214
214
  !shaka.util.Platform.isTizen() &&
215
215
  !shaka.util.Platform.isEOS() &&
216
216
  !shaka.util.Platform.isVirginMedia() &&
217
+ !shaka.util.Platform.isOrange() &&
217
218
  !shaka.util.Platform.isPS4() &&
218
219
  !shaka.util.Platform.isAmazonFireTV();
219
220
  }
@@ -253,6 +254,13 @@ shaka.util.Platform = class {
253
254
  return shaka.util.Platform.userAgentContains_('VirginMedia');
254
255
  }
255
256
 
257
+ /**
258
+ * Check if the current platform is Orange.
259
+ */
260
+ static isOrange() {
261
+ return shaka.util.Platform.userAgentContains_('SOPOpenBrowser');
262
+ }
263
+
256
264
  /**
257
265
  * Check if the current platform is Amazon Fire TV.
258
266
  * https://developer.amazon.com/docs/fire-tv/identify-amazon-fire-tv-devices.html
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.3.9",
4
+ "version": "4.3.10",
5
5
  "homepage": "https://github.com/shaka-project/shaka-player",
6
6
  "author": "Google",
7
7
  "maintainers": [
@@ -14,6 +14,7 @@
14
14
  "@babel/core": "^7.17.5",
15
15
  "@babel/polyfill": "^7.12.1",
16
16
  "@babel/preset-env": "^7.16.11",
17
+ "@joeyparrish/karma-babel-preprocessor": "^8.2.0",
17
18
  "@teppeis/clutz": "^1.0.29-4c95e12.v20190929",
18
19
  "awesomplete": "^1.1.5",
19
20
  "babel-plugin-istanbul": "^6.1.1",
@@ -38,7 +39,6 @@
38
39
  "js-yaml": "^4.1.0",
39
40
  "jsdoc": "github:joeyparrish/jsdoc#2ca85bb6",
40
41
  "karma": "^6.3.16",
41
- "karma-babel-preprocessor": "^8.0.2",
42
42
  "karma-coverage": "^2.2.0",
43
43
  "karma-jasmine": "^4.0.1",
44
44
  "karma-jasmine-ajax": "^0.1.13",
@@ -575,7 +575,10 @@ describe('Player', () => {
575
575
  await waiter.timeoutAfter(20).waitUntilPlayheadReaches(video, 5);
576
576
 
577
577
  // Seek the video, and see if it can continue playing from that point.
578
- video.currentTime = 20;
578
+ // If this is a multiple of 10, it tends to flake on Tizen with stall
579
+ // detection disabled. So use 25.
580
+ video.currentTime = 25;
581
+
579
582
  // Expect that we can then reach the end of the video.
580
583
  await waiter.timeoutAfter(40).waitForEnd(video);
581
584
  });
@@ -169,7 +169,11 @@ shaka.test.UiUtils = class {
169
169
  const video = /** @type {!HTMLVideoElement} */(document.createElement(
170
170
  'video'));
171
171
 
172
- video.muted = true;
172
+ // Tizen has issues with audio-only playbacks on muted video elements.
173
+ // Don't mute Tizen.
174
+ if (!shaka.util.Platform.isTizen()) {
175
+ video.muted = true;
176
+ }
173
177
  video.width = 600;
174
178
  video.height = 400;
175
179
 
package/ui/externs/ui.js CHANGED
@@ -147,8 +147,8 @@ shaka.extern.UIVolumeBarColors;
147
147
  * ROLE means that only the role of the item is shown.
148
148
  * LANGUAGE_ROLE means both language and role are shown, or just language if
149
149
  * there is no role.
150
- * LABEL means the non-standard DASH "label" attribute or the HLS "NAME"
151
- * attribute are shown.
150
+ * LABEL means the non-standard DASH "label" attribute or the standard DASH
151
+ * "Label" element or the HLS "NAME" attribute are shown.
152
152
  * Defaults to LANGUAGE.
153
153
  * @property {number} fadeDelay
154
154
  * The delay (in seconds) before fading out the controls once the user stops
package/ui/seek_bar.js CHANGED
@@ -59,7 +59,13 @@ shaka.ui.SeekBar = class extends shaka.ui.RangeElement {
59
59
  * @private {shaka.util.Timer}
60
60
  */
61
61
  this.seekTimer_ = new shaka.util.Timer(() => {
62
- this.video.currentTime = this.getValue();
62
+ let newCurrentTime = this.getValue();
63
+ if (!this.player.isLive()) {
64
+ if (newCurrentTime == this.video.duration) {
65
+ newCurrentTime -= 0.001;
66
+ }
67
+ }
68
+ this.video.currentTime = newCurrentTime;
63
69
  });
64
70
 
65
71