rx-player 4.2.0-dev.2024091600 → 4.2.0-dev.2024100200
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 +20 -11
- package/VERSION +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/eme/close_session.js +2 -2
- package/dist/commonjs/compat/eme/load_session.js +2 -2
- package/dist/commonjs/compat/patch_webkit_source_buffer.d.ts.map +1 -1
- package/dist/commonjs/compat/patch_webkit_source_buffer.js +0 -3
- package/dist/commonjs/config.d.ts +7 -156
- package/dist/commonjs/config.d.ts.map +1 -1
- package/dist/commonjs/config.js +50 -3
- package/dist/commonjs/core/fetchers/manifest/manifest_fetcher.js +2 -2
- package/dist/commonjs/core/fetchers/segment/segment_fetcher.js +2 -2
- package/dist/commonjs/core/fetchers/utils/schedule_request.js +2 -2
- package/dist/commonjs/core/main/worker/worker_main.d.ts.map +1 -1
- package/dist/commonjs/core/main/worker/worker_main.js +7 -0
- package/dist/commonjs/core/segment_sinks/garbage_collector.js +2 -2
- package/dist/commonjs/core/segment_sinks/implementations/audio_video/audio_video_segment_buffer.js +2 -2
- package/dist/commonjs/core/segment_sinks/implementations/text/text_segment_buffer.js +2 -2
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/adaptation/adaptation_stream.js +35 -9
- package/dist/commonjs/core/stream/adaptation/index.d.ts +1 -1
- package/dist/commonjs/core/stream/adaptation/index.d.ts.map +1 -1
- package/dist/commonjs/core/stream/adaptation/index.js +0 -15
- package/dist/commonjs/core/stream/orchestrator/stream_orchestrator.js +2 -2
- package/dist/commonjs/core/stream/period/index.d.ts +1 -1
- package/dist/commonjs/core/stream/period/index.d.ts.map +1 -1
- package/dist/commonjs/core/stream/period/index.js +0 -15
- package/dist/commonjs/core/stream/period/period_stream.js +2 -2
- package/dist/commonjs/core/stream/representation/index.d.ts +1 -1
- package/dist/commonjs/core/stream/representation/index.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/index.js +0 -15
- package/dist/commonjs/core/stream/representation/representation_stream.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/representation_stream.js +2 -0
- package/dist/commonjs/core/stream/representation/utils/append_segment_to_buffer.d.ts.map +1 -1
- package/dist/commonjs/core/stream/representation/utils/append_segment_to_buffer.js +16 -11
- package/dist/commonjs/core/stream/representation/utils/push_init_segment.js +2 -2
- package/dist/commonjs/core/stream/representation/utils/push_media_segment.js +2 -2
- package/dist/commonjs/default_config.js +4 -0
- package/dist/commonjs/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +2 -2
- package/dist/commonjs/experimental/tools/createMetaplaylist/get_duration_from_manifest.js +2 -2
- package/dist/commonjs/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/commonjs/main_thread/api/public_api.js +19 -4
- package/dist/commonjs/main_thread/decrypt/attach_media_keys.js +2 -2
- package/dist/commonjs/main_thread/decrypt/content_decryptor.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/content_decryptor.js +4 -2
- package/dist/commonjs/main_thread/decrypt/create_or_load_session.js +2 -2
- package/dist/commonjs/main_thread/decrypt/create_session.js +2 -2
- package/dist/commonjs/main_thread/decrypt/dispose_decryption_resources.js +2 -2
- package/dist/commonjs/main_thread/decrypt/find_key_system.js +2 -2
- package/dist/commonjs/main_thread/decrypt/get_media_keys.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/get_media_keys.js +3 -2
- package/dist/commonjs/main_thread/decrypt/init_media_keys.js +2 -2
- package/dist/commonjs/main_thread/decrypt/session_events_listener.js +2 -2
- package/dist/commonjs/main_thread/decrypt/set_server_certificate.js +2 -4
- package/dist/commonjs/main_thread/decrypt/utils/clean_old_loaded_sessions.js +2 -2
- package/dist/commonjs/main_thread/decrypt/utils/loaded_sessions_store.js +2 -2
- package/dist/commonjs/main_thread/init/directfile_content_initializer.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/directfile_content_initializer.js +14 -6
- package/dist/commonjs/main_thread/init/media_source_content_initializer.js +2 -2
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts +13 -0
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +96 -47
- package/dist/commonjs/main_thread/init/utils/initial_seek_and_play.d.ts +1 -1
- package/dist/commonjs/main_thread/init/utils/initial_seek_and_play.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/utils/initial_seek_and_play.js +21 -5
- package/dist/commonjs/mse/main_media_source_interface.d.ts.map +1 -1
- package/dist/commonjs/mse/main_media_source_interface.js +21 -2
- package/dist/commonjs/multithread_types.d.ts +8 -1
- package/dist/commonjs/multithread_types.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +2 -2
- package/dist/commonjs/parsers/manifest/index.d.ts +1 -1
- package/dist/commonjs/parsers/manifest/index.d.ts.map +1 -1
- package/dist/commonjs/parsers/manifest/index.js +0 -15
- package/dist/commonjs/transports/dash/integrity_checks.js +2 -2
- package/dist/commonjs/transports/dash/load_chunked_segment_data.js +2 -2
- package/dist/commonjs/transports/dash/segment_loader.js +2 -2
- package/dist/commonjs/transports/dash/text_loader.js +2 -2
- package/dist/commonjs/transports/smooth/pipelines.d.ts.map +1 -1
- package/dist/commonjs/transports/smooth/pipelines.js +1 -0
- package/dist/commonjs/transports/smooth/segment_loader.js +2 -2
- package/dist/commonjs/transports/utils/parse_text_track.d.ts.map +1 -1
- package/dist/commonjs/transports/utils/parse_text_track.js +1 -0
- package/dist/commonjs/utils/request/fetch.js +2 -2
- package/dist/commonjs/utils/retry_promise_with_backoff.js +2 -2
- 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/patch_webkit_source_buffer.d.ts.map +1 -1
- package/dist/es2017/compat/patch_webkit_source_buffer.js +0 -3
- package/dist/es2017/config.d.ts +7 -156
- package/dist/es2017/config.d.ts.map +1 -1
- package/dist/es2017/config.js +6 -1
- package/dist/es2017/core/main/worker/worker_main.d.ts.map +1 -1
- package/dist/es2017/core/main/worker/worker_main.js +7 -0
- package/dist/es2017/core/stream/adaptation/adaptation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/adaptation/adaptation_stream.js +33 -7
- package/dist/es2017/core/stream/adaptation/index.d.ts +1 -1
- package/dist/es2017/core/stream/adaptation/index.d.ts.map +1 -1
- package/dist/es2017/core/stream/adaptation/index.js +0 -1
- package/dist/es2017/core/stream/period/index.d.ts +1 -1
- package/dist/es2017/core/stream/period/index.d.ts.map +1 -1
- package/dist/es2017/core/stream/period/index.js +0 -1
- package/dist/es2017/core/stream/representation/index.d.ts +1 -1
- package/dist/es2017/core/stream/representation/index.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/index.js +0 -1
- package/dist/es2017/core/stream/representation/representation_stream.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/representation_stream.js +2 -0
- package/dist/es2017/core/stream/representation/utils/append_segment_to_buffer.d.ts.map +1 -1
- package/dist/es2017/core/stream/representation/utils/append_segment_to_buffer.js +6 -2
- package/dist/es2017/default_config.js +4 -0
- package/dist/es2017/main_thread/api/public_api.d.ts.map +1 -1
- package/dist/es2017/main_thread/api/public_api.js +17 -2
- package/dist/es2017/main_thread/decrypt/content_decryptor.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/content_decryptor.js +2 -0
- package/dist/es2017/main_thread/decrypt/get_media_keys.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/get_media_keys.js +1 -0
- package/dist/es2017/main_thread/init/directfile_content_initializer.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/directfile_content_initializer.js +14 -6
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts +13 -0
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +78 -41
- package/dist/es2017/main_thread/init/utils/initial_seek_and_play.d.ts +1 -1
- package/dist/es2017/main_thread/init/utils/initial_seek_and_play.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/utils/initial_seek_and_play.js +19 -3
- package/dist/es2017/mse/main_media_source_interface.d.ts.map +1 -1
- package/dist/es2017/mse/main_media_source_interface.js +19 -0
- package/dist/es2017/multithread_types.d.ts +8 -1
- package/dist/es2017/multithread_types.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/index.d.ts +1 -1
- package/dist/es2017/parsers/manifest/index.d.ts.map +1 -1
- package/dist/es2017/parsers/manifest/index.js +1 -1
- package/dist/es2017/transports/smooth/pipelines.d.ts.map +1 -1
- package/dist/es2017/transports/smooth/pipelines.js +1 -0
- package/dist/es2017/transports/utils/parse_text_track.d.ts.map +1 -1
- package/dist/es2017/transports/utils/parse_text_track.js +1 -0
- package/dist/rx-player.js +101 -23
- package/dist/rx-player.min.js +14 -14
- package/dist/worker.js +6 -6
- package/package.json +38 -21
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/compat/patch_webkit_source_buffer.ts +0 -3
- package/src/config.ts +10 -2
- package/src/core/main/worker/worker_main.ts +8 -0
- package/src/core/stream/adaptation/adaptation_stream.ts +41 -8
- package/src/core/stream/adaptation/index.ts +1 -1
- package/src/core/stream/period/index.ts +1 -1
- package/src/core/stream/representation/index.ts +1 -1
- package/src/core/stream/representation/representation_stream.ts +11 -0
- package/src/core/stream/representation/utils/append_segment_to_buffer.ts +6 -2
- package/src/default_config.ts +21 -0
- package/src/main_thread/api/public_api.ts +19 -2
- package/src/main_thread/decrypt/content_decryptor.ts +2 -0
- package/src/main_thread/decrypt/get_media_keys.ts +1 -0
- package/src/main_thread/init/directfile_content_initializer.ts +20 -10
- package/src/main_thread/init/multi_thread_content_initializer.ts +94 -61
- package/src/main_thread/init/utils/initial_seek_and_play.ts +24 -5
- package/src/mse/main_media_source_interface.ts +20 -0
- package/src/multithread_types.ts +9 -0
- package/src/parsers/manifest/index.ts +1 -1
- package/src/transports/smooth/pipelines.ts +1 -0
- package/src/transports/utils/parse_text_track.ts +1 -0
|
@@ -24,8 +24,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
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;
|
|
28
|
-
return g =
|
|
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
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -24,8 +24,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
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;
|
|
28
|
-
return g =
|
|
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
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patch_webkit_source_buffer.d.ts","sourceRoot":"","sources":["../../../src/compat/patch_webkit_source_buffer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA6BH,MAAM,CAAC,OAAO,UAAU,uBAAuB,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"patch_webkit_source_buffer.d.ts","sourceRoot":"","sources":["../../../src/compat/patch_webkit_source_buffer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA6BH,MAAM,CAAC,OAAO,UAAU,uBAAuB,IAAI,IAAI,CAiEtD"}
|
|
@@ -40,10 +40,8 @@ function patchWebkitSourceBuffer() {
|
|
|
40
40
|
sourceBufferWebkitProto._emitUpdate = function (eventName, val) {
|
|
41
41
|
var _this = this;
|
|
42
42
|
(0, queue_microtask_1.default)(function () {
|
|
43
|
-
// @ts-expect-error: trigger is normally protected
|
|
44
43
|
_this.trigger(eventName, val);
|
|
45
44
|
_this.updating = false;
|
|
46
|
-
// @ts-expect-error: trigger is normally protected
|
|
47
45
|
_this.trigger("updateend", new Event("updateend"));
|
|
48
46
|
});
|
|
49
47
|
};
|
|
@@ -52,7 +50,6 @@ function patchWebkitSourceBuffer() {
|
|
|
52
50
|
if (this.updating) {
|
|
53
51
|
throw new Error("updating");
|
|
54
52
|
}
|
|
55
|
-
// @ts-expect-error: trigger is normally protected
|
|
56
53
|
this.trigger("updatestart", new Event("updatestart"));
|
|
57
54
|
this.updating = true;
|
|
58
55
|
try {
|
|
@@ -6,162 +6,13 @@
|
|
|
6
6
|
* __NOT__ part of the RxPlayer API.
|
|
7
7
|
*/
|
|
8
8
|
import type { IDefaultConfig } from "./default_config";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
bitrateSwitch: number;
|
|
17
|
-
trackSwitch: {
|
|
18
|
-
audio: number;
|
|
19
|
-
video: number;
|
|
20
|
-
other: number;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
DEFAULT_CODEC_SWITCHING_BEHAVIOR: "continue" | "reload";
|
|
24
|
-
DEFAULT_AUTO_PLAY: boolean;
|
|
25
|
-
DEFAULT_WANTED_BUFFER_AHEAD: number;
|
|
26
|
-
DEFAULT_MAX_BUFFER_AHEAD: number;
|
|
27
|
-
DEFAULT_MAX_BUFFER_BEHIND: number;
|
|
28
|
-
DEFAULT_MAX_VIDEO_BUFFER_SIZE: number;
|
|
29
|
-
MAXIMUM_MAX_BUFFER_AHEAD: Partial<Record<"audio" | "video" | "text", number>>;
|
|
30
|
-
MINIMUM_MAX_BUFFER_AHEAD: Partial<Record<"audio" | "video" | "image" | "text", number>>;
|
|
31
|
-
MAXIMUM_MAX_BUFFER_BEHIND: Partial<Record<"audio" | "video" | "text", number>>;
|
|
32
|
-
DEFAULT_BASE_BANDWIDTH: number;
|
|
33
|
-
INACTIVITY_DELAY: number;
|
|
34
|
-
DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN: boolean;
|
|
35
|
-
DEFAULT_VIDEO_RESOLUTION_LIMIT: "none";
|
|
36
|
-
DEFAULT_LIVE_GAP: {
|
|
37
|
-
DEFAULT: number;
|
|
38
|
-
LOW_LATENCY: number;
|
|
39
|
-
};
|
|
40
|
-
BUFFER_DISCONTINUITY_THRESHOLD: number;
|
|
41
|
-
BITRATE_REBUFFERING_RATIO: number;
|
|
42
|
-
DEFAULT_MAX_MANIFEST_REQUEST_RETRY: number;
|
|
43
|
-
DEFAULT_CDN_DOWNGRADE_TIME: number;
|
|
44
|
-
DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR: number;
|
|
45
|
-
INITIAL_BACKOFF_DELAY_BASE: {
|
|
46
|
-
REGULAR: number;
|
|
47
|
-
LOW_LATENCY: number;
|
|
48
|
-
};
|
|
49
|
-
MAX_BACKOFF_DELAY_BASE: {
|
|
50
|
-
REGULAR: number;
|
|
51
|
-
LOW_LATENCY: number;
|
|
52
|
-
};
|
|
53
|
-
SAMPLING_INTERVAL_MEDIASOURCE: number;
|
|
54
|
-
SAMPLING_INTERVAL_LOW_LATENCY: number;
|
|
55
|
-
SAMPLING_INTERVAL_NO_MEDIASOURCE: number;
|
|
56
|
-
ABR_ENTER_BUFFER_BASED_ALGO: number;
|
|
57
|
-
ABR_EXIT_BUFFER_BASED_ALGO: number;
|
|
58
|
-
ABR_MINIMUM_TOTAL_BYTES: number;
|
|
59
|
-
ABR_MINIMUM_CHUNK_SIZE: number;
|
|
60
|
-
ABR_STARVATION_FACTOR: {
|
|
61
|
-
DEFAULT: number;
|
|
62
|
-
LOW_LATENCY: number;
|
|
63
|
-
};
|
|
64
|
-
ABR_REGULAR_FACTOR: {
|
|
65
|
-
DEFAULT: number;
|
|
66
|
-
LOW_LATENCY: number;
|
|
67
|
-
};
|
|
68
|
-
ABR_STARVATION_GAP: {
|
|
69
|
-
DEFAULT: number;
|
|
70
|
-
LOW_LATENCY: number;
|
|
71
|
-
};
|
|
72
|
-
OUT_OF_STARVATION_GAP: {
|
|
73
|
-
DEFAULT: number;
|
|
74
|
-
LOW_LATENCY: number;
|
|
75
|
-
};
|
|
76
|
-
ABR_STARVATION_DURATION_DELTA: number;
|
|
77
|
-
ABR_FAST_EMA: number;
|
|
78
|
-
ABR_SLOW_EMA: number;
|
|
79
|
-
RESUME_GAP_AFTER_SEEKING: {
|
|
80
|
-
DEFAULT: number;
|
|
81
|
-
LOW_LATENCY: number;
|
|
82
|
-
};
|
|
83
|
-
RESUME_GAP_AFTER_NOT_ENOUGH_DATA: {
|
|
84
|
-
DEFAULT: number;
|
|
85
|
-
LOW_LATENCY: number;
|
|
86
|
-
};
|
|
87
|
-
RESUME_GAP_AFTER_BUFFERING: {
|
|
88
|
-
DEFAULT: number;
|
|
89
|
-
LOW_LATENCY: number;
|
|
90
|
-
};
|
|
91
|
-
REBUFFERING_GAP: {
|
|
92
|
-
DEFAULT: number;
|
|
93
|
-
LOW_LATENCY: number;
|
|
94
|
-
};
|
|
95
|
-
MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING: number;
|
|
96
|
-
UNFREEZING_SEEK_DELAY: number;
|
|
97
|
-
FREEZING_STALLED_DELAY: number;
|
|
98
|
-
UNFREEZING_DELTA_POSITION: number;
|
|
99
|
-
SEGMENT_SYNCHRONIZATION_DELAY: number;
|
|
100
|
-
MISSING_DATA_TRIGGER_SYNC_DELAY: number;
|
|
101
|
-
MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT: number;
|
|
102
|
-
MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE: number;
|
|
103
|
-
MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE: number;
|
|
104
|
-
MINIMUM_SEGMENT_SIZE: number;
|
|
105
|
-
APPEND_WINDOW_SECURITIES: {
|
|
106
|
-
START: number;
|
|
107
|
-
END: number;
|
|
108
|
-
};
|
|
109
|
-
MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL: number;
|
|
110
|
-
TEXT_TRACK_SIZE_CHECKS_INTERVAL: number;
|
|
111
|
-
BUFFER_PADDING: {
|
|
112
|
-
audio: number;
|
|
113
|
-
video: number;
|
|
114
|
-
other: number;
|
|
115
|
-
};
|
|
116
|
-
SEGMENT_PRIORITIES_STEPS: number[];
|
|
117
|
-
MAX_HIGH_PRIORITY_LEVEL: number;
|
|
118
|
-
MIN_CANCELABLE_PRIORITY: number;
|
|
119
|
-
EME_DEFAULT_VIDEO_CODECS: string[];
|
|
120
|
-
EME_DEFAULT_AUDIO_CODECS: string[];
|
|
121
|
-
EME_DEFAULT_WIDEVINE_ROBUSTNESSES: string[];
|
|
122
|
-
EME_DEFAULT_PLAYREADY_RECOMMENDATION_ROBUSTNESSES: string[];
|
|
123
|
-
EME_KEY_SYSTEMS: Partial<Record<string, string[]>>;
|
|
124
|
-
MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE: number;
|
|
125
|
-
MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE: number;
|
|
126
|
-
MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY: number;
|
|
127
|
-
OUT_OF_SYNC_MANIFEST_REFRESH_DELAY: number;
|
|
128
|
-
FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY: number;
|
|
129
|
-
DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0: number;
|
|
130
|
-
EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS: number;
|
|
131
|
-
EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION: number;
|
|
132
|
-
EME_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES: number;
|
|
133
|
-
FORCED_ENDED_THRESHOLD: number;
|
|
134
|
-
ADAP_REP_SWITCH_BUFFER_PADDINGS: {
|
|
135
|
-
video: {
|
|
136
|
-
before: number;
|
|
137
|
-
after: number;
|
|
138
|
-
};
|
|
139
|
-
audio: {
|
|
140
|
-
before: number;
|
|
141
|
-
after: number;
|
|
142
|
-
};
|
|
143
|
-
text: {
|
|
144
|
-
before: number;
|
|
145
|
-
after: number;
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
SOURCE_BUFFER_FLUSHING_INTERVAL: number;
|
|
149
|
-
CONTENT_REPLACEMENT_PADDING: number;
|
|
150
|
-
CACHE_LOAD_DURATION_THRESHOLDS: {
|
|
151
|
-
video: number;
|
|
152
|
-
audio: number;
|
|
153
|
-
};
|
|
154
|
-
STREAM_EVENT_EMITTER_POLL_INTERVAL: number;
|
|
155
|
-
DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR: number;
|
|
156
|
-
BUFFERED_HISTORY_RETENTION_TIME: number;
|
|
157
|
-
BUFFERED_HISTORY_MAXIMUM_ENTRIES: number;
|
|
158
|
-
MIN_BUFFER_AHEAD: number;
|
|
159
|
-
UPTO_CURRENT_POSITION_CLEANUP: number;
|
|
160
|
-
DEFAULT_VIDEO_REPRESENTATIONS_SWITCHING_MODE: "seamless";
|
|
161
|
-
DEFAULT_AUDIO_REPRESENTATIONS_SWITCHING_MODE: "seamless";
|
|
162
|
-
DEFAULT_VIDEO_TRACK_SWITCHING_MODE: "reload";
|
|
163
|
-
DEFAULT_AUDIO_TRACK_SWITCHING_MODE: "seamless";
|
|
164
|
-
};
|
|
9
|
+
import EventEmitter from "./utils/event_emitter";
|
|
10
|
+
interface IConfigHandlerEvents {
|
|
11
|
+
update: Partial<IDefaultConfig>;
|
|
12
|
+
}
|
|
13
|
+
declare class ConfigHandler extends EventEmitter<IConfigHandlerEvents> {
|
|
14
|
+
updated: boolean;
|
|
15
|
+
private _config;
|
|
165
16
|
update(config: Partial<IDefaultConfig>): void;
|
|
166
17
|
getCurrent(): IDefaultConfig;
|
|
167
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,YAAY,MAAM,uBAAuB,CAAC;AAEjD,UAAU,oBAAoB;IAC5B,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CACjC;AAED,cAAM,aAAc,SAAQ,YAAY,CAAC,oBAAoB,CAAC;IACrD,OAAO,UAAS;IACvB,OAAO,CAAC,OAAO,CAAkB;IAEjC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC;IAOtC,UAAU,IAAI,cAAc;CAG7B;AACD,QAAA,MAAM,aAAa,eAAsB,CAAC;AAC1C,eAAe,aAAa,CAAC"}
|
package/dist/commonjs/config.js
CHANGED
|
@@ -6,21 +6,68 @@
|
|
|
6
6
|
* Note that this should only be used for debugging purposes as the config is
|
|
7
7
|
* __NOT__ part of the RxPlayer API.
|
|
8
8
|
*/
|
|
9
|
+
var __extends = (this && this.__extends) || (function () {
|
|
10
|
+
var extendStatics = function (d, b) {
|
|
11
|
+
extendStatics = Object.setPrototypeOf ||
|
|
12
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
13
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
14
|
+
return extendStatics(d, b);
|
|
15
|
+
};
|
|
16
|
+
return function (d, b) {
|
|
17
|
+
if (typeof b !== "function" && b !== null)
|
|
18
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
19
|
+
extendStatics(d, b);
|
|
20
|
+
function __() { this.constructor = d; }
|
|
21
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
25
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
26
|
+
if (!m) return o;
|
|
27
|
+
var i = m.call(o), r, ar = [], e;
|
|
28
|
+
try {
|
|
29
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
30
|
+
}
|
|
31
|
+
catch (error) { e = { error: error }; }
|
|
32
|
+
finally {
|
|
33
|
+
try {
|
|
34
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
35
|
+
}
|
|
36
|
+
finally { if (e) throw e.error; }
|
|
37
|
+
}
|
|
38
|
+
return ar;
|
|
39
|
+
};
|
|
40
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
41
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
42
|
+
if (ar || !(i in from)) {
|
|
43
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
44
|
+
ar[i] = from[i];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
48
|
+
};
|
|
9
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
50
|
var default_config_1 = require("./default_config");
|
|
11
51
|
var deep_merge_1 = require("./utils/deep_merge");
|
|
12
|
-
var
|
|
52
|
+
var event_emitter_1 = require("./utils/event_emitter");
|
|
53
|
+
var ConfigHandler = /** @class */ (function (_super) {
|
|
54
|
+
__extends(ConfigHandler, _super);
|
|
13
55
|
function ConfigHandler() {
|
|
14
|
-
|
|
56
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
57
|
+
_this.updated = false;
|
|
58
|
+
_this._config = default_config_1.default;
|
|
59
|
+
return _this;
|
|
15
60
|
}
|
|
16
61
|
ConfigHandler.prototype.update = function (config) {
|
|
17
62
|
var newConfig = (0, deep_merge_1.default)(this._config, config);
|
|
18
63
|
this._config = newConfig;
|
|
64
|
+
this.updated = true;
|
|
65
|
+
this.trigger("update", config);
|
|
19
66
|
};
|
|
20
67
|
ConfigHandler.prototype.getCurrent = function () {
|
|
21
68
|
return this._config;
|
|
22
69
|
};
|
|
23
70
|
return ConfigHandler;
|
|
24
|
-
}());
|
|
71
|
+
}(event_emitter_1.default));
|
|
25
72
|
var configHandler = new ConfigHandler();
|
|
26
73
|
exports.default = configHandler;
|
|
@@ -39,8 +39,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
42
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
43
|
-
return g =
|
|
42
|
+
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);
|
|
43
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
44
44
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
45
45
|
function step(op) {
|
|
46
46
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -24,8 +24,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
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;
|
|
28
|
-
return g =
|
|
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
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -24,8 +24,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
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;
|
|
28
|
-
return g =
|
|
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
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker_main.d.ts","sourceRoot":"","sources":["../../../../../src/core/main/worker/worker_main.ts"],"names":[],"mappings":"AA+CA,MAAM,CAAC,OAAO,UAAU,oBAAoB,
|
|
1
|
+
{"version":3,"file":"worker_main.d.ts","sourceRoot":"","sources":["../../../../../src/core/main/worker/worker_main.ts"],"names":[],"mappings":"AA+CA,MAAM,CAAC,OAAO,UAAU,oBAAoB,SAgX3C"}
|
|
@@ -101,6 +101,9 @@ function initializeWorkerMain() {
|
|
|
101
101
|
* When set, emit playback observation made on the main thread.
|
|
102
102
|
*/
|
|
103
103
|
var playbackObservationRef = null;
|
|
104
|
+
onmessageerror = function (_msg) {
|
|
105
|
+
log_1.default.error("MTCI: Error when receiving message from main thread.");
|
|
106
|
+
};
|
|
104
107
|
onmessage = function (e) {
|
|
105
108
|
var _a, _b;
|
|
106
109
|
log_1.default.debug("Worker: received message", e.data.type);
|
|
@@ -364,6 +367,10 @@ function initializeWorkerMain() {
|
|
|
364
367
|
sendSegmentSinksStoreInfos(contentPreparer, msg.value.messageId);
|
|
365
368
|
break;
|
|
366
369
|
}
|
|
370
|
+
case "config-update" /* MainThreadMessageType.ConfigUpdate */: {
|
|
371
|
+
config_1.default.update(msg.value);
|
|
372
|
+
break;
|
|
373
|
+
}
|
|
367
374
|
default:
|
|
368
375
|
(0, assert_1.assertUnreachable)(msg);
|
|
369
376
|
}
|
|
@@ -24,8 +24,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
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;
|
|
28
|
-
return g =
|
|
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
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
package/dist/commonjs/core/segment_sinks/implementations/audio_video/audio_video_segment_buffer.js
CHANGED
|
@@ -39,8 +39,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
42
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
43
|
-
return g =
|
|
42
|
+
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);
|
|
43
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
44
44
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
45
45
|
function step(op) {
|
|
46
46
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -35,8 +35,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
-
return g =
|
|
38
|
+
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);
|
|
39
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
40
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
41
|
function step(op) {
|
|
42
42
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptation_stream.d.ts","sourceRoot":"","sources":["../../../../../src/core/stream/adaptation/adaptation_stream.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AASxE,OAAO,KAAK,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,EACE,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,uBAAuB,EACvB,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,GACnB,EAAE,0BAA0B,EAC7B,SAAS,EAAE,0BAA0B,EACrC,kBAAkB,EAAE,kBAAkB,GACrC,IAAI,
|
|
1
|
+
{"version":3,"file":"adaptation_stream.d.ts","sourceRoot":"","sources":["../../../../../src/core/stream/adaptation/adaptation_stream.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AASxE,OAAO,KAAK,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,EACE,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,uBAAuB,EACvB,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,GACnB,EAAE,0BAA0B,EAC7B,SAAS,EAAE,0BAA0B,EACrC,kBAAkB,EAAE,kBAAkB,GACrC,IAAI,CA6cN"}
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
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);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -363,16 +363,30 @@ function AdaptationStream(_a, callbacks, parentCancelSignal) {
|
|
|
363
363
|
* anything this function is doing and free allocated resources.
|
|
364
364
|
*/
|
|
365
365
|
function createRepresentationStream(representation, terminateCurrentStream, representationStreamCallbacks, fnCancelSignal) {
|
|
366
|
+
/** Set to `true` if we've encountered an error with this `RepresentationStream` */
|
|
367
|
+
var hasEncounteredError = false;
|
|
366
368
|
var bufferGoalCanceller = new task_canceller_1.default();
|
|
367
369
|
bufferGoalCanceller.linkToSignal(fnCancelSignal);
|
|
370
|
+
/** Actually built buffer size, in seconds. */
|
|
368
371
|
var bufferGoal = (0, reference_1.createMappedReference)(wantedBufferAhead, function (prev) {
|
|
369
|
-
return
|
|
372
|
+
return getBufferGoal(representation, prev);
|
|
370
373
|
}, bufferGoalCanceller.signal);
|
|
371
374
|
var maxBufferSize = adaptation.type === "video" ? maxVideoBufferSize : new reference_1.default(Infinity);
|
|
372
375
|
log_1.default.info("Stream: changing representation", adaptation.type, representation.id, representation.bitrate);
|
|
373
376
|
var updatedCallbacks = (0, object_assign_1.default)({}, representationStreamCallbacks, {
|
|
374
377
|
error: function (err) {
|
|
375
378
|
var _a;
|
|
379
|
+
if (hasEncounteredError) {
|
|
380
|
+
// A RepresentationStream might trigger multiple Errors (for example
|
|
381
|
+
// multiple segments it tried to push at once led to errors).
|
|
382
|
+
// In that case, we'll only consider the first Error.
|
|
383
|
+
//
|
|
384
|
+
// That could mean that we're hiding legitimate issues but handling
|
|
385
|
+
// multiple of those errors at once is too hard a task for now.
|
|
386
|
+
log_1.default.warn("Stream: Ignoring RepresentationStream error", err);
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
hasEncounteredError = true;
|
|
376
390
|
var formattedError = (0, errors_1.formatError)(err, {
|
|
377
391
|
defaultCode: "NONE",
|
|
378
392
|
defaultReason: "Unknown `RepresentationStream` error",
|
|
@@ -381,14 +395,16 @@ function AdaptationStream(_a, callbacks, parentCancelSignal) {
|
|
|
381
395
|
representationStreamCallbacks.error(err);
|
|
382
396
|
}
|
|
383
397
|
else {
|
|
398
|
+
log_1.default.warn("Stream: received BUFFER_FULL_ERROR", adaptation.type, representation.bitrate);
|
|
384
399
|
var wba = wantedBufferAhead.getValue();
|
|
385
400
|
var lastBufferGoalRatio = (_a = bufferGoalRatioMap.get(representation.id)) !== null && _a !== void 0 ? _a : 1;
|
|
386
401
|
// 70%, 49%, 34.3%, 24%, 16.81%, 11.76%, 8.24% and 5.76%
|
|
387
402
|
var newBufferGoalRatio = lastBufferGoalRatio * 0.7;
|
|
388
|
-
if (newBufferGoalRatio <= 0.05 || wba * newBufferGoalRatio <= 2) {
|
|
389
|
-
throw formattedError;
|
|
390
|
-
}
|
|
391
403
|
bufferGoalRatioMap.set(representation.id, newBufferGoalRatio);
|
|
404
|
+
if (newBufferGoalRatio <= 0.05 || getBufferGoal(representation, wba) <= 2) {
|
|
405
|
+
representationStreamCallbacks.error(formattedError);
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
392
408
|
// We wait 4 seconds to let the situation evolve by itself before
|
|
393
409
|
// retrying loading segments with a lower buffer goal
|
|
394
410
|
(0, cancellable_sleep_1.default)(4000, adapStreamCanceller.signal)
|
|
@@ -476,15 +492,25 @@ function AdaptationStream(_a, callbacks, parentCancelSignal) {
|
|
|
476
492
|
}, fnCancelSignal);
|
|
477
493
|
}
|
|
478
494
|
/**
|
|
479
|
-
*
|
|
495
|
+
* Returns how much media data should be pre-buffered for this
|
|
496
|
+
* `Representation`, according to the `wantedBufferAhead` setting and previous
|
|
497
|
+
* issues encountered with that `Representation`.
|
|
498
|
+
* @param {Object} representation - The `Representation` you want to buffer.
|
|
499
|
+
* @param {number} wba - The value of `wantedBufferAhead` set by the user.
|
|
480
500
|
* @returns {number}
|
|
481
501
|
*/
|
|
482
|
-
function
|
|
502
|
+
function getBufferGoal(representation, wba) {
|
|
483
503
|
var oldBufferGoalRatio = bufferGoalRatioMap.get(representation.id);
|
|
484
504
|
var bufferGoalRatio = oldBufferGoalRatio !== undefined ? oldBufferGoalRatio : 1;
|
|
485
505
|
if (oldBufferGoalRatio === undefined) {
|
|
486
506
|
bufferGoalRatioMap.set(representation.id, bufferGoalRatio);
|
|
487
507
|
}
|
|
488
|
-
|
|
508
|
+
if (bufferGoalRatio < 1 && wba === Infinity) {
|
|
509
|
+
// When `wba` is equal to `Infinity`, dividing it will still make it equal
|
|
510
|
+
// to `Infinity`. To make the `bufferGoalRatio` still have an effect, we
|
|
511
|
+
// just starts from a `wba` set to the high value of 5 minutes.
|
|
512
|
+
return 5 * 60 * 1000 * bufferGoalRatio;
|
|
513
|
+
}
|
|
514
|
+
return wba * bufferGoalRatio;
|
|
489
515
|
}
|
|
490
516
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/stream/adaptation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/stream/adaptation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,mBAAmB,SAAS,CAAC;AAE7B,eAAe,gBAAgB,CAAC"}
|
|
@@ -14,21 +14,6 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
29
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
30
|
-
};
|
|
31
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
18
|
var adaptation_stream_1 = require("./adaptation_stream");
|
|
33
|
-
__exportStar(require("./types"), exports);
|
|
34
19
|
exports.default = adaptation_stream_1.default;
|
|
@@ -35,8 +35,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
-
return g =
|
|
38
|
+
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);
|
|
39
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
40
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
41
|
function step(op) {
|
|
42
42
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/stream/period/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/stream/period/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,mBAAmB,SAAS,CAAC;AAE7B,eAAe,YAAY,CAAC"}
|
|
@@ -14,21 +14,6 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
29
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
30
|
-
};
|
|
31
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
18
|
var period_stream_1 = require("./period_stream");
|
|
33
|
-
__exportStar(require("./types"), exports);
|
|
34
19
|
exports.default = period_stream_1.default;
|
|
@@ -35,8 +35,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
-
return g =
|
|
38
|
+
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);
|
|
39
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
40
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
41
|
function step(op) {
|
|
42
42
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/stream/representation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAC3D,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/stream/representation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAC3D,mBAAmB,SAAS,CAAC;AAE7B,eAAe,oBAAoB,CAAC"}
|