rx-player 3.27.0-dev.20220317 → 3.27.0-dev.2022032100

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 (121) hide show
  1. package/.eslintrc.js +0 -4
  2. package/CHANGELOG.md +3 -2
  3. package/VERSION +1 -1
  4. package/dist/_esm5.processed/compat/eme/close_session.js +1 -2
  5. package/dist/_esm5.processed/compat/eme/custom_key_system_access.d.ts +15 -0
  6. package/dist/_esm5.processed/compat/eme/custom_key_system_access.js +1 -17
  7. package/dist/_esm5.processed/compat/eme/custom_media_keys/ie11_media_keys.js +6 -7
  8. package/dist/_esm5.processed/compat/eme/custom_media_keys/index.js +3 -4
  9. package/dist/_esm5.processed/compat/eme/custom_media_keys/old_webkit_media_keys.js +6 -7
  10. package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys.js +7 -8
  11. package/dist/_esm5.processed/compat/eme/load_session.js +1 -2
  12. package/dist/_esm5.processed/core/api/option_utils.d.ts +3 -2
  13. package/dist/_esm5.processed/core/api/option_utils.js +2 -1
  14. package/dist/_esm5.processed/core/api/public_api.js +3 -4
  15. package/dist/_esm5.processed/core/decrypt/attach_media_keys.js +1 -2
  16. package/dist/_esm5.processed/core/decrypt/clear_on_stop.js +1 -2
  17. package/dist/_esm5.processed/core/decrypt/content_decryptor.js +1 -2
  18. package/dist/_esm5.processed/core/decrypt/create_session.js +1 -2
  19. package/dist/_esm5.processed/core/decrypt/find_key_system.js +1 -2
  20. package/dist/_esm5.processed/core/decrypt/utils/clean_old_loaded_sessions.js +1 -2
  21. package/dist/_esm5.processed/core/decrypt/utils/loaded_sessions_store.js +5 -6
  22. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +1 -3
  23. package/dist/_esm5.processed/core/fetchers/utils/try_urls_with_backoff.js +2 -3
  24. package/dist/_esm5.processed/core/init/initialize_media_source.d.ts +2 -1
  25. package/dist/_esm5.processed/core/stream/index.d.ts +1 -0
  26. package/dist/_esm5.processed/core/stream/period/get_adaptation_switch_strategy.d.ts +15 -11
  27. package/dist/_esm5.processed/core/stream/period/get_adaptation_switch_strategy.js +5 -2
  28. package/dist/_esm5.processed/core/stream/period/index.d.ts +1 -0
  29. package/dist/_esm5.processed/core/stream/period/period_stream.d.ts +3 -11
  30. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/thumbnail_loader.js +5 -6
  31. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/index.js +2 -3
  32. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.d.ts +15 -0
  33. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.js +1 -2
  34. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.js +2 -3
  35. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.js +2 -3
  36. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.js +1 -2
  37. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +1 -2
  38. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.js +1 -2
  39. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +1 -2
  40. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +4 -5
  41. package/dist/_esm5.processed/public_types.d.ts +1 -0
  42. package/dist/_esm5.processed/transports/dash/add_segment_integrity_checks_to_loader.js +1 -2
  43. package/dist/_esm5.processed/transports/dash/image_pipelines.d.ts +4 -3
  44. package/dist/_esm5.processed/transports/dash/image_pipelines.js +57 -11
  45. package/dist/_esm5.processed/transports/dash/init_segment_loader.js +1 -2
  46. package/dist/_esm5.processed/transports/dash/manifest_parser.js +2 -3
  47. package/dist/_esm5.processed/transports/dash/segment_loader.d.ts +1 -1
  48. package/dist/_esm5.processed/transports/dash/segment_loader.js +3 -4
  49. package/dist/_esm5.processed/transports/dash/text_loader.js +1 -2
  50. package/dist/_esm5.processed/transports/local/segment_loader.js +2 -3
  51. package/dist/_esm5.processed/transports/metaplaylist/pipelines.js +2 -3
  52. package/dist/_esm5.processed/transports/smooth/pipelines.js +3 -4
  53. package/dist/_esm5.processed/transports/smooth/segment_loader.js +3 -4
  54. package/dist/_esm5.processed/transports/utils/call_custom_manifest_loader.js +1 -2
  55. package/dist/_esm5.processed/utils/cancellable_sleep.js +1 -2
  56. package/dist/_esm5.processed/utils/cast_to_observable.js +1 -3
  57. package/dist/_esm5.processed/utils/request/xhr.js +1 -2
  58. package/dist/rx-player.js +128 -501
  59. package/dist/rx-player.min.js +1 -1
  60. package/package.json +1 -2
  61. package/scripts/update-version +2 -2
  62. package/sonar-project.properties +1 -1
  63. package/src/compat/__tests__/play.test.ts +2 -4
  64. package/src/compat/eme/close_session.ts +1 -2
  65. package/src/compat/eme/custom_key_system_access.ts +1 -2
  66. package/src/compat/eme/custom_media_keys/ie11_media_keys.ts +6 -7
  67. package/src/compat/eme/custom_media_keys/index.ts +3 -4
  68. package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +6 -7
  69. package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +7 -8
  70. package/src/compat/eme/load_session.ts +1 -2
  71. package/src/core/api/__tests__/option_utils.test.ts +12 -0
  72. package/src/core/api/option_utils.ts +5 -3
  73. package/src/core/api/public_api.ts +3 -4
  74. package/src/core/decrypt/attach_media_keys.ts +1 -2
  75. package/src/core/decrypt/clear_on_stop.ts +1 -2
  76. package/src/core/decrypt/content_decryptor.ts +1 -2
  77. package/src/core/decrypt/create_session.ts +2 -3
  78. package/src/core/decrypt/find_key_system.ts +1 -2
  79. package/src/core/decrypt/utils/clean_old_loaded_sessions.ts +1 -2
  80. package/src/core/decrypt/utils/loaded_sessions_store.ts +5 -6
  81. package/src/core/fetchers/manifest/manifest_fetcher.ts +1 -3
  82. package/src/core/fetchers/utils/try_urls_with_backoff.ts +2 -3
  83. package/src/core/init/initialize_media_source.ts +2 -1
  84. package/src/core/stream/index.ts +1 -0
  85. package/src/core/stream/period/get_adaptation_switch_strategy.ts +24 -14
  86. package/src/core/stream/period/index.ts +1 -0
  87. package/src/core/stream/period/period_stream.ts +5 -14
  88. package/src/experimental/tools/VideoThumbnailLoader/thumbnail_loader.ts +5 -6
  89. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +5 -6
  90. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/decodingInfos.test.ts +2 -4
  91. package/src/experimental/tools/mediaCapabilitiesProber/api/index.ts +2 -3
  92. package/src/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.ts +1 -2
  93. package/src/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.ts +2 -3
  94. package/src/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.ts +2 -3
  95. package/src/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.ts +1 -2
  96. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +1 -2
  97. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +1 -2
  98. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +1 -2
  99. package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +4 -5
  100. package/src/public_types.ts +1 -0
  101. package/src/transports/dash/add_segment_integrity_checks_to_loader.ts +1 -2
  102. package/src/transports/dash/image_pipelines.ts +12 -14
  103. package/src/transports/dash/init_segment_loader.ts +1 -2
  104. package/src/transports/dash/manifest_parser.ts +2 -3
  105. package/src/transports/dash/segment_loader.ts +4 -5
  106. package/src/transports/dash/text_loader.ts +2 -3
  107. package/src/transports/local/segment_loader.ts +2 -3
  108. package/src/transports/metaplaylist/pipelines.ts +2 -3
  109. package/src/transports/smooth/pipelines.ts +4 -5
  110. package/src/transports/smooth/segment_loader.ts +5 -6
  111. package/src/transports/utils/call_custom_manifest_loader.ts +1 -2
  112. package/src/utils/cancellable_sleep.ts +1 -2
  113. package/src/utils/cast_to_observable.ts +0 -2
  114. package/src/utils/request/xhr.ts +1 -2
  115. package/tsconfig.json +0 -1
  116. package/tsconfig.modules.json +0 -1
  117. package/dist/_esm5.processed/utils/promise.d.ts +0 -17
  118. package/dist/_esm5.processed/utils/promise.js +0 -18
  119. package/src/typings/pinkie.d.ts +0 -19
  120. package/src/utils/__tests__/promise.test.ts +0 -23
  121. package/src/utils/promise.ts +0 -20
package/.eslintrc.js CHANGED
@@ -350,10 +350,6 @@ module.exports = {
350
350
  "property": "substr",
351
351
  "message": "Please use `substring` instead.",
352
352
  },
353
- {
354
- "object": "Promise",
355
- "message": "Not available in IE11, use promise ponyfill instead",
356
- }
357
353
  ],
358
354
  "quote-props": [
359
355
  "error",
package/CHANGELOG.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## v3.27.0-dev.2022031700 (2022-03-17)
3
+ ## v3.27.0-dev.2022032100 (2022-03-21)
4
4
 
5
5
  ### Features
6
6
 
7
7
  - Add a `maxVideoBufferSize` constructor option and `{get,set}MaxVideoBufferSize` methods to limit the size of loaded video data buffered at the same time [#1041, #1054]
8
8
  - DRM: Add a `"periods"` mode to the `keySystems[].singleLicensePer` `loadVideo` option, allowing to obtain decryption license for groups of Periods allowing a compromise between optimization, features and compatibility [#1028, #1061]
9
+ - Add a `"reload"` `audioTrackSwitchingMode` to work-around rare compatibility issues when switching audio tracks [#1089]
9
10
 
10
11
  ### Bug fixes
11
12
 
@@ -25,9 +26,9 @@
25
26
  - add better buffer cleaning logic on a browser's `QuotaExceededError` to better handle memory limitations [#1065]
26
27
  - DASH: Prioritize selectionPriority attribute over a "main" Role when ordering AdaptationSets [#1082]
27
28
  - directfile/Safari: use the `getStartDate` method in `getWallClockTime` when available to obtain true offseted times when playing HLS contents on Safari [#1055]
28
- - avoid mistakenly relying on pinkie's Promise implementation when a native one is already available [#1058]
29
29
  - DRM: Improve DRM Session caches performance when `singleLicensePer` is set to `"content"`
30
30
  - TypeScript: Add IBitrateEstimate, IPositionUpdate and IPlayerState types to the exported types [#1084]
31
+ - Remove dependency on pinkie's promise ponyfill [#1058, #1090]
31
32
  - tests: add performance tests, to better catch and avoid performance regressions [#1053, #1062]
32
33
  - DRM: Refactor DRM logic for better maintainability. DRM-linked logs are now prefixed by `DRM:` instead of `EME:` like previously [#1042]
33
34
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- 3.27.0-dev.2022031700
1
+ 3.27.0-dev.2022032100
@@ -51,7 +51,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
51
51
  };
52
52
  import log from "../../log";
53
53
  import cancellableSleep from "../../utils/cancellable_sleep";
54
- import PPromise from "../../utils/promise";
55
54
  import TaskCanceller, { CancellationError, } from "../../utils/task_canceller";
56
55
  /**
57
56
  * Close the given `MediaKeySession` and returns a Promise resolving when the
@@ -68,7 +67,7 @@ import TaskCanceller, { CancellationError, } from "../../utils/task_canceller";
68
67
  */
69
68
  export default function closeSession(session) {
70
69
  var timeoutCanceller = new TaskCanceller();
71
- return PPromise.race([
70
+ return Promise.race([
72
71
  session.close()
73
72
  .then(function () { timeoutCanceller.cancel(); }),
74
73
  // The `closed` promise may resolve, even if `close()` result has not
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Copyright 2015 CANAL+ Group
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
1
16
  import { ICustomMediaKeys } from "./custom_media_keys";
2
17
  export interface ICustomMediaKeySystemAccess {
3
18
  readonly keySystem: string;
@@ -1,19 +1,3 @@
1
- /**
2
- * Copyright 2015 CANAL+ Group
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import PPromise from "../../utils/promise";
17
1
  /**
18
2
  * Simple implementation of the MediaKeySystemAccess EME API.
19
3
  *
@@ -50,7 +34,7 @@ var CustomMediaKeySystemAccess = /** @class */ (function () {
50
34
  */
51
35
  CustomMediaKeySystemAccess.prototype.createMediaKeys = function () {
52
36
  var _this = this;
53
- return new PPromise(function (res) { return res(_this._mediaKeys); });
37
+ return new Promise(function (res) { return res(_this._mediaKeys); });
54
38
  };
55
39
  /**
56
40
  * @returns {Object} - Configuration accepted for this MediaKeySystemAccess.
@@ -30,7 +30,6 @@ var __extends = (this && this.__extends) || (function () {
30
30
  })();
31
31
  import { merge as observableMerge, Subject, takeUntil, } from "rxjs";
32
32
  import EventEmitter from "../../../utils/event_emitter";
33
- import PPromise from "../../../utils/promise";
34
33
  import * as events from "../../event_listeners";
35
34
  import { MSMediaKeysConstructor, } from "./ms_media_keys_constructor";
36
35
  var IE11MediaKeySession = /** @class */ (function (_super) {
@@ -41,11 +40,11 @@ var IE11MediaKeySession = /** @class */ (function (_super) {
41
40
  _this.keyStatuses = new Map();
42
41
  _this._mk = mk;
43
42
  _this._closeSession$ = new Subject();
44
- _this.closed = new PPromise(function (resolve) {
43
+ _this.closed = new Promise(function (resolve) {
45
44
  _this._closeSession$.subscribe(resolve);
46
45
  });
47
46
  _this.update = function (license) {
48
- return new PPromise(function (resolve, reject) {
47
+ return new Promise(function (resolve, reject) {
49
48
  if (_this._ss === undefined) {
50
49
  return reject("MediaKeySession not set.");
51
50
  }
@@ -61,7 +60,7 @@ var IE11MediaKeySession = /** @class */ (function (_super) {
61
60
  }
62
61
  IE11MediaKeySession.prototype.generateRequest = function (_initDataType, initData) {
63
62
  var _this = this;
64
- return new PPromise(function (resolve) {
63
+ return new Promise(function (resolve) {
65
64
  var initDataU8 = initData instanceof Uint8Array ? initData :
66
65
  initData instanceof ArrayBuffer ? new Uint8Array(initData) :
67
66
  new Uint8Array(initData.buffer);
@@ -73,7 +72,7 @@ var IE11MediaKeySession = /** @class */ (function (_super) {
73
72
  };
74
73
  IE11MediaKeySession.prototype.close = function () {
75
74
  var _this = this;
76
- return new PPromise(function (resolve) {
75
+ return new Promise(function (resolve) {
77
76
  if (_this._ss != null) {
78
77
  _this._ss.close();
79
78
  _this._ss = undefined;
@@ -84,10 +83,10 @@ var IE11MediaKeySession = /** @class */ (function (_super) {
84
83
  });
85
84
  };
86
85
  IE11MediaKeySession.prototype.load = function () {
87
- return PPromise.resolve(false);
86
+ return Promise.resolve(false);
88
87
  };
89
88
  IE11MediaKeySession.prototype.remove = function () {
90
- return PPromise.resolve();
89
+ return Promise.resolve();
91
90
  };
92
91
  Object.defineProperty(IE11MediaKeySession.prototype, "sessionId", {
93
92
  get: function () {
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import PPromise from "pinkie";
17
16
  import { MediaError } from "../../../errors";
18
17
  import assert from "../../../utils/assert";
19
18
  import { isIE11 } from "../../browser_detection";
@@ -126,7 +125,7 @@ else {
126
125
  }
127
126
  requestMediaKeySystemAccess = function (keyType, keySystemConfigurations) {
128
127
  if (!isTypeSupported_1(keyType)) {
129
- return PPromise.reject(new Error("Unsupported key type"));
128
+ return Promise.reject(new Error("Unsupported key type"));
130
129
  }
131
130
  for (var i = 0; i < keySystemConfigurations.length; i++) {
132
131
  var keySystemConfiguration = keySystemConfigurations[i];
@@ -151,10 +150,10 @@ else {
151
150
  }
152
151
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
153
152
  var customMediaKeys = createCustomMediaKeys_1(keyType);
154
- return PPromise.resolve(new CustomMediaKeySystemAccess(keyType, customMediaKeys, keySystemConfigurationResponse));
153
+ return Promise.resolve(new CustomMediaKeySystemAccess(keyType, customMediaKeys, keySystemConfigurationResponse));
155
154
  }
156
155
  }
157
- return PPromise.reject(new Error("Unsupported configuration"));
156
+ return Promise.reject(new Error("Unsupported configuration"));
158
157
  };
159
158
  }
160
159
  export { requestMediaKeySystemAccess, setMediaKeys, };
@@ -31,7 +31,6 @@ var __extends = (this && this.__extends) || (function () {
31
31
  import { base64ToBytes } from "../../../utils/base64";
32
32
  import EventEmitter from "../../../utils/event_emitter";
33
33
  import noop from "../../../utils/noop";
34
- import PPromise from "../../../utils/promise";
35
34
  import { utf8ToStr } from "../../../utils/string_parsing";
36
35
  /**
37
36
  * Returns true if the given media element has old webkit methods
@@ -57,7 +56,7 @@ var OldWebkitMediaKeySession = /** @class */ (function (_super) {
57
56
  _this._key = keySystem;
58
57
  _this.sessionId = "";
59
58
  _this._closeSession = noop; // Just here to make TypeScript happy
60
- _this.closed = new PPromise(function (resolve) {
59
+ _this.closed = new Promise(function (resolve) {
61
60
  _this._closeSession = resolve;
62
61
  });
63
62
  _this.keyStatuses = new Map();
@@ -71,7 +70,7 @@ var OldWebkitMediaKeySession = /** @class */ (function (_super) {
71
70
  }
72
71
  OldWebkitMediaKeySession.prototype.update = function (license) {
73
72
  var _this = this;
74
- return new PPromise(function (resolve, reject) {
73
+ return new Promise(function (resolve, reject) {
75
74
  try {
76
75
  if (_this._key.indexOf("clearkey") >= 0) {
77
76
  var licenseTypedArray = license instanceof ArrayBuffer ? new Uint8Array(license) :
@@ -98,14 +97,14 @@ var OldWebkitMediaKeySession = /** @class */ (function (_super) {
98
97
  };
99
98
  OldWebkitMediaKeySession.prototype.generateRequest = function (_initDataType, initData) {
100
99
  var _this = this;
101
- return new PPromise(function (resolve) {
100
+ return new Promise(function (resolve) {
102
101
  _this._vid.webkitGenerateKeyRequest(_this._key, initData);
103
102
  resolve();
104
103
  });
105
104
  };
106
105
  OldWebkitMediaKeySession.prototype.close = function () {
107
106
  var _this = this;
108
- return new PPromise(function (resolve) {
107
+ return new Promise(function (resolve) {
109
108
  _this._unbindSession();
110
109
  _this._closeSession();
111
110
  resolve();
@@ -118,10 +117,10 @@ var OldWebkitMediaKeySession = /** @class */ (function (_super) {
118
117
  */
119
118
  OldWebkitMediaKeySession.prototype.load = function () {
120
119
  // Not implemented. Always return false as in "no session with that id".
121
- return PPromise.resolve(false);
120
+ return Promise.resolve(false);
122
121
  };
123
122
  OldWebkitMediaKeySession.prototype.remove = function () {
124
- return PPromise.resolve();
123
+ return Promise.resolve();
125
124
  };
126
125
  OldWebkitMediaKeySession.prototype._unbindSession = function () {
127
126
  var _this = this;
@@ -30,7 +30,6 @@ var __extends = (this && this.__extends) || (function () {
30
30
  })();
31
31
  import EventEmitter from "../../../utils/event_emitter";
32
32
  import noop from "../../../utils/noop";
33
- import PPromise from "../../../utils/promise";
34
33
  import getWebKitFairplayInitData from "../get_webkit_fairplay_initdata";
35
34
  import { WebKitMediaKeysConstructor, } from "./webkit_media_keys_constructor";
36
35
  /**
@@ -77,7 +76,7 @@ var WebkitMediaKeySession = /** @class */ (function (_super) {
77
76
  _this._keyType = keyType;
78
77
  _this._unbindSession = noop;
79
78
  _this._closeSession = noop; // Just here to make TypeScript happy
80
- _this.closed = new PPromise(function (resolve) {
79
+ _this.closed = new Promise(function (resolve) {
81
80
  _this._closeSession = resolve;
82
81
  });
83
82
  _this.keyStatuses = new Map();
@@ -89,7 +88,7 @@ var WebkitMediaKeySession = /** @class */ (function (_super) {
89
88
  }
90
89
  WebkitMediaKeySession.prototype.update = function (license) {
91
90
  var _this = this;
92
- return new PPromise(function (resolve, reject) {
91
+ return new Promise(function (resolve, reject) {
93
92
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
94
93
  if (_this._nativeSession === undefined ||
95
94
  _this._nativeSession.update === undefined ||
@@ -110,7 +109,7 @@ var WebkitMediaKeySession = /** @class */ (function (_super) {
110
109
  };
111
110
  WebkitMediaKeySession.prototype.generateRequest = function (_initDataType, initData) {
112
111
  var _this = this;
113
- return new PPromise(function (resolve) {
112
+ return new Promise(function (resolve) {
114
113
  var _a;
115
114
  var elt = _this._videoElement;
116
115
  if (((_a = elt.webkitKeys) === null || _a === void 0 ? void 0 : _a.createSession) === undefined) {
@@ -138,7 +137,7 @@ var WebkitMediaKeySession = /** @class */ (function (_super) {
138
137
  };
139
138
  WebkitMediaKeySession.prototype.close = function () {
140
139
  var _this = this;
141
- return new PPromise(function (resolve, reject) {
140
+ return new Promise(function (resolve, reject) {
142
141
  _this._unbindSession();
143
142
  _this._closeSession();
144
143
  if (_this._nativeSession === undefined) {
@@ -152,10 +151,10 @@ var WebkitMediaKeySession = /** @class */ (function (_super) {
152
151
  });
153
152
  };
154
153
  WebkitMediaKeySession.prototype.load = function () {
155
- return PPromise.resolve(false);
154
+ return Promise.resolve(false);
156
155
  };
157
156
  WebkitMediaKeySession.prototype.remove = function () {
158
- return PPromise.resolve();
157
+ return Promise.resolve();
159
158
  };
160
159
  Object.defineProperty(WebkitMediaKeySession.prototype, "sessionId", {
161
160
  get: function () {
@@ -211,7 +210,7 @@ var WebKitCustomMediaKeys = /** @class */ (function () {
211
210
  };
212
211
  WebKitCustomMediaKeys.prototype.setServerCertificate = function (serverCertificate) {
213
212
  this._serverCertificate = serverCertificate;
214
- return PPromise.resolve();
213
+ return Promise.resolve();
215
214
  };
216
215
  return WebKitCustomMediaKeys;
217
216
  }());
@@ -49,7 +49,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
49
49
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
50
  }
51
51
  };
52
- import PPromise from "pinkie";
53
52
  import log from "../../log";
54
53
  var EME_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES = 100;
55
54
  /**
@@ -83,7 +82,7 @@ export default function loadSession(session, sessionId) {
83
82
  // Chromium/Chrome versions where the `keyStatuses` property from a loaded
84
83
  // MediaKeySession would not be populated directly as the load answer but
85
84
  // asynchronously after.
86
- return [2 /*return*/, new PPromise(function (resolve) {
85
+ return [2 /*return*/, new Promise(function (resolve) {
87
86
  session.addEventListener("keystatuseschange", resolveWithLoadedStatus);
88
87
  var timeout = setTimeout(resolveWithLoadedStatus, EME_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES);
89
88
  function resolveWithLoadedStatus() {
@@ -16,6 +16,7 @@
16
16
  import { IRepresentationFilter } from "../../manifest";
17
17
  import { ICustomManifestLoader, ICustomSegmentLoader, ILoadedManifestFormat, ITransportOptions as IParsedTransportOptions } from "../../transports";
18
18
  import { IKeySystemOption } from "../decrypt";
19
+ import { IAudioTrackSwitchingMode } from "../stream";
19
20
  import { IAudioTrackPreference, ITextTrackPreference, IVideoTrackPreference } from "./track_choice_manager";
20
21
  export { IKeySystemOption };
21
22
  /** Value of the `serverSyncInfos` transport option. */
@@ -206,7 +207,7 @@ export interface ILoadVideoOptions {
206
207
  textTrackElement?: HTMLElement;
207
208
  manualBitrateSwitchingMode?: "seamless" | "direct";
208
209
  enableFastSwitching?: boolean;
209
- audioTrackSwitchingMode?: "seamless" | "direct";
210
+ audioTrackSwitchingMode?: IAudioTrackSwitchingMode;
210
211
  onCodecSwitch?: "continue" | "reload";
211
212
  supplementaryTextTracks?: ISupplementaryTextTrackOption[];
212
213
  supplementaryImageTracks?: ISupplementaryImageTrackOption[];
@@ -232,7 +233,7 @@ interface IParsedLoadVideoOptionsBase {
232
233
  startAt: IParsedStartAtOption | undefined;
233
234
  manualBitrateSwitchingMode: "seamless" | "direct";
234
235
  enableFastSwitching: boolean;
235
- audioTrackSwitchingMode: "seamless" | "direct";
236
+ audioTrackSwitchingMode: IAudioTrackSwitchingMode;
236
237
  onCodecSwitch: "continue" | "reload";
237
238
  }
238
239
  /**
@@ -326,11 +326,12 @@ function parseLoadVideoOptions(options) {
326
326
  var audioTrackSwitchingMode = isNullOrUndefined(options.audioTrackSwitchingMode)
327
327
  ? DEFAULT_AUDIO_TRACK_SWITCHING_MODE
328
328
  : options.audioTrackSwitchingMode;
329
- if (!arrayIncludes(["seamless", "direct"], audioTrackSwitchingMode)) {
329
+ if (!arrayIncludes(["seamless", "direct", "reload"], audioTrackSwitchingMode)) {
330
330
  log.warn("The `audioTrackSwitchingMode` loadVideo option must match one of " +
331
331
  "the following strategy name:\n" +
332
332
  "- `seamless`\n" +
333
333
  "- `direct`\n" +
334
+ "- `reload`\n" +
334
335
  "If badly set, " + DEFAULT_AUDIO_TRACK_SWITCHING_MODE +
335
336
  " strategy will be used as default");
336
337
  audioTrackSwitchingMode = DEFAULT_AUDIO_TRACK_SWITCHING_MODE;
@@ -56,7 +56,6 @@ import areArraysOfNumbersEqual from "../../utils/are_arrays_of_numbers_equal";
56
56
  import EventEmitter, { fromEvent, } from "../../utils/event_emitter";
57
57
  import isNullOrUndefined from "../../utils/is_null_or_undefined";
58
58
  import objectAssign from "../../utils/object_assign";
59
- import PPromise from "../../utils/promise";
60
59
  import { getLeftSizeOfRange, getPlayedSizeOfRange, getSizeOfRange, } from "../../utils/ranges";
61
60
  import createSharedReference from "../../utils/reference";
62
61
  import warnOnce from "../../utils/warn_once";
@@ -88,7 +87,7 @@ var Player = /** @class */ (function (_super) {
88
87
  // Workaround to support Firefox autoplay on FF 42.
89
88
  // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
90
89
  videoElement.preload = "auto";
91
- _this.version = /* PLAYER_VERSION */ "3.27.0-dev.2022031700";
90
+ _this.version = /* PLAYER_VERSION */ "3.27.0-dev.2022032100";
92
91
  _this.log = log;
93
92
  _this.state = "STOPPED";
94
93
  _this.videoElement = videoElement;
@@ -1045,7 +1044,7 @@ var Player = /** @class */ (function (_super) {
1045
1044
  /* eslint-disable @typescript-eslint/unbound-method */
1046
1045
  if (isNullOrUndefined(playPromise) || typeof playPromise.catch !== "function") {
1047
1046
  /* eslint-enable @typescript-eslint/unbound-method */
1048
- return PPromise.resolve();
1047
+ return Promise.resolve();
1049
1048
  }
1050
1049
  return playPromise.catch(function (error) {
1051
1050
  if (error.name === "NotAllowedError") {
@@ -2303,5 +2302,5 @@ var Player = /** @class */ (function (_super) {
2303
2302
  };
2304
2303
  return Player;
2305
2304
  }(EventEmitter));
2306
- Player.version = /* PLAYER_VERSION */ "3.27.0-dev.2022031700";
2305
+ Player.version = /* PLAYER_VERSION */ "3.27.0-dev.2022032100";
2307
2306
  export default Player;
@@ -51,7 +51,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
51
51
  };
52
52
  import { setMediaKeys, } from "../../compat";
53
53
  import log from "../../log";
54
- import PPromise from "../../utils/promise";
55
54
  import MediaKeysInfosStore from "./utils/media_keys_infos_store";
56
55
  /**
57
56
  * Dispose of the MediaKeys instance attached to the given media element, if
@@ -81,7 +80,7 @@ export default function attachMediaKeys(mediaElement, _a, cancelSignal) {
81
80
  closeAllSessions = previousState !== null &&
82
81
  previousState.loadedSessionsStore !== loadedSessionsStore ?
83
82
  previousState.loadedSessionsStore.closeAllSessions() :
84
- PPromise.resolve();
83
+ Promise.resolve();
85
84
  return [4 /*yield*/, closeAllSessions];
86
85
  case 1:
87
86
  _b.sent();
@@ -15,7 +15,6 @@
15
15
  */
16
16
  import { shouldUnsetMediaKeys } from "../../compat/";
17
17
  import log from "../../log";
18
- import PPromise from "../../utils/promise";
19
18
  import disposeDecryptionResources from "./dispose_decryption_resources";
20
19
  import MediaKeysInfosStore from "./utils/media_keys_infos_store";
21
20
  /**
@@ -37,5 +36,5 @@ export default function clearOnStop(mediaElement) {
37
36
  return currentState.loadedSessionsStore.closeAllSessions();
38
37
  }
39
38
  log.info("DRM: Nothing to clear. Returning right away. No state =", currentState === null);
40
- return PPromise.resolve();
39
+ return Promise.resolve();
41
40
  }
@@ -84,7 +84,6 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
84
84
  }
85
85
  return to.concat(ar || Array.prototype.slice.call(from));
86
86
  };
87
- import PPromise from "pinkie";
88
87
  import { events, generateKeyRequest, getInitData, } from "../../compat/";
89
88
  import config from "../../config";
90
89
  import { EncryptedMediaError, OtherError, } from "../../errors";
@@ -495,7 +494,7 @@ var ContentDecryptor = /** @class */ (function (_super) {
495
494
  error_1 = _e.sent();
496
495
  throw new EncryptedMediaError("KEY_GENERATE_REQUEST_ERROR", error_1 instanceof Error ? error_1.toString() :
497
496
  "Unknown error");
498
- case 5: return [2 /*return*/, PPromise.resolve()];
497
+ case 5: return [2 /*return*/, Promise.resolve()];
499
498
  }
500
499
  });
501
500
  });
@@ -49,7 +49,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
49
49
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
50
  }
51
51
  };
52
- import PPromise from "pinkie";
53
52
  import { loadSession, } from "../../compat";
54
53
  import log from "../../log";
55
54
  import isSessionUsable from "./utils/is_session_usable";
@@ -90,7 +89,7 @@ export default function createSession(stores, initData, wantedSessionType) {
90
89
  function createTemporarySession(loadedSessionsStore, initData) {
91
90
  log.info("DRM: Creating a new temporary session");
92
91
  var entry = loadedSessionsStore.createSession(initData, "temporary");
93
- return PPromise.resolve({ type: "created-session" /* Created */,
92
+ return Promise.resolve({ type: "created-session" /* Created */,
94
93
  value: entry });
95
94
  }
96
95
  /**
@@ -55,7 +55,6 @@ import { EncryptedMediaError } from "../../errors";
55
55
  import log from "../../log";
56
56
  import arrayIncludes from "../../utils/array_includes";
57
57
  import flatMap from "../../utils/flat_map";
58
- import PPromise from "../../utils/promise";
59
58
  import MediaKeysInfosStore from "./utils/media_keys_infos_store";
60
59
  /**
61
60
  * @param {Array.<Object>} keySystems
@@ -213,7 +212,7 @@ export default function getMediaKeySystemAccess(mediaElement, keySystemsConfigs,
213
212
  var cachedKeySystemAccess = checkCachedMediaKeySystemAccess(keySystemsConfigs, currentState.mediaKeySystemAccess, currentState.keySystemOptions);
214
213
  if (cachedKeySystemAccess !== null) {
215
214
  log.info("DRM: Found cached compatible keySystem");
216
- return PPromise.resolve({
215
+ return Promise.resolve({
217
216
  type: "reuse-media-key-system-access",
218
217
  value: { mediaKeySystemAccess: cachedKeySystemAccess.keySystemAccess,
219
218
  options: cachedKeySystemAccess.keySystemOptions },
@@ -49,7 +49,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
49
49
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
50
  }
51
51
  };
52
- import PPromise from "../../../utils/promise";
53
52
  /**
54
53
  * Close sessions from the loadedSessionsStore to allow at maximum `limit`
55
54
  * stored MediaKeySessions in it.
@@ -75,7 +74,7 @@ export default function cleanOldLoadedSessions(loadedSessionsStore, limit) {
75
74
  entry = entries[i];
76
75
  proms.push(loadedSessionsStore.closeSession(entry.mediaKeySession));
77
76
  }
78
- return [4 /*yield*/, PPromise.all(proms)];
77
+ return [4 /*yield*/, Promise.all(proms)];
79
78
  case 1:
80
79
  _a.sent();
81
80
  return [2 /*return*/];
@@ -49,7 +49,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
49
49
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
50
  }
51
51
  };
52
- import PPromise from "pinkie";
53
52
  import { closeSession, } from "../../../compat";
54
53
  import { onKeyMessage$, onKeyStatusesChange$, } from "../../../compat/event_listeners";
55
54
  import config from "../../../config";
@@ -151,12 +150,12 @@ var LoadedSessionsStore = /** @class */ (function () {
151
150
  if (entry === undefined) {
152
151
  log.warn("DRM-LSS: No MediaKeySession found with " +
153
152
  "the given initData and initDataType");
154
- return [2 /*return*/, PPromise.resolve(false)];
153
+ return [2 /*return*/, Promise.resolve(false)];
155
154
  }
156
155
  return [4 /*yield*/, safelyCloseMediaKeySession(entry.mediaKeySession)];
157
156
  case 1:
158
157
  _b.sent();
159
- return [2 /*return*/, PPromise.resolve(true)];
158
+ return [2 /*return*/, Promise.resolve(true)];
160
159
  }
161
160
  });
162
161
  });
@@ -195,7 +194,7 @@ var LoadedSessionsStore = /** @class */ (function () {
195
194
  this._storage = [];
196
195
  closingProms = allEntries
197
196
  .map(function (entry) { return safelyCloseMediaKeySession(entry.mediaKeySession); });
198
- return [4 /*yield*/, PPromise.all(closingProms)];
197
+ return [4 /*yield*/, Promise.all(closingProms)];
199
198
  case 1:
200
199
  _a.sent();
201
200
  return [2 /*return*/];
@@ -276,7 +275,7 @@ function safelyCloseMediaKeySession(mediaKeySession) {
276
275
  sleepProm = new Promise(function (res) {
277
276
  sleepTimer_1 = window.setTimeout(res, delay_1);
278
277
  });
279
- return [4 /*yield*/, PPromise.race([ksChangeProm, ksMsgProm, sleepProm])];
278
+ return [4 /*yield*/, Promise.race([ksChangeProm, ksMsgProm, sleepProm])];
280
279
  case 4:
281
280
  _b.sent();
282
281
  ksChangeSub_1 === null || ksChangeSub_1 === void 0 ? void 0 : ksChangeSub_1.unsubscribe();
@@ -298,6 +297,6 @@ function safelyCloseMediaKeySession(mediaKeySession) {
298
297
  log.error("DRM: Could not close MediaKeySession: " +
299
298
  (err instanceof Error ? err.toString() :
300
299
  "Unknown error"));
301
- return PPromise.resolve(null);
300
+ return Promise.resolve(null);
302
301
  }
303
302
  }
@@ -54,7 +54,6 @@ import config from "../../../config";
54
54
  import { formatError, } from "../../../errors";
55
55
  import log from "../../../log";
56
56
  import assert from "../../../utils/assert";
57
- import PPromise from "../../../utils/promise";
58
57
  import TaskCanceller from "../../../utils/task_canceller";
59
58
  import errorSelector from "../utils/error_selector";
60
59
  import { tryRequestPromiseWithBackoff, } from "../utils/try_urls_with_backoff";
@@ -337,6 +336,5 @@ export default ManifestFetcher;
337
336
  * @returns {boolean}
338
337
  */
339
338
  function isPromise(val) {
340
- return val instanceof PPromise ||
341
- val instanceof Promise;
339
+ return val instanceof Promise;
342
340
  }
@@ -54,7 +54,6 @@ import { CustomLoaderError, isKnownError, NetworkErrorTypes, RequestError, } fro
54
54
  import log from "../../../log";
55
55
  import cancellableSleep from "../../../utils/cancellable_sleep";
56
56
  import getFuzzedDelay from "../../../utils/get_fuzzed_delay";
57
- import PPromise from "../../../utils/promise";
58
57
  import TaskCanceller from "../../../utils/task_canceller";
59
58
  /**
60
59
  * Called on a loader error.
@@ -159,7 +158,7 @@ function getRequestErrorType(error) {
159
158
  */
160
159
  export function tryURLsWithBackoff(urls, performRequest, options, cancellationSignal) {
161
160
  if (cancellationSignal.isCancelled) {
162
- return PPromise.reject(cancellationSignal.cancellationError);
161
+ return Promise.reject(cancellationSignal.cancellationError);
163
162
  }
164
163
  var baseDelay = options.baseDelay, maxDelay = options.maxDelay, maxRetryRegular = options.maxRetryRegular, maxRetryOffline = options.maxRetryOffline, onRetry = options.onRetry;
165
164
  var retryCount = 0;
@@ -167,7 +166,7 @@ export function tryURLsWithBackoff(urls, performRequest, options, cancellationSi
167
166
  var urlsToTry = urls.slice();
168
167
  if (urlsToTry.length === 0) {
169
168
  log.warn("Fetchers: no URL given to `tryURLsWithBackoff`.");
170
- return PPromise.reject(new Error("No URL to request"));
169
+ return Promise.reject(new Error("No URL to request"));
171
170
  }
172
171
  return tryURLsRecursively(urlsToTry[0], 0);
173
172
  /**
@@ -20,6 +20,7 @@ import { PlaybackObserver } from "../api";
20
20
  import { IKeySystemOption } from "../decrypt";
21
21
  import { IManifestFetcherParsedResult, IManifestFetcherWarningEvent, ManifestFetcher, SegmentFetcherCreator } from "../fetchers";
22
22
  import { ITextTrackSegmentBufferOptions } from "../segment_buffers";
23
+ import { IAudioTrackSwitchingMode } from "../stream";
23
24
  import { IInitialTimeOptions } from "./get_initial_time";
24
25
  import { IInitEvent } from "./types";
25
26
  /** Arguments to give to the `InitializeOnMediaSource` function. */
@@ -46,7 +47,7 @@ export interface IInitializeArguments {
46
47
  */
47
48
  enableFastSwitching: boolean;
48
49
  /** Strategy when switching of audio track. */
49
- audioTrackSwitchingMode: "seamless" | "direct";
50
+ audioTrackSwitchingMode: IAudioTrackSwitchingMode;
50
51
  /** Behavior when a new video and/or audio codec is encountered. */
51
52
  onCodecSwitch: "continue" | "reload";
52
53
  };
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import StreamOrchestrator, { IStreamOrchestratorOptions, IStreamOrchestratorPlaybackObservation } from "./orchestrator";
17
+ export { IAudioTrackSwitchingMode } from "./period";
17
18
  export * from "./types";
18
19
  export default StreamOrchestrator;
19
20
  export { IStreamOrchestratorPlaybackObservation, IStreamOrchestratorOptions, };