rx-player 4.3.0-dev.2024112900 → 4.3.0-dev.2025011000
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/CHANGELOG.md +24 -8
- package/VERSION +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.d.ts +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/commonjs/compat/browser_compatibility_types.d.ts +7 -2
- package/dist/commonjs/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/commonjs/compat/browser_compatibility_types.js +0 -1
- package/dist/commonjs/compat/browser_detection.js +1 -1
- package/dist/commonjs/compat/event_listeners.d.ts.map +1 -1
- package/dist/commonjs/compat/event_listeners.js +2 -4
- package/dist/commonjs/compat/has_mse_in_worker.d.ts.map +1 -1
- package/dist/commonjs/core/cmcd/cmcd_data_builder.d.ts.map +1 -1
- package/dist/commonjs/core/cmcd/cmcd_data_builder.js +1 -2
- package/dist/commonjs/core/main/worker/send_message.d.ts.map +1 -1
- package/dist/commonjs/core/main/worker/send_message.js +0 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +4 -8
- package/dist/commonjs/core/stream/period/period_stream.js +1 -3
- package/dist/commonjs/core/stream/period/utils/get_adaptation_switch_strategy.js +1 -2
- package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/api/index.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/public_api.js +4 -4
- package/dist/commonjs/main_thread/decrypt/clear_on_stop.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/clear_on_stop.js +60 -14
- package/dist/commonjs/main_thread/decrypt/content_decryptor.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/content_decryptor.js +21 -9
- package/dist/commonjs/main_thread/decrypt/dispose_decryption_resources.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/dispose_decryption_resources.js +2 -18
- package/dist/commonjs/main_thread/decrypt/find_key_system.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/find_key_system.js +134 -68
- package/dist/commonjs/main_thread/decrypt/get_key_system_configuration.js +2 -2
- package/dist/commonjs/main_thread/decrypt/get_media_keys.js +5 -3
- package/dist/commonjs/main_thread/decrypt/init_media_keys.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/init_media_keys.js +2 -2
- package/dist/{es2017/main_thread/decrypt/utils/media_keys_infos_store.d.ts → commonjs/main_thread/decrypt/utils/media_keys_attacher.d.ts} +31 -9
- package/dist/commonjs/main_thread/decrypt/utils/media_keys_attacher.d.ts.map +1 -0
- package/dist/commonjs/main_thread/decrypt/utils/media_keys_attacher.js +282 -0
- package/dist/commonjs/main_thread/init/utils/rebuffering_controller.js +1 -1
- package/dist/commonjs/main_thread/text_displayer/html/text_track_cues_store.js +1 -1
- package/dist/commonjs/main_thread/tracks_store/track_dispatcher.d.ts.map +1 -1
- package/dist/commonjs/main_thread/tracks_store/track_dispatcher.js +3 -4
- package/dist/commonjs/main_thread/tracks_store/tracks_store.d.ts.map +1 -1
- package/dist/commonjs/main_thread/tracks_store/tracks_store.js +1 -1
- package/dist/commonjs/manifest/classes/representation.d.ts +15 -1
- package/dist/commonjs/manifest/classes/representation.d.ts.map +1 -1
- package/dist/commonjs/manifest/classes/representation.js +17 -0
- package/dist/commonjs/manifest/utils.d.ts +15 -0
- package/dist/commonjs/manifest/utils.d.ts.map +1 -1
- package/dist/commonjs/manifest/utils.js +28 -5
- package/dist/commonjs/parsers/manifest/dash/common/parse_representations.js +2 -2
- package/dist/commonjs/playback_observer/media_element_playback_observer.js +1 -1
- package/dist/commonjs/public_types.d.ts +44 -0
- package/dist/commonjs/public_types.d.ts.map +1 -1
- package/dist/commonjs/utils/flat_map.d.ts +2 -2
- package/dist/commonjs/utils/flat_map.js +2 -2
- package/dist/commonjs/utils/url-utils.d.ts.map +1 -1
- package/dist/commonjs/utils/url-utils.js +11 -10
- package/dist/commonjs/utils/xml-parser.d.ts.map +1 -1
- package/dist/commonjs/utils/xml-parser.js +10 -8
- package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.d.ts +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/es2017/compat/browser_compatibility_types.d.ts +7 -2
- package/dist/es2017/compat/browser_compatibility_types.d.ts.map +1 -1
- package/dist/es2017/compat/browser_compatibility_types.js +0 -1
- package/dist/es2017/compat/browser_detection.js +1 -1
- package/dist/es2017/compat/event_listeners.d.ts.map +1 -1
- package/dist/es2017/compat/event_listeners.js +2 -4
- package/dist/es2017/compat/has_mse_in_worker.d.ts.map +1 -1
- package/dist/es2017/core/cmcd/cmcd_data_builder.d.ts.map +1 -1
- package/dist/es2017/core/cmcd/cmcd_data_builder.js +1 -2
- package/dist/es2017/core/main/worker/send_message.d.ts.map +1 -1
- package/dist/es2017/core/main/worker/send_message.js +0 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.js +4 -6
- package/dist/es2017/core/stream/period/period_stream.js +1 -3
- package/dist/es2017/core/stream/period/utils/get_adaptation_switch_strategy.js +1 -2
- package/dist/es2017/experimental/tools/mediaCapabilitiesProber/api/index.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/public_api.js +4 -4
- package/dist/es2017/main_thread/decrypt/clear_on_stop.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/clear_on_stop.js +3 -3
- package/dist/es2017/main_thread/decrypt/content_decryptor.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/content_decryptor.js +21 -9
- package/dist/es2017/main_thread/decrypt/dispose_decryption_resources.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/dispose_decryption_resources.js +2 -12
- package/dist/es2017/main_thread/decrypt/find_key_system.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/find_key_system.js +102 -56
- package/dist/es2017/main_thread/decrypt/get_key_system_configuration.js +2 -2
- package/dist/es2017/main_thread/decrypt/get_media_keys.js +2 -2
- package/dist/es2017/main_thread/decrypt/init_media_keys.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/init_media_keys.js +2 -2
- package/dist/{commonjs/main_thread/decrypt/utils/media_keys_infos_store.d.ts → es2017/main_thread/decrypt/utils/media_keys_attacher.d.ts} +31 -9
- package/dist/es2017/main_thread/decrypt/utils/media_keys_attacher.d.ts.map +1 -0
- package/dist/es2017/main_thread/decrypt/utils/media_keys_attacher.js +180 -0
- package/dist/es2017/main_thread/init/utils/rebuffering_controller.js +1 -1
- package/dist/es2017/main_thread/text_displayer/html/text_track_cues_store.js +1 -1
- package/dist/es2017/main_thread/tracks_store/track_dispatcher.d.ts.map +1 -1
- package/dist/es2017/main_thread/tracks_store/track_dispatcher.js +3 -4
- package/dist/es2017/main_thread/tracks_store/tracks_store.d.ts.map +1 -1
- package/dist/es2017/main_thread/tracks_store/tracks_store.js +2 -2
- package/dist/es2017/manifest/classes/representation.d.ts +15 -1
- package/dist/es2017/manifest/classes/representation.d.ts.map +1 -1
- package/dist/es2017/manifest/classes/representation.js +17 -0
- package/dist/es2017/manifest/utils.d.ts +15 -0
- package/dist/es2017/manifest/utils.d.ts.map +1 -1
- package/dist/es2017/manifest/utils.js +27 -5
- package/dist/es2017/parsers/manifest/dash/common/parse_representations.js +2 -2
- package/dist/es2017/playback_observer/media_element_playback_observer.js +1 -1
- package/dist/es2017/public_types.d.ts +44 -0
- package/dist/es2017/public_types.d.ts.map +1 -1
- package/dist/es2017/utils/flat_map.d.ts +2 -2
- package/dist/es2017/utils/flat_map.js +2 -2
- package/dist/es2017/utils/url-utils.d.ts.map +1 -1
- package/dist/es2017/utils/url-utils.js +11 -10
- package/dist/es2017/utils/xml-parser.d.ts.map +1 -1
- package/dist/es2017/utils/xml-parser.js +10 -8
- package/dist/rx-player.js +494 -364
- package/dist/rx-player.min.js +18 -18
- package/dist/worker.js +6 -6
- package/package.json +21 -19
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/compat/browser_compatibility_types.ts +22 -4
- package/src/compat/browser_detection.ts +1 -1
- package/src/compat/event_listeners.ts +2 -4
- package/src/compat/has_mse_in_worker.ts +1 -1
- package/src/core/cmcd/cmcd_data_builder.ts +1 -4
- package/src/core/main/worker/send_message.ts +4 -2
- package/src/core/stream/adaptation/adaptation_stream.ts +4 -7
- package/src/core/stream/period/period_stream.ts +3 -3
- package/src/core/stream/period/utils/get_adaptation_switch_strategy.ts +1 -2
- package/src/main_thread/api/public_api.ts +4 -4
- package/src/main_thread/decrypt/__tests__/__global__/media_key_system_access.test.ts +239 -6
- package/src/main_thread/decrypt/__tests__/find_key_system.test.ts +325 -0
- package/src/main_thread/decrypt/clear_on_stop.ts +3 -3
- package/src/main_thread/decrypt/content_decryptor.ts +26 -8
- package/src/main_thread/decrypt/dispose_decryption_resources.ts +2 -13
- package/src/main_thread/decrypt/find_key_system.ts +120 -81
- package/src/main_thread/decrypt/get_key_system_configuration.ts +2 -2
- package/src/main_thread/decrypt/get_media_keys.ts +2 -2
- package/src/main_thread/decrypt/init_media_keys.ts +2 -2
- package/src/main_thread/decrypt/utils/media_keys_attacher.ts +284 -0
- package/src/main_thread/init/utils/rebuffering_controller.ts +1 -1
- package/src/main_thread/text_displayer/html/text_track_cues_store.ts +1 -1
- package/src/main_thread/tracks_store/track_dispatcher.ts +3 -6
- package/src/main_thread/tracks_store/tracks_store.ts +2 -1
- package/src/manifest/classes/representation.ts +18 -1
- package/src/manifest/utils.ts +30 -9
- package/src/parsers/manifest/dash/common/parse_representations.ts +2 -2
- package/src/playback_observer/media_element_playback_observer.ts +1 -1
- package/src/public_types.ts +45 -0
- package/src/utils/__tests__/flat_map.test.ts +7 -20
- package/src/utils/flat_map.ts +2 -2
- package/src/utils/url-utils.ts +11 -10
- package/src/utils/xml-parser.ts +13 -8
- package/vitest.config.mjs +9 -4
- package/dist/commonjs/main_thread/decrypt/attach_media_keys.d.ts +0 -60
- package/dist/commonjs/main_thread/decrypt/attach_media_keys.d.ts.map +0 -1
- package/dist/commonjs/main_thread/decrypt/attach_media_keys.js +0 -124
- package/dist/commonjs/main_thread/decrypt/utils/media_keys_infos_store.d.ts.map +0 -1
- package/dist/commonjs/main_thread/decrypt/utils/media_keys_infos_store.js +0 -45
- package/dist/es2017/main_thread/decrypt/attach_media_keys.d.ts +0 -60
- package/dist/es2017/main_thread/decrypt/attach_media_keys.d.ts.map +0 -1
- package/dist/es2017/main_thread/decrypt/attach_media_keys.js +0 -73
- package/dist/es2017/main_thread/decrypt/utils/media_keys_infos_store.d.ts.map +0 -1
- package/dist/es2017/main_thread/decrypt/utils/media_keys_infos_store.js +0 -43
- package/src/main_thread/decrypt/attach_media_keys.ts +0 -125
- package/src/main_thread/decrypt/utils/media_keys_infos_store.ts +0 -88
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2015 CANAL+ Group
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
var set_media_keys_1 = require("../../../compat/eme/set_media_keys");
|
|
55
|
+
var errors_1 = require("../../../errors");
|
|
56
|
+
var log_1 = require("../../../log");
|
|
57
|
+
var is_null_or_undefined_1 = require("../../../utils/is_null_or_undefined");
|
|
58
|
+
// Store the MediaKeys infos attached to a media element.
|
|
59
|
+
var currentMediaState = new WeakMap();
|
|
60
|
+
exports.default = {
|
|
61
|
+
/**
|
|
62
|
+
* Attach new MediaKeys infos set on a HMTLMediaElement.
|
|
63
|
+
* @param {HTMLMediaElement} mediaElement
|
|
64
|
+
* @param {Object} mediaKeysInfo
|
|
65
|
+
* @returns {Promise}
|
|
66
|
+
*/
|
|
67
|
+
attach: function (mediaElement, mediaKeysInfo) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
+
var previousState, pendingTask;
|
|
70
|
+
return __generator(this, function (_a) {
|
|
71
|
+
previousState = currentMediaState.get(mediaElement);
|
|
72
|
+
pendingTask = attachMediaKeys(mediaElement, previousState, mediaKeysInfo).then(function () {
|
|
73
|
+
currentMediaState.set(mediaElement, {
|
|
74
|
+
pendingTask: null,
|
|
75
|
+
mediaKeysState: mediaKeysInfo,
|
|
76
|
+
});
|
|
77
|
+
}, function () {
|
|
78
|
+
currentMediaState.set(mediaElement, {
|
|
79
|
+
pendingTask: null,
|
|
80
|
+
mediaKeysState: null,
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
currentMediaState.set(mediaElement, {
|
|
84
|
+
pendingTask: pendingTask,
|
|
85
|
+
mediaKeysState: mediaKeysInfo,
|
|
86
|
+
});
|
|
87
|
+
return [2 /*return*/, pendingTask];
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* Get MediaKeys information expected to be linked to the given
|
|
93
|
+
* `HTMLMediaElement`.
|
|
94
|
+
*
|
|
95
|
+
* Unlike `getAttachedMediaKeysState`, this method is synchronous and will
|
|
96
|
+
* also return the expected state when `MediaKeys` attachment is still
|
|
97
|
+
* pending and thus when that state is not truly applied (and where it
|
|
98
|
+
* might fail before being applied).
|
|
99
|
+
*
|
|
100
|
+
* As such, only call this method if you want the currently expected state,
|
|
101
|
+
* not the actual one.
|
|
102
|
+
* @param {HTMLMediaElement} mediaElement
|
|
103
|
+
* @returns {Array}
|
|
104
|
+
*/
|
|
105
|
+
getAwaitedState: function (mediaElement) {
|
|
106
|
+
var _a;
|
|
107
|
+
var currentState = currentMediaState.get(mediaElement);
|
|
108
|
+
return (_a = currentState === null || currentState === void 0 ? void 0 : currentState.mediaKeysState) !== null && _a !== void 0 ? _a : null;
|
|
109
|
+
},
|
|
110
|
+
/**
|
|
111
|
+
* Get MediaKeys information set on a HMTLMediaElement.
|
|
112
|
+
*
|
|
113
|
+
* This method is asynchronous because that state may still be in a process
|
|
114
|
+
* of being attached to the `HTMLMediaElement` (and the state we're
|
|
115
|
+
* currently setting may not work out).
|
|
116
|
+
* @param {HTMLMediaElement} mediaElement
|
|
117
|
+
* @returns {Object|null}
|
|
118
|
+
*/
|
|
119
|
+
getAttachedMediaKeysState: function (mediaElement) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
121
|
+
var currentState;
|
|
122
|
+
return __generator(this, function (_a) {
|
|
123
|
+
switch (_a.label) {
|
|
124
|
+
case 0:
|
|
125
|
+
currentState = currentMediaState.get(mediaElement);
|
|
126
|
+
if (currentState === undefined) {
|
|
127
|
+
return [2 /*return*/, null];
|
|
128
|
+
}
|
|
129
|
+
if (!(currentState.pendingTask !== null)) return [3 /*break*/, 2];
|
|
130
|
+
return [4 /*yield*/, currentState.pendingTask];
|
|
131
|
+
case 1:
|
|
132
|
+
_a.sent();
|
|
133
|
+
return [2 /*return*/, this.getAttachedMediaKeysState(mediaElement)];
|
|
134
|
+
case 2: return [2 /*return*/, currentState.mediaKeysState];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
/**
|
|
140
|
+
* Remove MediaKeys currently set on a HMTLMediaElement and update state
|
|
141
|
+
* accordingly.
|
|
142
|
+
* @param {HTMLMediaElement} mediaElement
|
|
143
|
+
* @returns {Promise}
|
|
144
|
+
*/
|
|
145
|
+
clearMediaKeys: function (mediaElement) {
|
|
146
|
+
var previousState = currentMediaState.get(mediaElement);
|
|
147
|
+
var pendingTask = clearMediaKeys(mediaElement, previousState).then(function () {
|
|
148
|
+
currentMediaState.set(mediaElement, {
|
|
149
|
+
pendingTask: null,
|
|
150
|
+
mediaKeysState: null,
|
|
151
|
+
});
|
|
152
|
+
}, function () {
|
|
153
|
+
currentMediaState.set(mediaElement, {
|
|
154
|
+
pendingTask: null,
|
|
155
|
+
mediaKeysState: null,
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
currentMediaState.set(mediaElement, {
|
|
159
|
+
pendingTask: pendingTask,
|
|
160
|
+
mediaKeysState: null,
|
|
161
|
+
});
|
|
162
|
+
return pendingTask;
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Ensure that the last `MediaKeys` set on the given HTMLMediaElement is
|
|
167
|
+
* attached.
|
|
168
|
+
*
|
|
169
|
+
* The returned Promise never rejects, it will just log an error if the
|
|
170
|
+
* previous attachment failed.
|
|
171
|
+
*
|
|
172
|
+
* @param {Object} previousState
|
|
173
|
+
* @returns {Promise.<undefined>}
|
|
174
|
+
*/
|
|
175
|
+
function awaitMediaKeysAttachment(previousState) {
|
|
176
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
177
|
+
var promise, err_1;
|
|
178
|
+
return __generator(this, function (_a) {
|
|
179
|
+
switch (_a.label) {
|
|
180
|
+
case 0:
|
|
181
|
+
promise = previousState.pendingTask;
|
|
182
|
+
if ((0, is_null_or_undefined_1.default)(promise)) {
|
|
183
|
+
return [2 /*return*/];
|
|
184
|
+
}
|
|
185
|
+
log_1.default.info("DRM: Awaiting previous MediaKeys attachment operation");
|
|
186
|
+
_a.label = 1;
|
|
187
|
+
case 1:
|
|
188
|
+
_a.trys.push([1, 3, , 4]);
|
|
189
|
+
return [4 /*yield*/, previousState.pendingTask];
|
|
190
|
+
case 2:
|
|
191
|
+
_a.sent();
|
|
192
|
+
return [3 /*break*/, 4];
|
|
193
|
+
case 3:
|
|
194
|
+
err_1 = _a.sent();
|
|
195
|
+
log_1.default.info("DRM: previous MediaKeys attachment operation failed", err_1 instanceof Error ? err_1 : "Unknown error");
|
|
196
|
+
return [3 /*break*/, 4];
|
|
197
|
+
case 4: return [2 /*return*/];
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
function attachMediaKeys(mediaElement, previousState, mediaKeysInfo) {
|
|
203
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
204
|
+
var closeAllSessions, err_2, errMessage;
|
|
205
|
+
return __generator(this, function (_a) {
|
|
206
|
+
switch (_a.label) {
|
|
207
|
+
case 0:
|
|
208
|
+
if (!(previousState !== undefined)) return [3 /*break*/, 4];
|
|
209
|
+
if (!(previousState.pendingTask !== null)) return [3 /*break*/, 2];
|
|
210
|
+
// Ensure the `MediaKeys` has been fully attached to the HTMLMediaElement before
|
|
211
|
+
// resetting things, to avoid browser errors due to an invalid state.
|
|
212
|
+
return [4 /*yield*/, awaitMediaKeysAttachment(previousState)];
|
|
213
|
+
case 1:
|
|
214
|
+
// Ensure the `MediaKeys` has been fully attached to the HTMLMediaElement before
|
|
215
|
+
// resetting things, to avoid browser errors due to an invalid state.
|
|
216
|
+
_a.sent();
|
|
217
|
+
_a.label = 2;
|
|
218
|
+
case 2:
|
|
219
|
+
closeAllSessions = !(0, is_null_or_undefined_1.default)(previousState.mediaKeysState) &&
|
|
220
|
+
previousState.mediaKeysState.loadedSessionsStore !==
|
|
221
|
+
mediaKeysInfo.loadedSessionsStore
|
|
222
|
+
? previousState.mediaKeysState.loadedSessionsStore.closeAllSessions()
|
|
223
|
+
: Promise.resolve();
|
|
224
|
+
return [4 /*yield*/, closeAllSessions];
|
|
225
|
+
case 3:
|
|
226
|
+
_a.sent();
|
|
227
|
+
if (mediaElement.mediaKeys === mediaKeysInfo.mediaKeys) {
|
|
228
|
+
log_1.default.debug("DRM: Right MediaKeys already set");
|
|
229
|
+
return [2 /*return*/];
|
|
230
|
+
}
|
|
231
|
+
_a.label = 4;
|
|
232
|
+
case 4:
|
|
233
|
+
log_1.default.info("DRM: Attaching MediaKeys to the media element");
|
|
234
|
+
_a.label = 5;
|
|
235
|
+
case 5:
|
|
236
|
+
_a.trys.push([5, 7, , 8]);
|
|
237
|
+
return [4 /*yield*/, (0, set_media_keys_1.setMediaKeys)(mediaKeysInfo.emeImplementation, mediaElement, mediaKeysInfo.mediaKeys)];
|
|
238
|
+
case 6:
|
|
239
|
+
_a.sent();
|
|
240
|
+
log_1.default.info("DRM: MediaKeys attached with success");
|
|
241
|
+
return [3 /*break*/, 8];
|
|
242
|
+
case 7:
|
|
243
|
+
err_2 = _a.sent();
|
|
244
|
+
errMessage = err_2 instanceof Error ? err_2.toString() : "Unknown Error";
|
|
245
|
+
throw new errors_1.EncryptedMediaError("MEDIA_KEYS_ATTACHMENT_ERROR", "Could not attach the MediaKeys to the media element: " + errMessage);
|
|
246
|
+
case 8: return [2 /*return*/];
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
function clearMediaKeys(mediaElement, previousState) {
|
|
252
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
253
|
+
var loadedSessionsStore;
|
|
254
|
+
return __generator(this, function (_a) {
|
|
255
|
+
switch (_a.label) {
|
|
256
|
+
case 0:
|
|
257
|
+
if (previousState === undefined) {
|
|
258
|
+
return [2 /*return*/];
|
|
259
|
+
}
|
|
260
|
+
if (!(previousState.pendingTask !== null)) return [3 /*break*/, 2];
|
|
261
|
+
// Ensure the `MediaKeys` has been fully attached to the HTMLMediaElement before
|
|
262
|
+
// resetting things, to avoid browser errors due to an invalid state.
|
|
263
|
+
return [4 /*yield*/, awaitMediaKeysAttachment(previousState)];
|
|
264
|
+
case 1:
|
|
265
|
+
// Ensure the `MediaKeys` has been fully attached to the HTMLMediaElement before
|
|
266
|
+
// resetting things, to avoid browser errors due to an invalid state.
|
|
267
|
+
_a.sent();
|
|
268
|
+
_a.label = 2;
|
|
269
|
+
case 2:
|
|
270
|
+
if (previousState.mediaKeysState === null) {
|
|
271
|
+
return [2 /*return*/];
|
|
272
|
+
}
|
|
273
|
+
log_1.default.info("DRM: Disposing of the current MediaKeys");
|
|
274
|
+
loadedSessionsStore = previousState.mediaKeysState.loadedSessionsStore;
|
|
275
|
+
return [4 /*yield*/, loadedSessionsStore.closeAllSessions()];
|
|
276
|
+
case 3:
|
|
277
|
+
_a.sent();
|
|
278
|
+
return [2 /*return*/, (0, set_media_keys_1.setMediaKeys)(previousState.mediaKeysState.emeImplementation, mediaElement, null)];
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
}
|
|
@@ -245,7 +245,7 @@ var RebufferingController = /** @class */ (function (_super) {
|
|
|
245
245
|
this.start();
|
|
246
246
|
}
|
|
247
247
|
var observation = this._playbackObserver.getReference().getValue();
|
|
248
|
-
if (
|
|
248
|
+
if (observation.rebuffering === null ||
|
|
249
249
|
observation.paused ||
|
|
250
250
|
this._speed.getValue() <= 0 ||
|
|
251
251
|
(bufferType !== "audio" && bufferType !== "video")) {
|
|
@@ -386,7 +386,7 @@ var TextTrackCuesStore = /** @class */ (function () {
|
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
if (cuesBuffer.length) {
|
|
389
|
+
if (cuesBuffer.length > 0) {
|
|
390
390
|
var lastCue = cuesBuffer[cuesBuffer.length - 1];
|
|
391
391
|
if ((0, utils_1.areNearlyEqual)(lastCue.end, start, relativeDelta)) {
|
|
392
392
|
// Match the end of the previous cue to the start of the following one
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track_dispatcher.d.ts","sourceRoot":"","sources":["../../../../src/main_thread/tracks_store/track_dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAA2B,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"track_dispatcher.d.ts","sourceRoot":"","sources":["../../../../src/main_thread/tracks_store/track_dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAA2B,MAAM,gBAAgB,CAAC;AAOnF,OAAO,YAAY,MAAM,2BAA2B,CAAC;AAErD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,eAAe,MAAM,uBAAuB,CAAC;AAGpD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,YAAY,CAAC,qBAAqB,CAAC;IAC9E;;;;;;;OAOG;IACI,OAAO,EAAE,MAAM,IAAI,CAAC;IAE3B;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,cAAc,CAa7B;IAEF;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY,CAON;IAEd,iFAAiF;IACjF,OAAO,CAAC,UAAU,CAAgB;IAElC;;;;;;OAMG;IACH,OAAO,CAAC,YAAY,CAAU;IAE9B;;;;;;OAMG;gBACS,aAAa,EAAE,eAAe,CAAC,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;IAShF;;;;;OAKG;IACI,WAAW,IAAI,OAAO;IAI7B;;;OAGG;IACI,WAAW,CAAC,YAAY,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI;IAoC5D;;;;;;OAMG;IACH,OAAO,CAAC,wCAAwC;IA+EhD;;;OAGG;IACI,OAAO,IAAI,IAAI;CAKvB;AAED,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,8BAA8B,EAAE,IAAI,CAAC;IACrC,wBAAwB,EAAE,IAAI,CAAC;CAChC;AAED,oEAAoE;AACpE,MAAM,WAAW,aAAa;IAC5B,oDAAoD;IACpD,UAAU,EAAE,mBAAmB,CAAC;IAChC,gEAAgE;IAChE,aAAa,EAAE,mBAAmB,CAAC;IACnC,sDAAsD;IACtD,wBAAwB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C;;;;;;;OAOG;IACH,qBAAqB,EAAE,wBAAwB,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAC;CAChF"}
|
|
@@ -15,6 +15,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
var manifest_1 = require("../../manifest");
|
|
18
19
|
var array_includes_1 = require("../../utils/array_includes");
|
|
19
20
|
var event_emitter_1 = require("../../utils/event_emitter");
|
|
20
21
|
var noop_1 = require("../../utils/noop");
|
|
@@ -120,9 +121,7 @@ var TrackDispatcher = /** @class */ (function (_super) {
|
|
|
120
121
|
var playableRepresentations;
|
|
121
122
|
if (repSettings === null) {
|
|
122
123
|
// unlocking
|
|
123
|
-
playableRepresentations = trackInfo.adaptation.representations.filter(function (representation) {
|
|
124
|
-
return (representation.isSupported === true && representation.decipherable !== false);
|
|
125
|
-
});
|
|
124
|
+
playableRepresentations = trackInfo.adaptation.representations.filter(function (representation) { return (0, manifest_1.isRepresentationPlayable)(representation) === true; });
|
|
126
125
|
// No need to remove the previous content when unlocking
|
|
127
126
|
switchingMode = "lazy";
|
|
128
127
|
}
|
|
@@ -132,7 +131,7 @@ var TrackDispatcher = /** @class */ (function (_super) {
|
|
|
132
131
|
var representations = trackInfo.adaptation.representations.filter(function (r) {
|
|
133
132
|
return (0, array_includes_1.default)(representationIds_1, r.id);
|
|
134
133
|
});
|
|
135
|
-
playableRepresentations = representations.filter(function (
|
|
134
|
+
playableRepresentations = representations.filter(function (representation) { return (0, manifest_1.isRepresentationPlayable)(representation) === true; });
|
|
136
135
|
if (playableRepresentations.length === 0) {
|
|
137
136
|
self.trigger("noPlayableLockedRepresentation", null);
|
|
138
137
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracks_store.d.ts","sourceRoot":"","sources":["../../../../src/main_thread/tracks_store/tracks_store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAGlF,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EAChB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"tracks_store.d.ts","sourceRoot":"","sources":["../../../../src/main_thread/tracks_store/tracks_store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAGlF,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAi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AAoB,GAAG;IAC1B;;;;;OAKG;IACH,UAAU,EAAE,mBAAmB,CAAC;IAChC,gEAAgE;IAChE,aAAa,EAAE,wBAAwB,CAAC;IACxC;;;;OAIG;IACH,cAAc,EAAE,mBAAmB,CAAC;IACpC;;;;OAIG;IACH,qBAAqB,EAAE,eAAe,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAC;CACvE,GAAG,IAAI,CAAC;AAET,yCAAyC;AACzC,UAAU,kBAAkB;IAC1B,mBAAmB,EAAE,OAAO,EAAE,CAAC;IAC/B,yBAAyB,EAAE,iCAAiC,CAAC;IAC7D,WAAW,EAAE,wBAAwB,CAAC;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,iCAAiC;IAChD,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE,kCAAkC,GAAG,SAAS,CAAC;CAChE;AAED,MAAM,WAAW,iCAAiC;IAChD,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE,kCAAkC,GAAG,SAAS,CAAC;CAChE"}
|
|
@@ -370,7 +370,7 @@ var TracksStore = /** @class */ (function (_super) {
|
|
|
370
370
|
adaptation.supportStatus.isDecipherable === false) {
|
|
371
371
|
return false;
|
|
372
372
|
}
|
|
373
|
-
var playableRepresentations = adaptation.representations.filter(function (r) { return r
|
|
373
|
+
var playableRepresentations = adaptation.representations.filter(function (r) { return (0, manifest_1.isRepresentationPlayable)(r) === true; });
|
|
374
374
|
return playableRepresentations.length > 0;
|
|
375
375
|
});
|
|
376
376
|
if (nextAdaptation === undefined) {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type
|
|
16
|
+
import { type IRepresentationMetadata } from "../../manifest";
|
|
17
17
|
import type { ICdnMetadata, IContentProtections, IParsedRepresentation } from "../../parsers/manifest";
|
|
18
18
|
import type { ITrackType, IHDRInformation } from "../../public_types";
|
|
19
19
|
import type codecSupportCache from "./codec_support_cache";
|
|
@@ -193,6 +193,20 @@ declare class Representation implements IRepresentationMetadata {
|
|
|
193
193
|
systemId: string;
|
|
194
194
|
data: Uint8Array;
|
|
195
195
|
}>): boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Returns `true` if the `Representation` has a high chance of being playable on
|
|
198
|
+
* the current device (its codec seems supported and we don't consider it to be
|
|
199
|
+
* un-decipherable).
|
|
200
|
+
*
|
|
201
|
+
* Returns `false` if the `Representation` has a high chance of being unplayable
|
|
202
|
+
* on the current device (its codec seems unsupported and/or we consider it to
|
|
203
|
+
* be un-decipherable).
|
|
204
|
+
*
|
|
205
|
+
* Returns `undefined` if we don't know as the codec has not been checked yet.
|
|
206
|
+
*
|
|
207
|
+
* @returns {boolean|undefined}
|
|
208
|
+
*/
|
|
209
|
+
isPlayable(): boolean | undefined;
|
|
196
210
|
/**
|
|
197
211
|
* Format the current `Representation`'s properties into a
|
|
198
212
|
* `IRepresentationMetadata` format which can better be communicated through
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"representation.d.ts","sourceRoot":"","sources":["../../../../src/manifest/classes/representation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"representation.d.ts","sourceRoot":"","sources":["../../../../src/manifest/classes/representation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAA4B,KAAK,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KA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;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACI,oBAAoB,IAAI,6BAA6B,EAAE;IAa9D;;;;;;;;;;;;;;;OAeG;IACI,iBAAiB,CACtB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,UAAU,GAAG,SAAS,EAC7B,IAAI,EAAE,KAAK,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,UAAU,CAAC;KAClB,CAAC,GACD,OAAO;IA8DV;;;;;;;;;;;;OAYG;IACI,UAAU,IAAI,OAAO,GAAG,SAAS;IAIxC;;;;;;;;;;;;;OAaG;IACI,mBAAmB,IAAI,uBAAuB;CAgBtD;AAED,uDAAuD;AACvD,MAAM,WAAW,6BAA6B;IAC5C;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,MAAM,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;IACjC,+CAA+C;IAC/C,MAAM,EAAE,KAAK,CAAC;QACZ;;;WAGG;QACH,QAAQ,EAAE,MAAM,CAAC;QACjB;;;;WAIG;QACH,IAAI,EAAE,UAAU,CAAC;KAClB,CAAC,CAAC;CACJ;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -27,6 +27,7 @@ var __values = (this && this.__values) || function(o) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
var log_1 = require("../../log");
|
|
30
|
+
var manifest_1 = require("../../manifest");
|
|
30
31
|
var are_arrays_of_numbers_equal_1 = require("../../utils/are_arrays_of_numbers_equal");
|
|
31
32
|
var id_generator_1 = require("../../utils/id_generator");
|
|
32
33
|
var generateRepresentationUniqueId = (0, id_generator_1.default)();
|
|
@@ -343,6 +344,22 @@ var Representation = /** @class */ (function () {
|
|
|
343
344
|
this.contentProtections.initData.push({ type: initDataType, values: data });
|
|
344
345
|
return true;
|
|
345
346
|
};
|
|
347
|
+
/**
|
|
348
|
+
* Returns `true` if the `Representation` has a high chance of being playable on
|
|
349
|
+
* the current device (its codec seems supported and we don't consider it to be
|
|
350
|
+
* un-decipherable).
|
|
351
|
+
*
|
|
352
|
+
* Returns `false` if the `Representation` has a high chance of being unplayable
|
|
353
|
+
* on the current device (its codec seems unsupported and/or we consider it to
|
|
354
|
+
* be un-decipherable).
|
|
355
|
+
*
|
|
356
|
+
* Returns `undefined` if we don't know as the codec has not been checked yet.
|
|
357
|
+
*
|
|
358
|
+
* @returns {boolean|undefined}
|
|
359
|
+
*/
|
|
360
|
+
Representation.prototype.isPlayable = function () {
|
|
361
|
+
return (0, manifest_1.isRepresentationPlayable)(this);
|
|
362
|
+
};
|
|
346
363
|
/**
|
|
347
364
|
* Format the current `Representation`'s properties into a
|
|
348
365
|
* `IRepresentationMetadata` format which can better be communicated through
|
|
@@ -92,6 +92,21 @@ export declare function toTextTrack(adaptation: IAdaptationMetadata): ITextTrack
|
|
|
92
92
|
*/
|
|
93
93
|
export declare function toVideoTrack(adaptation: IAdaptationMetadata, filterPlayable: boolean): IVideoTrack;
|
|
94
94
|
export declare function toTaggedTrack(adaptation: IAdaptation): ITaggedTrack;
|
|
95
|
+
/**
|
|
96
|
+
* Returns `true` if the `Representation` has a high chance of being playable on
|
|
97
|
+
* the current device (its codec seems supported and we don't consider it to be
|
|
98
|
+
* un-decipherable).
|
|
99
|
+
*
|
|
100
|
+
* Returns `false` if the `Representation` has a high chance of being unplayable
|
|
101
|
+
* on the current device (its codec seems unsupported and/or we consider it to
|
|
102
|
+
* be un-decipherable).
|
|
103
|
+
*
|
|
104
|
+
* Returns `undefined` if we don't know as the codec has not been checked yet.
|
|
105
|
+
*
|
|
106
|
+
* @param {Object} representation
|
|
107
|
+
* @returns {boolean|undefined}
|
|
108
|
+
*/
|
|
109
|
+
export declare function isRepresentationPlayable(representation: IRepresentationMetadata): boolean | undefined;
|
|
95
110
|
/**
|
|
96
111
|
* Information on a Representation affected by a `decipherabilityUpdates` event.
|
|
97
112
|
*/
|
|
@@ -1 +1 @@
|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AK,EAAE,WAAW,CAAC;CACpB;AAED,UAAU,iBAAiB;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,WAAW,CAAC;CACpB;AAED,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,gBAAgB,CAAC"}
|
|
@@ -24,6 +24,7 @@ exports.toAudioTrack = toAudioTrack;
|
|
|
24
24
|
exports.toTextTrack = toTextTrack;
|
|
25
25
|
exports.toVideoTrack = toVideoTrack;
|
|
26
26
|
exports.toTaggedTrack = toTaggedTrack;
|
|
27
|
+
exports.isRepresentationPlayable = isRepresentationPlayable;
|
|
27
28
|
exports.updateDecipherabilityFromKeyIds = updateDecipherabilityFromKeyIds;
|
|
28
29
|
exports.updateDecipherabilityFromProtectionData = updateDecipherabilityFromProtectionData;
|
|
29
30
|
exports.replicateUpdatesOnManifestMetadata = replicateUpdatesOnManifestMetadata;
|
|
@@ -184,7 +185,7 @@ function toAudioTrack(adaptation, filterPlayable) {
|
|
|
184
185
|
audioDescription: adaptation.isAudioDescription === true,
|
|
185
186
|
id: adaptation.id,
|
|
186
187
|
representations: (filterPlayable
|
|
187
|
-
? adaptation.representations.filter(function (r) { return r
|
|
188
|
+
? adaptation.representations.filter(function (r) { return isRepresentationPlayable(r); })
|
|
188
189
|
: adaptation.representations).map(toAudioRepresentation),
|
|
189
190
|
label: adaptation.label,
|
|
190
191
|
};
|
|
@@ -220,7 +221,7 @@ function toVideoTrack(adaptation, filterPlayable) {
|
|
|
220
221
|
var trickModeTracks = adaptation.trickModeTracks !== undefined
|
|
221
222
|
? adaptation.trickModeTracks.map(function (trickModeAdaptation) {
|
|
222
223
|
var representations = (filterPlayable
|
|
223
|
-
? trickModeAdaptation.representations.filter(function (r) { return r
|
|
224
|
+
? trickModeAdaptation.representations.filter(function (r) { return isRepresentationPlayable(r) === true; })
|
|
224
225
|
: trickModeAdaptation.representations).map(toVideoRepresentation);
|
|
225
226
|
var trickMode = {
|
|
226
227
|
id: trickModeAdaptation.id,
|
|
@@ -236,7 +237,7 @@ function toVideoTrack(adaptation, filterPlayable) {
|
|
|
236
237
|
var videoTrack = {
|
|
237
238
|
id: adaptation.id,
|
|
238
239
|
representations: (filterPlayable
|
|
239
|
-
? adaptation.representations.filter(function (r) { return r
|
|
240
|
+
? adaptation.representations.filter(function (r) { return isRepresentationPlayable(r) === true; })
|
|
240
241
|
: adaptation.representations).map(toVideoRepresentation),
|
|
241
242
|
label: adaptation.label,
|
|
242
243
|
};
|
|
@@ -299,6 +300,26 @@ function toTaggedTrack(adaptation) {
|
|
|
299
300
|
return { type: "text", track: toTextTrack(adaptation) };
|
|
300
301
|
}
|
|
301
302
|
}
|
|
303
|
+
/**
|
|
304
|
+
* Returns `true` if the `Representation` has a high chance of being playable on
|
|
305
|
+
* the current device (its codec seems supported and we don't consider it to be
|
|
306
|
+
* un-decipherable).
|
|
307
|
+
*
|
|
308
|
+
* Returns `false` if the `Representation` has a high chance of being unplayable
|
|
309
|
+
* on the current device (its codec seems unsupported and/or we consider it to
|
|
310
|
+
* be un-decipherable).
|
|
311
|
+
*
|
|
312
|
+
* Returns `undefined` if we don't know as the codec has not been checked yet.
|
|
313
|
+
*
|
|
314
|
+
* @param {Object} representation
|
|
315
|
+
* @returns {boolean|undefined}
|
|
316
|
+
*/
|
|
317
|
+
function isRepresentationPlayable(representation) {
|
|
318
|
+
if (representation.decipherable === false) {
|
|
319
|
+
return false;
|
|
320
|
+
}
|
|
321
|
+
return representation.isSupported;
|
|
322
|
+
}
|
|
302
323
|
/**
|
|
303
324
|
* Change the decipherability of Representations which have their key id in one
|
|
304
325
|
* of the given Arrays:
|
|
@@ -526,7 +547,8 @@ function replicateUpdatesOnManifestMetadata(baseManifest, newManifest, updates)
|
|
|
526
547
|
for (var _q = __values(Object.keys(newManifest)), _r = _q.next(); !_r.done; _r = _q.next()) {
|
|
527
548
|
var prop = _r.value;
|
|
528
549
|
if (prop !== "periods") {
|
|
529
|
-
//
|
|
550
|
+
// trust me bro
|
|
551
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
|
|
530
552
|
baseManifest[prop] = newManifest[prop];
|
|
531
553
|
}
|
|
532
554
|
}
|
|
@@ -567,7 +589,8 @@ function replicateUpdatesOnManifestMetadata(baseManifest, newManifest, updates)
|
|
|
567
589
|
for (var _w = (e_13 = void 0, __values(Object.keys(newPeriod))), _x = _w.next(); !_x.done; _x = _w.next()) {
|
|
568
590
|
var prop = _x.value;
|
|
569
591
|
if (prop !== "adaptations") {
|
|
570
|
-
//
|
|
592
|
+
// trust me bro
|
|
593
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
|
|
571
594
|
basePeriod[prop] = newPeriod[prop];
|
|
572
595
|
}
|
|
573
596
|
}
|
|
@@ -103,7 +103,7 @@ function getHDRInformation(_a) {
|
|
|
103
103
|
return { eotf: "hlg" };
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
if (codecs !== undefined && /^vp(08|09|10)/.
|
|
106
|
+
if (codecs !== undefined && /^vp(08|09|10)/.test(codecs)) {
|
|
107
107
|
return (0, get_hdr_information_1.getWEBMHDRInformation)(codecs);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
@@ -189,7 +189,7 @@ function parseRepresentations(representationsIR, adaptation, context) {
|
|
|
189
189
|
(0, array_find_1.default)(representation.children.supplementalProperties, function (r) {
|
|
190
190
|
return r.schemeIdUri === "tag:dolby.com,2018:dash:EC3_ExtensionType:2018" &&
|
|
191
191
|
r.value === "JOC";
|
|
192
|
-
})) {
|
|
192
|
+
}) !== undefined) {
|
|
193
193
|
parsedRepresentation.isSpatialAudio = true;
|
|
194
194
|
}
|
|
195
195
|
// Add optional attributes
|
|
@@ -583,7 +583,7 @@ function getRebufferingStatus(_a) {
|
|
|
583
583
|
*/
|
|
584
584
|
function getFreezingStatus(prevObservation, currentInfo, currentEvt, bufferGap) {
|
|
585
585
|
var MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING = config_1.default.getCurrent().MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING;
|
|
586
|
-
if (prevObservation.freezing) {
|
|
586
|
+
if (prevObservation.freezing !== null) {
|
|
587
587
|
if (currentInfo.ended ||
|
|
588
588
|
currentInfo.paused ||
|
|
589
589
|
currentInfo.readyState === 0 ||
|