rx-player 3.30.1-dev.2023032800 → 3.31.0-dev.2023052200

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 (96) hide show
  1. package/CHANGELOG.md +14 -2
  2. package/CONTRIBUTING.md +48 -168
  3. package/FILES.md +40 -92
  4. package/VERSION +1 -1
  5. package/dist/_esm5.processed/compat/browser_detection.d.ts +3 -1
  6. package/dist/_esm5.processed/compat/browser_detection.js +7 -2
  7. package/dist/_esm5.processed/compat/has_issues_with_high_media_source_duration.d.ts +21 -0
  8. package/dist/_esm5.processed/compat/has_issues_with_high_media_source_duration.js +26 -0
  9. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.js +1 -2
  10. package/dist/_esm5.processed/core/adaptive/buffer_based_chooser.d.ts +18 -1
  11. package/dist/_esm5.processed/core/adaptive/buffer_based_chooser.js +105 -24
  12. package/dist/_esm5.processed/core/adaptive/guess_based_chooser.js +6 -6
  13. package/dist/_esm5.processed/core/adaptive/utils/representation_score_calculator.d.ts +19 -1
  14. package/dist/_esm5.processed/core/adaptive/utils/representation_score_calculator.js +1 -1
  15. package/dist/_esm5.processed/core/api/debug/render.js +1 -1
  16. package/dist/_esm5.processed/core/api/public_api.js +2 -2
  17. package/dist/_esm5.processed/core/api/tracks_management/media_element_track_choice_manager.js +10 -1
  18. package/dist/_esm5.processed/core/api/tracks_management/track_choice_manager.js +20 -117
  19. package/dist/_esm5.processed/core/init/media_source_content_initializer.js +28 -3
  20. package/dist/_esm5.processed/core/init/utils/media_source_duration_updater.d.ts +2 -2
  21. package/dist/_esm5.processed/core/init/utils/media_source_duration_updater.js +29 -18
  22. package/dist/_esm5.processed/core/segment_buffers/index.d.ts +2 -2
  23. package/dist/_esm5.processed/core/stream/adaptation/utils/create_representation_estimator.js +1 -1
  24. package/dist/_esm5.processed/core/stream/period/period_stream.js +1 -1
  25. package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.d.ts +4 -2
  26. package/dist/_esm5.processed/core/stream/representation/utils/append_segment_to_buffer.js +2 -2
  27. package/dist/_esm5.processed/core/stream/representation/utils/push_init_segment.js +6 -2
  28. package/dist/_esm5.processed/errors/index.d.ts +2 -2
  29. package/dist/_esm5.processed/errors/media_error.d.ts +23 -1
  30. package/dist/_esm5.processed/errors/media_error.js +18 -5
  31. package/dist/_esm5.processed/manifest/adaptation.d.ts +17 -2
  32. package/dist/_esm5.processed/manifest/adaptation.js +67 -1
  33. package/dist/_esm5.processed/manifest/manifest.d.ts +1 -1
  34. package/dist/_esm5.processed/manifest/manifest.js +3 -3
  35. package/dist/_esm5.processed/manifest/period.js +1 -1
  36. package/dist/_esm5.processed/manifest/representation.d.ts +11 -1
  37. package/dist/_esm5.processed/manifest/representation.js +16 -0
  38. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/parse_from_document.d.ts +1 -1
  39. package/dist/_esm5.processed/parsers/manifest/dash/js-parser/parse_from_document.js +1 -1
  40. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -0
  41. package/dist/_esm5.processed/public_types.d.ts +6 -5
  42. package/dist/_esm5.processed/transports/smooth/isobmff/create_boxes.d.ts +4 -6
  43. package/dist/_esm5.processed/transports/smooth/isobmff/create_boxes.js +4 -6
  44. package/dist/rx-player.js +3086 -3024
  45. package/dist/rx-player.min.js +1 -1
  46. package/package.json +25 -26
  47. package/sonar-project.properties +1 -1
  48. package/src/compat/browser_detection.ts +7 -1
  49. package/src/compat/has_issues_with_high_media_source_duration.ts +27 -0
  50. package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +147 -48
  51. package/src/core/adaptive/adaptive_representation_selector.ts +1 -2
  52. package/src/core/adaptive/buffer_based_chooser.ts +143 -25
  53. package/src/core/adaptive/guess_based_chooser.ts +9 -8
  54. package/src/core/adaptive/utils/representation_score_calculator.ts +22 -2
  55. package/src/core/api/debug/render.ts +1 -1
  56. package/src/core/api/public_api.ts +2 -2
  57. package/src/core/api/tracks_management/media_element_track_choice_manager.ts +17 -8
  58. package/src/core/api/tracks_management/track_choice_manager.ts +20 -132
  59. package/src/core/init/media_source_content_initializer.ts +32 -4
  60. package/src/core/init/utils/media_source_duration_updater.ts +31 -19
  61. package/src/core/segment_buffers/index.ts +2 -0
  62. package/src/core/stream/adaptation/utils/create_representation_estimator.ts +2 -1
  63. package/src/core/stream/period/period_stream.ts +2 -1
  64. package/src/core/stream/representation/utils/append_segment_to_buffer.ts +8 -3
  65. package/src/core/stream/representation/utils/push_init_segment.ts +7 -1
  66. package/src/errors/__tests__/media_error.test.ts +6 -6
  67. package/src/errors/index.ts +4 -1
  68. package/src/errors/media_error.ts +67 -1
  69. package/src/manifest/__tests__/period.test.ts +90 -45
  70. package/src/manifest/adaptation.ts +77 -2
  71. package/src/manifest/manifest.ts +5 -3
  72. package/src/manifest/period.ts +2 -1
  73. package/src/manifest/representation.ts +23 -1
  74. package/src/parsers/manifest/dash/js-parser/parse_from_document.ts +1 -1
  75. package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +1 -0
  76. package/src/parsers/texttracks/ttml/parse_ttml.ts +1 -1
  77. package/src/public_types.ts +8 -3
  78. package/src/transports/smooth/isobmff/create_boxes.ts +4 -6
  79. package/src/typings/globals.d.ts +21 -21
  80. package/scripts/doc-generator/construct_table_of_contents.js +0 -76
  81. package/scripts/doc-generator/convert_MD_to_HMTL.js +0 -26
  82. package/scripts/doc-generator/create_documentation.js +0 -331
  83. package/scripts/doc-generator/create_documentation_page.js +0 -209
  84. package/scripts/doc-generator/create_page.js +0 -210
  85. package/scripts/doc-generator/generate_header_html.js +0 -147
  86. package/scripts/doc-generator/generate_page_html.js +0 -115
  87. package/scripts/doc-generator/generate_page_list_html.js +0 -92
  88. package/scripts/doc-generator/generate_sidebar_html.js +0 -85
  89. package/scripts/doc-generator/get_search_data_for_content.js +0 -137
  90. package/scripts/doc-generator/index.js +0 -34
  91. package/scripts/doc-generator/parse_doc_configs.js +0 -327
  92. package/scripts/doc-generator/scripts/lunr.js +0 -10
  93. package/scripts/doc-generator/scripts/script.js +0 -451
  94. package/scripts/doc-generator/styles/code.css +0 -99
  95. package/scripts/doc-generator/styles/style.css +0 -835
  96. package/scripts/doc-generator/utils.js +0 -74
package/CHANGELOG.md CHANGED
@@ -1,15 +1,27 @@
1
1
  # Changelog
2
2
 
3
- ## v3.30.1-dev.2023032800 (2023-03-28)
3
+ ## v3.31.0-dev.2023052200 (2023-05-22)
4
+
5
+ ### Features
6
+
7
+ - Add `trackInfo` property to some `MediaError` to expose information on the track that caused the error [#1241]
4
8
 
5
9
  ### Bug fixes
6
10
 
7
11
  - DASH: Fix issue which could lead to infinite rebuffering when switching between multiple Periods [#1232]
8
12
  - Return actual ending duration through the `getVideoDuration` method when playing dynamic contents whose future end is already known [#1235]
13
+ - DASH/WASM: actually reject the `DASH_WASM.initialize`'s Promise if it fails [#1238]
14
+ - On the PlayStation 5, set `Infinity` MediaSource duration for live contents to prevent playback issues [#1250]
15
+ - DASH/WASM: actually reject the DASH_WASM.initialize's Promise if it fails [#1238]
9
16
 
10
17
  ### Other improvements
11
18
 
12
- - adaptive: Perform various adaptive tweaks to avoid switching too much between qualities in some conditions
19
+ - adaptive: Perform various adaptive tweaks to avoid switching too much between qualities in some conditions [#1237]
20
+ - Directfile: Detect "forced" subtitles on Safari when playing directfile contents (such as HLS) [#1239]
21
+ - DRM: Reload when playback is unexpectedly frozen with encrypted but only decipherable data in the buffer [#1236]
22
+ - Improve `"direct"` `audioTrackSwitchingMode` compatibility by re-seeking [#1246]
23
+ - The `DEBUG_ELEMENT` feature now uses the `monospace` fallback font as a default for a better rendering on apple devices
24
+ - doc: externalize documentation-generator code
13
25
 
14
26
 
15
27
  ## v3.30.0 (2023-03-07)
package/CONTRIBUTING.md CHANGED
@@ -1,32 +1,6 @@
1
- # Contributing to the RxPlayer #################################################
2
-
3
- ## Table of contents ###########################################################
4
-
5
- - [Issues and new features](#issues)
6
- - [Reading the current code](#reading)
7
- - [Code style](#code)
8
- - [Linting](#code-lint)
9
- - [Types](#code-types)
10
- - [Forbidden functions and classes](#code-forbidden)
11
- - [Starting the demo page](#demo)
12
- - [Building the demo and serving it](#demo-running)
13
- - [Using HTTPS](#demo-https)
14
- - [Creating a commit](#commit)
15
- - [Checks](#commit-checks)
16
- - [Convention](#commit-name)
17
- - [The test suite](#testing)
18
- - [Unit tests](#testing-unit)
19
- - [Integration tests](#testing-integration)
20
- - [Memory tests](#testing-memory)
21
- - [Documentation](#doc)
22
- - [Opening a pull request](#pr)
23
- - [Checks](#pr-checks)
24
- - [Which branch to merge to](#pr-branch)
25
-
26
-
27
-
28
- <a name="issues"></a>
29
- ## Issues and new features #####################################################
1
+ # Contributing to the RxPlayer
2
+
3
+ ## Issues and new features
30
4
 
31
5
  If you detect a problem with the RxPlayer, or if you desire a new feature,
32
6
  please first [open an issue on the github's
@@ -38,12 +12,11 @@ Those have to follow the conventions defined below.
38
12
 
39
13
 
40
14
 
41
- <a name="reading"></a>
42
- ## Reading the current code ####################################################
15
+ ## Reading the current code
43
16
 
44
17
  Even if we hope the current code is straightforward, readable and commented
45
18
  enough we can still admit that going blind into the codebase can be hard at
46
- first (as it would be for any non-small codebase).
19
+ first as this is a pretty big technical project on a specific matter.
47
20
 
48
21
  We thus encourage you to rely on the architecture documentation you can usually
49
22
  find alongside the code, in `README.md` files.
@@ -51,7 +24,7 @@ You can for example start by reading `src/README.md`, to have a clearer idea
51
24
  of the general code architecture of the player.
52
25
 
53
26
  Also, for a more exhaustive approach to the documentation of the project's file
54
- organization, you can look at `FILES.md` at the root of this repository.
27
+ organization, you can look at [`FILES.md`](./FILES.md).
55
28
 
56
29
  The code of the RxPlayer being heavily modularized, you should not need to read
57
30
  the whole documentation to be ready, only the parts you want to update
@@ -59,18 +32,17 @@ the whole documentation to be ready, only the parts you want to update
59
32
 
60
33
 
61
34
 
62
- <a name="code"></a>
63
- ## Code style ##################################################################
35
+ ## Code style
64
36
 
65
- <a name="code-lint"></a>
66
- ### Linting ####################################################################
37
+ ### Linting
67
38
 
68
39
  The code style in `src` is automatically checked by a "linter", `eslint`.
69
40
 
70
41
  It basically follows those principles:
71
42
  - 2 spaces indentation
72
43
  - 90 columns maximum
73
- - optimize your code for readability
44
+ - readability and being explicit is generally better than performance and
45
+ being smart
74
46
 
75
47
  You can easily check if you followed our style rules by calling `npm run lint`.
76
48
 
@@ -79,10 +51,9 @@ calling `npm run lint:demo`, or the style of the test files (in the `tests`
79
51
  directory) by calling `npm run lint:tests`.
80
52
 
81
53
 
82
- <a name="code-types"></a>
83
- ### Types ######################################################################
54
+ ### Types
84
55
 
85
- #### General TypeScript rules ##################################################
56
+ #### General TypeScript rules
86
57
 
87
58
  We try to be as strict as possible with types:
88
59
 
@@ -91,9 +62,6 @@ We try to be as strict as possible with types:
91
62
  - the `as` TypeScript keyword, used for type casting, should also be avoided
92
63
  as much as possible.
93
64
 
94
- - the `is` keyword is fine in some situations, but simpler solutions should be
95
- preferred.
96
-
97
65
  This is to be sure we can detect as much as possible type errors automatically
98
66
  with TypeScript.
99
67
 
@@ -101,7 +69,7 @@ with TypeScript.
101
69
 
102
70
  TypeScript's `type` and `interface` should all be named beginning with the
103
71
  letter `I`, for easier identification purposes\*:
104
- ```
72
+ ```ts
105
73
  interface IMyObject {
106
74
  someKey: string;
107
75
  }
@@ -110,88 +78,48 @@ type IStringOrNumber = string |
110
78
  number;
111
79
  ```
112
80
 
113
- \*We know that this rule is a controversial subject amongst TypeScript
114
- developpers, yet we still decide to enforce it for now.
115
-
116
- #### Generic parameters typing #################################################
117
-
118
- Generic parameters are usually named in order `T` (for the first generic
119
- parameter), then `U` (if there's two), then `V` (if there's three):
120
-
121
- Examples:
122
- ```
123
- type IMyGenericType<T> = Array<T>;
124
-
125
- type IMyGenericType2<T, U> = Promise<T> |
126
- U;
127
-
128
- function mergeThree<T, U, V>(
129
- arg1: T,
130
- arg2: U,
131
- arg3: V
132
- ) : T & U & V {
133
- return Object.assign({}, arg1, arg2, arg3);
81
+ `enum`s and `const enum`s, which have the particularity in TypeScript of
82
+ actually having an influence on the outputed code, do not follow this rule
83
+ however (because those are not just types erased during transpilation):
84
+ ```ts
85
+ enum MyEnum {
86
+ ValueA = 1,
87
+ ValueB = 2,
134
88
  }
135
- ```
136
89
 
137
- Some exceptions exist like for things like key-values couples, which can be named
138
- respectively `K` and `V`:
139
- ```
140
- type IMyMap<K, V> = Map<K, V>;
141
- ```
142
-
143
- This is a general convention for generic parameters inherited from Java, and
144
- re-used by TypeScript, and it helps identifying which type is a generic
145
- parameter vs which type is a real type (no prefix) vs which type is a type
146
- definition (prefixed by `I`).
147
-
148
- If what they correspond to is not obvious (and if there's more than one, it
149
- might well be), you're encouraged to add a more verbose and clear name, that you
150
- should prefix by `T`:
151
- ```
152
- function loadResource<TResourceFormat>(
153
- url : string
154
- ) : Promise<TResourceFormat> {
155
- // ...
90
+ const enum MyConstEnum {
91
+ Value1 = 1,
92
+ Value2 = 2,
156
93
  }
157
94
  ```
158
95
 
159
- However note that typing rules for generic parameters is a very minor
160
- consideration and may not always need to be respected depending on the code it
161
- is applied on.
162
- In the end, it will be up to the RxPlayer's maintainers to decide that those
163
- rules should be enforced or not on a given code.
164
-
96
+ \*We know that this rule is a controversial subject amongst TypeScript
97
+ developpers, yet we still decide to enforce it for now.
165
98
 
166
- <a name="code-forbidden"></a>
167
- ### Forbidden functions and classes ############################################
99
+ ### Forbidden functions and classes
168
100
 
169
101
  Some native functions, methods or classes should never be used to ensure
170
- compatibility with every browsers. To work around those, we usually rely on
102
+ compatibility with most browsers. To work around those, we usually rely on
171
103
  "ponyfills" which are JavaScript re-implementations.
172
104
 
173
105
  This concerns the following static methods:
174
106
  - `Object.assign`: use `src/utils/object_assign.ts` instead
175
107
  - `Object.values`: use `src/utils/object_values.ts` instead
176
108
 
177
- The following methods:
109
+ And the following methods:
178
110
  - `Array.prototype.includes`: use `src/utils/array_includes.ts` instead
179
111
  - `Array.prototype.find`: use `src/utils/array_find.ts` instead
180
112
  - `Array.prototype.findIndex`: use `src/utils/array_find_index.ts` instead
181
113
  - `String.prototype.startsWith`: use `src/utils/starts_with.ts` instead
182
114
  - `String.prototype.substr`: use `String.prototype.substring` instead
183
115
  - `NodeList.prototype.forEach`: use a regular for loop instead
184
-
185
- The following class:
186
- - `Promise`: use `src/utils/promise.ts` instead
116
+ - `Promise.prototype.finally`: Use `then` or both `then` and `catch` of that
117
+ Promise's methods instead.
187
118
 
188
119
 
120
+ ## The demo page
189
121
 
190
- <a name="demo"></a>
191
- ## Starting the demo page ######################################################
192
-
193
- <a name="demo-running"></a>
194
- ### Building the demo and serving it ###########################################
122
+ ### Building the demo and serving it
195
123
 
196
124
  You might want to quickly test your code modification(s) on a real use case.
197
125
 
@@ -227,10 +155,10 @@ npm run standalone
227
155
 
228
156
  Both will detect when the RxPlayer's files (or even the demo files) are updated
229
157
  and perform a new build when that's the case. In that way, the server will
230
- always serve the last local version of the code.
158
+ always serve the last local version of the code. Note however that hot-reload is
159
+ not enabled currently, you'll have to refresh the page yourself.
231
160
 
232
- <a name="demo-https"></a>
233
- ### Serving the demo page through HTTPS ########################################
161
+ ### Serving the demo page through HTTPS
234
162
 
235
163
  You might want to serve the demo via HTTPS. This is for example needed to be
236
164
  able to play encrypted contents in Chrome.
@@ -252,52 +180,18 @@ when going to one of the demo pages in HTTPS. In most browsers, you can however
252
180
  safely ignore that warning.
253
181
 
254
182
 
255
- <a name="commit"></a>
256
- ## Creating a commit ###########################################################
183
+ ## Creating a commit
257
184
 
258
- <a name="commit-checks"></a>
259
- ### Checks #####################################################################
185
+ ### Checks
260
186
 
261
- Every commits in a PR should pass our quick checks (linter, typescript check
262
- and unit tests). To check if that's the case, you can run locally the `check`
187
+ Every commits in a PR should pass our quick checks (linter and TypeScript
188
+ check). To check if that's the case, you can run locally the `check`
263
189
  script by calling `npm run check`.
264
190
 
265
- Those checks give us some guarantees that every merged commit in the `master`
266
- branch is stable enough.
267
-
268
- This gives us more confidence on our code and also allows more advanced
269
- debugging if we detect a regression by the usage of tools such as git-bisect.
270
-
271
-
272
- <a name="commit-name"></a>
273
- ### Convention #################################################################
274
-
275
- When creating a new commit it is advised (though not enforced) to add a message
276
- containing multiple paragraphs.
277
-
278
- The first paragraph should be a short summary of what the commit does, short
279
- enough so it can usually be displayed on one line - probably like the usual
280
- commit messages you are used to.
281
- The following paragraphs can be as long as you want (note that relying on a
282
- [maximum column width of around 72 is a sensible
283
- default](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
284
- even if we do not enforce that either).
285
191
 
286
- The goal here is to help understand your changes at a later time, in case things
287
- go wrong in the future.
192
+ ## The test suite
288
193
 
289
- _You can create a commit with multiple paragraphs either through the command
290
- line either by setting multiple `-m` options to git-commit, or just by calling
291
- `git commit` with no `-m` option and editing the message manually in the opened
292
- editor._
293
-
294
-
295
-
296
- <a name="testing"></a>
297
- ## The test suite ##############################################################
298
-
299
- <a name="testing-unit"></a>
300
- ### Unit tests #################################################################
194
+ ### Unit tests
301
195
 
302
196
  Unit tests test function implementations. Mostly to check if they give a sane
303
197
  output for every input given.
@@ -307,15 +201,14 @@ Writing unit tests for new code is encouraged.
307
201
  Unit tests are written in a \_\_tests\_\_ directory, itself created in the same
308
202
  directory that the code it tests.
309
203
 
310
- They are written with the help of the Jest library and are named the following
311
- way: `filename_containing_the_function_tested.test.ts`.
204
+ They are written and run with the help of the Jest library and are named the
205
+ following way: `filename_containing_the_function_tested.test.ts`.
312
206
 
313
207
  To understand how to create a new test file, you can take inspiration from
314
208
  the current unit tests.
315
209
 
316
210
 
317
- <a name="testing-integration"></a>
318
- ### Integration tests ##########################################################
211
+ ### Integration tests
319
212
 
320
213
  What we call integration tests are tests testing the entire API of the RxPlayer.
321
214
 
@@ -332,8 +225,7 @@ If you want to know how it works, we invite you to rely on the already created
332
225
  tests and to read the corresponding files.
333
226
 
334
227
 
335
- <a name="testing-memory"></a>
336
- ### Memory tests ###############################################################
228
+ ### Memory tests
337
229
 
338
230
  Memory tests replicate simple scenarios and try to detect memory leaks.
339
231
 
@@ -342,8 +234,7 @@ You can also help us improving our memory tests. Those are written in
342
234
 
343
235
 
344
236
 
345
- <a name="doc"></a>
346
- ## Documentation ###############################################################
237
+ ## Documentation
347
238
 
348
239
  The documentation is written in the `doc` directory, at the root of the project.
349
240
 
@@ -353,20 +244,9 @@ calling the `doc` script through `npm run doc`.
353
244
 
354
245
 
355
246
 
356
- <a name="pr"></a>
357
- ## Opening a pull request ######################################################
358
-
359
- <a name="pr-checks"></a>
360
- ### Checks #####################################################################
361
-
362
- Before doing a Pull Request, please ensure that all integration tests pass by
363
- calling `npm run test:integration`.
364
-
365
- Then, please call `npm run test:memory`, which tests for memory leaks.
366
-
247
+ ## Opening a pull request
367
248
 
368
- <a name="pr-branch"></a>
369
- ### Which branch to merge to ###################################################
249
+ ### Which branch to merge to
370
250
 
371
251
  Pull requests for bug fixes, new tests or documentation should be done on the
372
252
  `master` branch.
package/FILES.md CHANGED
@@ -1,44 +1,14 @@
1
- # File architecture ############################################################
1
+ # File architecture
2
2
 
3
3
  This page describes how the player files are organized. Each chapter go through
4
4
  a single directory or subdirectory, in alphabetical order.
5
5
 
6
6
 
7
- ## Table of Contents ###########################################################
8
-
9
- - [demo/: Demos of rx-player implementations](#demo)
10
- - [dist/: Player builds](#dist)
11
- - [doc/: Player documentation](#doc)
12
- - [scripts/: Tools and scripts](#scripts)
13
- - [src/: the source code](#src)
14
- - [src/compat/: The compatibility files](#src-compat)
15
- - [src/core/: The core files](#src-core)
16
- - [src/errors/: Error definitions](#src-errors)
17
- - [src/experimental/: Experimental features](#src-experimental)
18
- - [src/features/: Feature switching](#src-features)
19
- - [src/manifest/: The Manifest class](#src-manifest)
20
- - [src/transports/: The transport protocols](#src-transports)
21
- - [src/parsers/: The parsing files](#src-parsers)
22
- - [src/typings/: Typescript typings](#src-typings)
23
- - [src/utils/: The utils](#src-utils)
24
- - [src/core/: The core directory](#core)
25
- - [src/core/adaptive/: The adaptive bitrate code](#core-abr)
26
- - [src/core/api/: The API definition](#core-api)
27
- - [src/core/stream/: Load the right segments](#core-stream)
28
- - [src/core/decrypt/: Decryption management](#core-decrypt)
29
- - [src/core/fetchers/: The fetchers](#core-fetchers)
30
- - [src/core/segment_buffers/: The Media buffers](#core-sb)
31
- - [src/core/init/: Media streaming logic](#core-init)
32
- - [src/**/__tests__: the unit tests directories](#src-tests)
33
- - [tests/: the player's tests](#tests)
34
-
35
-
36
- <a name="demo"></a>
37
- ## The demo/ directory: Demos of rx-player implementations #####################
38
-
39
- Demonstration of functional codebases implementing the rx-player.
40
-
41
- At the time of writing, there are two demos:
7
+ ## `demo/`: Demo applications
8
+
9
+ The `demo/` directory contains demos of application using the RxPlayer.
10
+
11
+ At the time of writing, there are two distinct demos:
42
12
 
43
13
  - _full_: Demo with a graphic interface, written with the React library, to
44
14
  showcase what the player can do
@@ -48,36 +18,35 @@ At the time of writing, there are two demos:
48
18
  the displayed page.
49
19
 
50
20
 
51
- <a name="dist"></a>
52
- ## The dist/ directory: Player builds ##########################################
21
+ ## `dist/`: Builds
53
22
 
54
- Store the player builds of the last version released.
23
+ The `demo/` directory stores the player builds of the last version released.
55
24
 
56
- Contains two files: the minified (``rx-player.min.js``) and the non-minified
57
- files (``rx-player.js``). Both are automatically generated with scripts at every
58
- new release.
25
+ Contains the minified (``rx-player.min.js``) and the non-minified files
26
+ (``rx-player.js``). Both are automatically generated with scripts at every new
27
+ release.
59
28
 
60
29
  Two directories, namely ``_esm5.raw`` and ``_esm5.processed`` can also be
61
30
  generated in here if the right scripts are called.
62
31
  These allow to publish more modular codebases to npm.
63
32
 
64
33
 
65
- <a name="doc"></a>
66
- ## The doc/ directory: Player documentation ####################################
34
+ ## `doc/`: Documentation
67
35
 
68
- Documentation, mostly in markdown, of various subjects related to the rx-player:
36
+ The `doc/` directory contains the RxPlayer's documentation, mostly written in
37
+ markdown, on various subjects related to the rx-player:
69
38
  - API documentation
70
39
  - tutorials
71
40
  - list of deprecated APIs...
72
41
  - how to transition between RxPlayer versions
42
+ - how to contribute
73
43
  - etc.
74
44
 
75
45
 
76
- <a name="scripts"></a>
77
- ## The scripts/ directory: scripts #####################################
46
+ ## `scripts/`: Project-managing scripts
78
47
 
79
- Contains various scripts used to help the test and the management of the player
80
- code.
48
+ The `scripts/` directory contains various scripts used to help the test and the
49
+ management of the player code.
81
50
 
82
51
  For example:
83
52
  - generating one of the demo and starting the server to run it
@@ -86,16 +55,14 @@ For example:
86
55
  - generating the rx-player build before publishing on npm
87
56
 
88
57
 
89
- <a name="src"></a>
90
- ## The src/ directory: the source code #########################################
58
+ ## `src/`: The source code
91
59
 
92
- The src contains the entire source code of the rx-player.
60
+ The `src` directory contains the entire source code of the rx-player.
93
61
 
94
62
  It is subdivized into subdirectories which are defined here.
95
63
 
96
64
 
97
- <a name="src-compat"></a>
98
- ### src/compat/: The compatibility files #######################################
65
+ ### `src/compat/`: Compatibility files
99
66
 
100
67
  ``src/compat`` contains functions allowing to use browser APIs in a
101
68
  cross-browser manner.
@@ -110,8 +77,7 @@ Every functions needed in the rest of the code are exported in
110
77
  ``import { whatINeed } from "../compat";``)
111
78
 
112
79
 
113
- <a name="src-core"></a>
114
- ### src/core/: The core files ##################################################
80
+ ### `src/core/`: Core logic
115
81
 
116
82
  Defines the logic and behavior of the player, regardless of the browser and of
117
83
  the streaming technology used.
@@ -126,22 +92,19 @@ This directory contains other subdirectories which are listed in the next
126
92
  chapter.
127
93
 
128
94
 
129
- <a name="src-errors"></a>
130
- ### src/errors/: Error definitions #############################################
95
+ ### `src/errors/`: Error definitions
131
96
 
132
97
  Contains the definition of the error classes used in the rx-player and
133
98
  accessible through the API.
134
99
 
135
100
 
136
- <a name="src-experimental"></a>
137
- ### src/experimental/: Experimental features ###################################
101
+ ### `src/experimental/`: Experimental features
138
102
 
139
103
  You will find here experimental features. Those are tested features who might
140
104
  completely change their API in new player versions.
141
105
 
142
106
 
143
- <a name="src-features"></a>
144
- ### src/features/: Feature switching ###########################################
107
+ ### `src/features/`: Feature switching
145
108
 
146
109
  This manage activated or deactivated features (e.g. DASH, TTML subtitles
147
110
  parsing).
@@ -150,16 +113,14 @@ It exports an object defining the different activated features and provide utils
150
113
  to initialize and update them.
151
114
 
152
115
 
153
- <a name="src-manifest"></a>
154
- ### src/manifest/: The Manifest class ##########################################
116
+ ### `src/manifest/`: Manifest Object definition
155
117
 
156
118
  Defines a common `Manifest` class, regardless of the streaming technology (DASH,
157
119
  HSS...). This class is then used by the rest of the RxPlayer, to allow
158
120
  interaction with it without considering the underlying technology used.
159
121
 
160
122
 
161
- <a name="src-transports"></a>
162
- ### src/transports/: The transport protocols ###################################
123
+ ### `src/transports/`: Streaming protocols implementation
163
124
 
164
125
  Defines a common interface for multiple streaming technologies (DASH, HSS).
165
126
 
@@ -175,8 +136,7 @@ As in most of the code of the rx-player, everything used in the other parts of
175
136
  the code is exported in the index.js file at the root of this directory.
176
137
 
177
138
 
178
- <a name="src-parsers"></a>
179
- ### src/parsers/: The parsers ##################################################
139
+ ### `src/parsers/`: The parsers
180
140
 
181
141
  Functions to parse various formats into the same interface.
182
142
 
@@ -187,22 +147,19 @@ The parsed data being either:
187
147
  - image containers: BIF
188
148
 
189
149
 
190
- <a name="src-typings"></a>
191
- ### src/typings/: Typescript typings ###########################################
150
+ ### `src/typings/`: Typescript typings
192
151
 
193
152
  This directory contains only declaration files for TypeScript. It is
194
153
  automatically added as a `typeRoots` when the TypeScript code is transpiled.
195
154
 
196
155
 
197
- <a name="src-utils"></a>
198
- ### src/utils/: The utils ######################################################
156
+ ### `src/utils/`: Util functions
199
157
 
200
158
  This directory contains general helpers which are used in different parts of the
201
159
  rx-player code.
202
160
 
203
161
 
204
- <a name="core"></a>
205
- ## The src/core/ directory #####################################################
162
+ ## Inside `src/core/`
206
163
 
207
164
  As written in the previous chapter, this is the "core" of the player, where the
208
165
  logic is defined.
@@ -210,8 +167,7 @@ logic is defined.
210
167
  As this directory is versatile and complicated, it also deserves its own chapter.
211
168
 
212
169
 
213
- <a name="core-abr"></a>
214
- ### src/core/adaptive/: The adaptive bitrate code ##############################
170
+ ### `src/core/adaptive/`: Adaptive BitRate logic
215
171
 
216
172
  Defines functions which manages the adaptive streaming part of the player.
217
173
 
@@ -226,29 +182,25 @@ This allows to isolate this complex part and facilitate future refactoring and
226
182
  improvements.
227
183
 
228
184
 
229
- <a name="core-api"></a>
230
- ### src/core/api/: The API definition ##########################################
185
+ ### `src/core/api/`: API definition
231
186
 
232
187
  Defines the rx-player API. This is the part the library user will directly
233
188
  interact with.
234
189
 
235
190
 
236
- <a name="core-stream"></a>
237
- ### src/core/stream/: Load the right segments ##################################
191
+ ### `src/core/stream/`: Segment-picking logic
238
192
 
239
193
  The code there calculate which segments should be downloaded, ask for their
240
194
  download and push the segments into the `SegmentBuffers`.
241
195
 
242
196
 
243
- <a name="core-decrypt"></a>
244
- ### src/core/decrypt/: Decryption management ###################################
197
+ ### `src/core/decrypt/`: Decryption handling
245
198
 
246
199
  Defines functions allowing to handle encrypted contents through the EME browser
247
200
  APIs.
248
201
 
249
202
 
250
- <a name="core-fetchers"></a>
251
- ### src/core/fetchers/: The fetchers ###########################################
203
+ ### `src/core/fetchers/`: Load resources
252
204
 
253
205
  Handle the segments and Manifest downloading pipelines (load and parse) as
254
206
  defined in the ``src/transports/`` directory.
@@ -258,8 +210,7 @@ It facilitates the role of loading the Manifest and new segments for the rest of
258
210
  the core.
259
211
 
260
212
 
261
- <a name="core-sb"></a>
262
- ### src/core/segment_buffers/: The media buffers ###############################
213
+ ### `src/core/segment_buffers/`: Media buffers
263
214
 
264
215
  Code allowing to interact with the media buffers called `SegmentBuffers`.
265
216
 
@@ -272,8 +223,7 @@ for other type of contents (like subtitles), we rely on completely custom media
272
223
  buffers implementations.
273
224
 
274
225
 
275
- <a name="core-init"></a>
276
- ### src/core/init/: Content initialization #####################################
226
+ ### `src/core/init/`: Content initialization and orchestration
277
227
 
278
228
  This is the central part which download manifests, initialize MSE and EME APIs,
279
229
  instanciate the central `StreamOrchestrator` (which will allow to download and
@@ -281,8 +231,7 @@ push segments so the content can play) and link together many subparts of the
281
231
  player.
282
232
 
283
233
 
284
- <a name="src-tests"></a>
285
- ## src/**/__tests__: the unit tests directories ################################
234
+ ## `src/**/__tests__`: Unit tests
286
235
 
287
236
  You will find multiple directories named `__tests__` in the RxPlayer.
288
237
  Those contain unit tests and are put in the same directory than the code it
@@ -304,8 +253,7 @@ Their filename don't follow the same convention than single-source unit tests
304
253
  but should still be suffixed by `.test.ts`.
305
254
 
306
255
 
307
- <a name="tests"></a>
308
- ## The tests/ directory: the player's tests ####################################
256
+ ## `tests/`: The RxPlayer's general tests
309
257
 
310
258
  This directory contains most testing code for the RxPlayer.
311
259