shaka-player 4.7.10 → 4.7.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.
@@ -656,7 +656,7 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
656
656
  */
657
657
  getServerSideCuePoints() {
658
658
  shaka.Deprecate.deprecateFeature(5,
659
- 'AdManager',
659
+ 'AdManager.getServerSideCuePoints',
660
660
  'Please use getCuePoints function.');
661
661
  return this.getCuePoints();
662
662
  }
@@ -107,7 +107,7 @@ shaka.Deprecate = class {
107
107
  libraryVersion,
108
108
  '. Additional information:',
109
109
  description,
110
- ].join('');
110
+ ].join(' ');
111
111
 
112
112
  shaka.log.alwaysError(errorMessage);
113
113
  goog.asserts.assert(false, errorMessage);
@@ -32,6 +32,7 @@ goog.require('shaka.util.FakeEvent');
32
32
  goog.require('shaka.util.LanguageUtils');
33
33
  goog.require('shaka.util.ManifestParserUtils');
34
34
  goog.require('shaka.util.MimeUtils');
35
+ goog.require('shaka.util.Networking');
35
36
  goog.require('shaka.util.OperationManager');
36
37
  goog.require('shaka.util.Pssh');
37
38
  goog.require('shaka.media.SegmentUtils');
@@ -909,8 +910,11 @@ shaka.hls.HlsParser = class {
909
910
  playlist, middleSegment.tags, getUris);
910
911
  this.mapTagToInitSegmentRefMap_.clear();
911
912
  if (initSegmentRef) {
912
- const initSegmentRequest = shaka.net.NetworkingEngine.makeRequest(
913
- initSegmentRef.getUris(), this.config_.retryParameters);
913
+ const initSegmentRequest = shaka.util.Networking.createSegmentRequest(
914
+ initSegmentRef.getUris(),
915
+ initSegmentRef.getStartByte(),
916
+ initSegmentRef.getEndByte(),
917
+ this.config_.retryParameters);
914
918
  const initType =
915
919
  shaka.net.NetworkingEngine.AdvancedRequestType.INIT_SEGMENT;
916
920
  const initResponse = await this.makeNetworkRequest_(
@@ -4130,7 +4134,22 @@ shaka.hls.HlsParser = class {
4130
4134
  * @return {?shaka.extern.DrmInfo}
4131
4135
  * @private
4132
4136
  */
4133
- static identityDrmParser_(drmTag) {
4137
+ static identityDrmParser_(drmTag, mimeType) {
4138
+ if (mimeType == 'video/mp2t') {
4139
+ throw new shaka.util.Error(
4140
+ shaka.util.Error.Severity.CRITICAL,
4141
+ shaka.util.Error.Category.MANIFEST,
4142
+ shaka.util.Error.Code.HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED);
4143
+ }
4144
+
4145
+ if (shaka.util.Platform.isMediaKeysPolyfilled()) {
4146
+ throw new shaka.util.Error(
4147
+ shaka.util.Error.Severity.CRITICAL,
4148
+ shaka.util.Error.Category.MANIFEST,
4149
+ shaka.util.Error.Code
4150
+ .HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED);
4151
+ }
4152
+
4134
4153
  const method = drmTag.getRequiredAttrValue('METHOD');
4135
4154
  const VALID_METHODS = ['SAMPLE-AES', 'SAMPLE-AES-CTR'];
4136
4155
  if (!VALID_METHODS.includes(method)) {
@@ -28,7 +28,7 @@ shaka.media.ManifestParser = class {
28
28
  */
29
29
  static registerParserByExtension(extension, parserFactory) {
30
30
  shaka.Deprecate.deprecateFeature(5,
31
- 'ManifestParser',
31
+ 'ManifestParser.registerParserByExtension',
32
32
  'Please use an ManifestParser with registerParserByMime function.');
33
33
  }
34
34
 
@@ -125,7 +125,8 @@ shaka.media.ManifestParser = class {
125
125
  shaka.util.Error.Severity.CRITICAL,
126
126
  shaka.util.Error.Category.MANIFEST,
127
127
  shaka.util.Error.Code.UNABLE_TO_GUESS_MANIFEST_TYPE,
128
- uri);
128
+ uri,
129
+ mimeType);
129
130
  }
130
131
 
131
132
 
package/lib/player.js CHANGED
@@ -742,7 +742,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
742
742
  // player having been initialized.
743
743
  if (mediaElement) {
744
744
  shaka.Deprecate.deprecateFeature(5,
745
- 'Player',
745
+ 'Player w/ mediaElement',
746
746
  'Please migrate from initializing Player with a mediaElement; ' +
747
747
  'use the attach method instead.');
748
748
  this.attach(mediaElement, /* initializeMediaSource= */ true);
@@ -1858,19 +1858,19 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
1858
1858
  this.abrManager_ = abrFactory();
1859
1859
  if (typeof this.abrManager_.setMediaElement != 'function') {
1860
1860
  shaka.Deprecate.deprecateFeature(5,
1861
- 'AbrManager',
1861
+ 'AbrManager w/o setMediaElement',
1862
1862
  'Please use an AbrManager with setMediaElement function.');
1863
1863
  this.abrManager_.setMediaElement = () => {};
1864
1864
  }
1865
1865
  if (typeof this.abrManager_.setCmsdManager != 'function') {
1866
1866
  shaka.Deprecate.deprecateFeature(5,
1867
- 'AbrManager',
1867
+ 'AbrManager w/o setCmsdManager',
1868
1868
  'Please use an AbrManager with setCmsdManager function.');
1869
1869
  this.abrManager_.setCmsdManager = () => {};
1870
1870
  }
1871
1871
  if (typeof this.abrManager_.trySuggestStreams != 'function') {
1872
1872
  shaka.Deprecate.deprecateFeature(5,
1873
- 'AbrManager',
1873
+ 'AbrManager w/o trySuggestStreams',
1874
1874
  'Please use an AbrManager with trySuggestStreams function.');
1875
1875
  this.abrManager_.trySuggestStreams = () => {};
1876
1876
  }
@@ -6934,7 +6934,7 @@ shaka.Player.TYPICAL_BUFFERING_THRESHOLD_ = 0.5;
6934
6934
  * @export
6935
6935
  */
6936
6936
  // eslint-disable-next-line no-useless-concat
6937
- shaka.Player.version = 'v4.7.10' + '-uncompiled'; // x-release-please-version
6937
+ shaka.Player.version = 'v4.7.11' + '-uncompiled'; // x-release-please-version
6938
6938
 
6939
6939
  // Initialize the deprecation system using the version string we just set
6940
6940
  // on the player.
@@ -32,11 +32,12 @@ shaka.polyfill.MediaSource = class {
32
32
 
33
33
  if (!window.MediaSource) {
34
34
  shaka.log.info('No MSE implementation available.');
35
- } else if (window.cast && cast.__platform__ &&
36
- cast.__platform__.canDisplayType) {
35
+ } else if (shaka.util.Platform.isChromecast()) {
37
36
  shaka.log.info('Patching Chromecast MSE bugs.');
38
- // Chromecast cannot make accurate determinations via isTypeSupported.
39
- shaka.polyfill.MediaSource.patchCastIsTypeSupported_();
37
+ // Chromecast fails on some TS content, even though it is supposed to
38
+ // support it. Better to transmux.
39
+ // See https://github.com/shaka-project/shaka-player/issues/5278
40
+ shaka.polyfill.MediaSource.rejectContainer_('mp2t');
40
41
  } else if (safariVersion) {
41
42
  // NOTE: shaka.Player.isBrowserSupported() has its own restrictions on
42
43
  // Safari version.
@@ -182,38 +183,6 @@ shaka.polyfill.MediaSource = class {
182
183
  };
183
184
  }
184
185
 
185
- /**
186
- * Patch isTypeSupported() to chain to a private API on the Chromecast which
187
- * can query for support of detailed content parameters.
188
- *
189
- * @private
190
- */
191
- static patchCastIsTypeSupported_() {
192
- const originalIsTypeSupported = MediaSource.isTypeSupported;
193
-
194
- MediaSource.isTypeSupported = (mimeType) => {
195
- // Parse the basic MIME type from its parameters.
196
- const pieces = mimeType.split(/ *; */);
197
- pieces.shift(); // Remove basic MIME type from pieces.
198
-
199
- const hasCodecs = pieces.some((piece) => piece.startsWith('codecs='));
200
- if (!hasCodecs) {
201
- // Though the original reason for this special case was not documented,
202
- // it is presumed to be because the platform won't accept a MIME type
203
- // without codecs in canDisplayType. It is valid, however, in
204
- // isTypeSupported.
205
- return originalIsTypeSupported(mimeType);
206
- }
207
-
208
- // Only canDisplayType can check extended MIME type parameters on this
209
- // platform (such as frame rate, resolution, etc).
210
- // In previous versions of this polyfill, the MIME type parameters were
211
- // manipulated, filtered, or extended. This is no longer true, so we pass
212
- // the full MIME type to the platform as we received it.
213
- return cast.__platform__.canDisplayType(mimeType);
214
- };
215
- }
216
-
217
186
  /**
218
187
  * Patch isTypeSupported() to translate vp09 codec strings into vp9, to allow
219
188
  * such content to play on older smart TVs.
@@ -687,6 +687,8 @@ shaka.text.VttTextParser = class {
687
687
  refCue.fontFamily, cue.fontFamily);
688
688
  cue.fontSize = VttTextParser.getOrDefault_(
689
689
  refCue.fontSize, cue.fontSize);
690
+ cue.textShadow = VttTextParser.getOrDefault_(
691
+ refCue.textShadow, cue.textShadow);
690
692
 
691
693
  // Overwrite with new values as unable to determine
692
694
  // if new value is set or not
@@ -695,7 +697,6 @@ shaka.text.VttTextParser = class {
695
697
  cue.opacity = refCue.opacity;
696
698
  cue.rubyTag = refCue.rubyTag;
697
699
  cue.textCombineUpright = refCue.textCombineUpright;
698
- cue.textShadow = refCue.textShadow;
699
700
  cue.wrapLine = refCue.wrapLine;
700
701
  }
701
702
 
package/lib/util/error.js CHANGED
@@ -527,6 +527,7 @@ shaka.util.Error.Code = {
527
527
  * <li>Configure the server to accept a HEAD request for the manifest.
528
528
  * </ul>
529
529
  * <br> error.data[0] is the manifest URI.
530
+ * <br> error.data[1] is the detected or specified MIME type.
530
531
  */
531
532
  'UNABLE_TO_GUESS_MANIFEST_TYPE': 4000,
532
533
 
@@ -433,7 +433,7 @@ shaka.util.TsParser = class {
433
433
  */
434
434
  parseAvcNalus(pes, nextPes) {
435
435
  shaka.Deprecate.deprecateFeature(5,
436
- 'TsParser',
436
+ 'TsParser.parseAvcNalus',
437
437
  'Please use parseNalus function instead.');
438
438
  return this.parseNalus(pes);
439
439
  }
@@ -769,7 +769,7 @@ shaka.util.TsParser = class {
769
769
  */
770
770
  getVideoResolution() {
771
771
  shaka.Deprecate.deprecateFeature(5,
772
- 'TsParser',
772
+ 'TsParser.getVideoResolution',
773
773
  'Please use getVideoInfo function instead.');
774
774
  const videoInfo = this.getVideoInfo();
775
775
  return {
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.7.10",
4
+ "version": "4.7.11",
5
5
  "homepage": "https://github.com/shaka-project/shaka-player",
6
6
  "author": "Google",
7
7
  "maintainers": [
@@ -49,7 +49,7 @@
49
49
  "karma-spec-reporter": "^0.0.34",
50
50
  "karma-webdriver-launcher": "^1.0.8",
51
51
  "lcevc_dec.js": "^1.0.1",
52
- "less": "https://gitpkg.now.sh/joeyparrish/less.js/packages/less?28c63a43",
52
+ "less": "^4.2.0",
53
53
  "less-plugin-clean-css": "github:austingardner/less-plugin-clean-css#4e9e77bf",
54
54
  "material-design-lite": "^1.3.0",
55
55
  "open-sans-fonts": "^1.6.2",
@@ -24,6 +24,7 @@
24
24
  /* Set the fonts for all other content. */
25
25
  * {
26
26
  font-family: Roboto-Regular, Roboto, sans-serif, TengwarTelcontar;
27
+ -webkit-font-smoothing: antialiased;
27
28
  }
28
29
  }
29
30