shaka-player 4.3.9 → 4.3.11

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 (48) hide show
  1. package/.github/workflows/build-and-test.yaml +11 -18
  2. package/.github/workflows/compute-incremental-coverage.py +3 -0
  3. package/.github/workflows/release-please.yaml +21 -6
  4. package/.github/workflows/report-incremental-coverage.yaml +2 -2
  5. package/.github/workflows/selenium-lab-tests.yaml +45 -10
  6. package/.github/workflows/shaka-bot-commands/command-help.sh +27 -0
  7. package/.github/workflows/shaka-bot-commands/command-test.sh +56 -0
  8. package/.github/workflows/shaka-bot-commands/lib.sh +83 -0
  9. package/.github/workflows/shaka-bot-commands/main.sh +51 -0
  10. package/.github/workflows/talk-to-shaka-bot.yaml +29 -0
  11. package/.github/workflows/update-issues.yaml +2 -1
  12. package/.github/workflows/validate-pr-title.yaml +3 -11
  13. package/CHANGELOG.md +17 -0
  14. package/demo/common/assets.js +59 -25
  15. package/demo/main.js +5 -0
  16. package/dist/demo.compiled.debug.js +15 -13
  17. package/dist/demo.compiled.debug.map +3 -3
  18. package/dist/demo.compiled.js +15 -13
  19. package/dist/demo.compiled.map +3 -3
  20. package/dist/locales.js +31 -31
  21. package/dist/receiver.compiled.debug.js +13 -11
  22. package/dist/receiver.compiled.debug.map +3 -3
  23. package/dist/receiver.compiled.js +13 -11
  24. package/dist/receiver.compiled.map +3 -3
  25. package/dist/shaka-player.compiled.d.ts +257 -257
  26. package/dist/shaka-player.compiled.debug.d.ts +257 -257
  27. package/dist/shaka-player.compiled.debug.js +9 -8
  28. package/dist/shaka-player.compiled.debug.map +3 -3
  29. package/dist/shaka-player.compiled.js +69 -69
  30. package/dist/shaka-player.compiled.map +2 -2
  31. package/dist/shaka-player.ui.d.ts +301 -301
  32. package/dist/shaka-player.ui.debug.d.ts +301 -301
  33. package/dist/shaka-player.ui.debug.js +16 -15
  34. package/dist/shaka-player.ui.debug.map +3 -3
  35. package/dist/shaka-player.ui.js +79 -79
  36. package/dist/shaka-player.ui.map +2 -2
  37. package/externs/shaka/namespace.js +2 -2
  38. package/karma.conf.js +2 -0
  39. package/lib/ads/client_side_ad_manager.js +14 -2
  40. package/lib/hls/hls_parser.js +1 -0
  41. package/lib/player.js +1 -1
  42. package/lib/util/platform.js +8 -0
  43. package/package.json +2 -2
  44. package/test/hls/hls_parser_unit.js +12 -13
  45. package/test/player_integration.js +4 -1
  46. package/test/test/util/ui_utils.js +5 -1
  47. package/ui/externs/ui.js +2 -2
  48. package/ui/seek_bar.js +7 -1
@@ -6,8 +6,8 @@
6
6
 
7
7
  /**
8
8
  * @externs
9
- * @suppress {duplicate} To prevent compiler errors with the namespace
10
- * being declared both here and by goog.provide in the library.
9
+ * @suppress {constantProperty, duplicate} To prevent compiler errors with the
10
+ * namespace being declared both here and by goog.provide in the library.
11
11
  */
12
12
 
13
13
  /** @namespace */
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
@@ -1155,6 +1155,7 @@ shaka.hls.HlsParser = class {
1155
1155
  // and no video codec, so it should be audio.
1156
1156
  type = ContentType.AUDIO;
1157
1157
  shaka.log.debug('Guessing audio-only.');
1158
+ ignoreStream = res.audio.length > 0;
1158
1159
  } else if (!streamInfos.length && audioCodecs && videoCodecs) {
1159
1160
  // There are both audio and video codecs, so assume multiplexed content.
1160
1161
  // Note that the default used when CODECS is missing assumes multiple
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.11-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.11",
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",
@@ -4113,19 +4113,11 @@ describe('HlsParser', () => {
4113
4113
  expect(videoSegments2[2].endTime).toBe(10);
4114
4114
  });
4115
4115
 
4116
- // Issue #1875
4117
- it('ignores audio groups on audio-only content', async () => {
4118
- // NOTE: To reproduce the original issue accurately, the two audio playlist
4119
- // URIs must differ. When the issue occurred, the audio-only variant would
4120
- // be detected as a video stream and combined with the audio group, leading
4121
- // the player to buffer "video" that was really audio, resulting in
4122
- // audio-only playback to the exclusion of any other streams. Since the
4123
- // root cause of that was the mis-detection, this repro case does not need
4124
- // to include any audio+video variants.
4116
+ it('allow audio groups on audio-only content', async () => {
4125
4117
  const master = [
4126
4118
  '#EXTM3U\n',
4127
- '#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aud",LANG="en",URI="audio1"\n',
4128
- '#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aud",LANG="eo",URI="audio2"\n',
4119
+ '#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aud",LANGUAGE="en",URI="audio1"\n',
4120
+ '#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aud",LANGUAGE="eo",URI="audio2"\n',
4129
4121
  '#EXT-X-STREAM-INF:BANDWIDTH=200,CODECS="mp4a",AUDIO="aud"\n',
4130
4122
  'audio3\n',
4131
4123
  ].join('');
@@ -4143,7 +4135,14 @@ describe('HlsParser', () => {
4143
4135
  manifest.anyTimeline();
4144
4136
  manifest.addPartialVariant((variant) => {
4145
4137
  variant.bandwidth = 200;
4146
- variant.language = 'und';
4138
+ variant.language = 'en';
4139
+ variant.addPartialStream(ContentType.AUDIO, (stream) => {
4140
+ stream.mime('audio/mp4', 'mp4a');
4141
+ });
4142
+ });
4143
+ manifest.addPartialVariant((variant) => {
4144
+ variant.bandwidth = 200;
4145
+ variant.language = 'eo';
4147
4146
  variant.addPartialStream(ContentType.AUDIO, (stream) => {
4148
4147
  stream.mime('audio/mp4', 'mp4a');
4149
4148
  });
@@ -4161,7 +4160,7 @@ describe('HlsParser', () => {
4161
4160
 
4162
4161
  const actual = await parser.start('test:/master', playerInterface);
4163
4162
  await loadAllStreamsFor(actual);
4164
- expect(actual.variants.length).toBe(1);
4163
+ expect(actual.variants.length).toBe(2);
4165
4164
  expect(actual).toEqual(manifest);
4166
4165
  });
4167
4166
 
@@ -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