rx-player 3.28.0-dev.2022062000 → 3.28.0-dev.2022062300

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rx-player",
3
3
  "author": "Canal+",
4
- "version": "3.28.0-dev.2022062000",
4
+ "version": "3.28.0-dev.2022062300",
5
5
  "description": "Canal+ HTML5 Video Player",
6
6
  "main": "./dist/rx-player.js",
7
7
  "keywords": [
@@ -1,7 +1,7 @@
1
1
  sonar.projectKey=rx-player
2
2
  sonar.organization=rx-player
3
3
  sonar.projectName=rx-player
4
- sonar.projectVersion=3.28.0-dev.2022062000
4
+ sonar.projectVersion=3.28.0-dev.2022062300
5
5
  sonar.sources=./src,./demo,./tests
6
6
  sonar.exclusions=demo/full/bundle.js,demo/standalone/lib.js,demo/bundle.js
7
7
  sonar.host.url=https://sonarcloud.io
package/src/README.md CHANGED
@@ -12,84 +12,100 @@ To better understand the player's architecture, you can find below a
12
12
  (simplified!) schema of it:
13
13
 
14
14
  ```
15
+ +---------------------+
16
+ | ---> Call / request |
17
+ +---------------------+
18
+
15
19
  +---------------------------------------------+ ,,,,,,,
16
20
  | | ( CDN )
17
21
  | Application/UI | ```````
18
22
  | | ^
19
23
  +---------------------------------------------+ |
20
- | ^ |
21
- | ~ |
24
+ | |
25
+ | |
22
26
  -----RxPlayer------------------------------------------------------------------|----------
23
- | ~ +---------------------+ |
24
- V ~ Front-facing API | ---> Call / request | |
25
- +-------------------------------------------+ | ~~~> Send events | |
26
- | Public API | +---------------------+ |
27
+ | |
28
+ V Front-facing API |
29
+ +-------------------------------------------+ |
30
+ | Public API | |
27
31
  | (./core/api) | +----------------+
28
32
  +-------------------------------------------+ | |
29
- +--------------------+ | | ^ +--------------> | transports |
30
- | TrackChoiceManager | <--+ | ~ | +~~~~~~~~~~~~~ | (./transports) |
31
- | (./core/api) | | ~ | ~ | |
32
- +--------------------+ | ~ | ~ +----------------+
33
- Facilitate track V ~ | ~ Abstract the streaming ^ ~
34
- switching for +---------------+ | ~ protocol | ~
35
- the API | | | V | ~
36
- +----------------+ | | +--------------------------+ | ~
37
- | Content | | Init | ------> | | | ~
38
- | Decryptor | <---- | (./core/init) | <~~~~~~ | Manifest Fetcher | | ~
39
- |(./core/decrypt)| ~~~~> | | |(./core/fetchers/manifest)| | ~
40
- | | | | | | | ~
41
- +----------------+ +---------------+ +--------------------------+ | ~
42
- Negotiate content | ^ Initialize Load and refresh the Manifest | ~
43
- decryption | ~ playback and | ~
44
- | ~ create/connect | ~
45
- | ~ modules | ~
46
- Stream (./core/stream) | ~ | ~
47
- +--------------------------------|-~-----------------------------+ | ~
48
- | V ~ | | ~
49
- | Create the right +-------------------------------+ | | ~
50
- | PeriodStreams depending | StreamOrchestrator | | | ~
51
- | on the current position, | (./core/stream/orchestrator) | | | ~
52
- | and settings +-------------------------------+ | | ~
53
- | | ^ | ^ | ^ | | ~
54
- | | ~ | ~ | ~ | | ~
55
- | | ~ | ~ | ~ | | ~
56
- | (audio) v ~ (video) V ~ (text) v ~ | | ~
57
- | Create the right +----------+ +----------+ +----------+ | +--------------+ | ~
58
- | AdaptationStream | | | | | |----> |SegmentBuffers| | ~
59
- | depending on the | Period |-+ | Period |-+ | Period |-+ | | Store | | ~
60
- | wanted track | Stream | | | Stream | | | Stream | | | |(./core/segmen| | ~
61
- | (One per Period | | | | | | | | | | |t_buffers) | | ~
62
- | and one per type +----------+ | +----------+ | +----------+ | | +--------------+ | ~
63
- | of media) | (./core/stream/period) | | Create one buffer | ~
64
- | +-----------+ +-----------+ +-----------+ | per type of media | ~
65
- | | ^ | ^ | ^ | | ~
66
- | | ~ | ~ | ~ | | ~
67
- | | ~ | ~ | ~ | | ~
68
- | | ~ | ~ | ~ | | ~
69
- | (audio) v ~ (video) V ~ (text) v ~ | +--------------+ | ~
70
- | +----------+ +----------+ +----------+ ---> | | | ~
71
- | Create the right | | | | | | <~~~ | ARS* | | ~
72
- | Representation- |Adaptation|-+ |Adaptation|-+ |Adaptation|-+ | |(./core/adapti| | ~
73
- | Stream depending | Stream | | | Stream | | | Stream | | | |ve) | | ~
74
- | on the current | | | | | | | | | | +--------------+ | ~
75
- | network, +----------+ | +----------+ | +----------+ | | *Adaptive | ~
76
- | settings... | (./core/stream/adaptation) | | Representation | ~
77
- | +-----------+ +-----------+ +-----------+ | Selector: | ~
78
- | | ^ | ^ | ^ | Find the best | ~
79
- | | ~ | ~ | ~ | Representation | ~
80
- | | ~ | ~ | ~ | to play | ~
81
- | | ~ | ~ | ~ | | ~
82
- | (audio) v ~ (video) V ~ (text) v ~ | | ~
83
- | +----------+ +----------+ +----------+ ----> +------------+ | ~
84
- | (Representation- | | | | | | <~~~~ | Segment | -+ ~
85
- | Stream). |Represe...|-+ |Represe...|-+ |Represe...|-+ | | fetcher | <~~+
33
+ +--------------------+ | | +--------------> | transports |
34
+ | TrackChoiceManager | <--+ | | | (./transports) |
35
+ | (./core/api) | | | | |
36
+ +--------------------+ | | +----------------+
37
+ Facilitate track V | Abstract the streaming ^
38
+ switching for +---------------+ | protocol |
39
+ the API | | | |
40
+ +----------------+ | | +--------------------------+ |
41
+ | Content | | Init | ------> | | |
42
+ | Decryptor | <---- | (./core/init) | | Manifest Fetcher | |
43
+ |(./core/decrypt)| | | |(./core/fetchers/manifest)| |
44
+ | | | | | | |
45
+ +----------------+ +---------------+ +--------------------------+ |
46
+ Negotiate content | Initialize Load and refresh the Manifest |
47
+ decryption | playback and |
48
+ | create/connect |
49
+ | modules |
50
+ Stream (./core/stream) | |
51
+ +--------------------------------|-------------------------------+ |
52
+ | V | |
53
+ | Create the right +-------------------------------+ | |
54
+ | PeriodStreams depending | StreamOrchestrator | | |
55
+ | on the current position, | (./core/stream/orchestrator) | | |
56
+ | and settings +-------------------------------+ | |
57
+ | | | | | |
58
+ | | | | | |
59
+ | | | | | |
60
+ | (audio) v (video) V (text) v | |
61
+ | Create the right +----------+ +----------+ +----------+ | +--------------+ |
62
+ | AdaptationStream | | | | | |----> |SegmentBuffers| |
63
+ | depending on the | Period |-+ | Period |-+ | Period |-+ | | Store | |
64
+ | wanted track | Stream | | | Stream | | | Stream | | | |(./core/segmen| |
65
+ | (One per Period | | | | | | | | | | |t_buffers) | |
66
+ | and one per type +----------+ | +----------+ | +----------+ | | +--------------+ |
67
+ | of media) | (./core/stream/period) | | Create one buffer |
68
+ | +-----------+ +-----------+ +-----------+ | per type of media |
69
+ | | | | | |
70
+ | | | | | |
71
+ | | | | | |
72
+ | | | | | |
73
+ | (audio) v (video) V (text) v | +--------------+ |
74
+ | +----------+ +----------+ +----------+ ---> | | |
75
+ | Create the right | | | | | | | | ARS* | |
76
+ | Representation- |Adaptation|-+ |Adaptation|-+ |Adaptation|-+ | |(./core/adapti| |
77
+ | Stream depending | Stream | | | Stream | | | Stream | | | |ve) | |
78
+ | on the current | | | | | | | | | | +--------------+ |
79
+ | network, +----------+ | +----------+ | +----------+ | | *Adaptive |
80
+ | settings... | (./core/stream/adaptation) | | Representation |
81
+ | +-----------+ +-----------+ +-----------+ | Selector: |
82
+ | | | | | Find the best |
83
+ | | | | | Representation |
84
+ | | | | | to play |
85
+ | | | | | |
86
+ | (audio) v (video) V (text) v | |
87
+ | +----------+ +----------+ +----------+ ----> +------------+ |
88
+ | (Representation- | | | | | | | | Segment | -+
89
+ | Stream). |Represe...|-+ |Represe...|-+ |Represe...|-+ | | fetcher |
86
90
  | Download and push| Stream | | | Stream | | | Stream | | | |(./core/fetch|
87
91
  | segments based on| | | | | | | | | | |ers/segment) |
88
92
  | the current +----------+ | +----------+ | +----------+ | | +-------------+
89
93
  | position and | (./core/stream/representation) | | Load media segments
90
94
  | buffer state +-----------+ +-----------+ +-----------+ |
91
- | |
92
- +----------------------------------------------------------------+
95
+ | | | | |
96
+ +-------------------------|---------------|--------------|-------+
97
+ | | |
98
+ +---------|---------------|--------------|-------+
99
+ | (audio)V (video)V V |
100
+ | +------------+ +------------+ +-----------+ |
101
+ Media buffers | | Audio/Video| | Audio/Video| | Text | |
102
+ on which media | | Segment | | Segment | | Segment | |
103
+ data to decode | | Buffer | | Buffer | | Buffer | |
104
+ is pushed, so | +------------+ +------------+ +-----------+ |
105
+ it can be | |
106
+ decoded at the | SegmentBuffer implementations |
107
+ right time | (./core/segment_buffers/implementations) |
108
+ +------------------------------------------------+
93
109
  ```
94
110
 
95
111
  For the directories not represented in that schema:
@@ -97,7 +113,7 @@ For the directories not represented in that schema:
97
113
  - `Compat` (_./compat_): Regroups every functions related to improving
98
114
  compatibility with browsers / environments.
99
115
 
100
- - `errors` (_./errors_): Define error subclasses, most of all for the API.
116
+ - `errors` (_./errors_): Defines error subclasses, most of all for the API.
101
117
 
102
118
  - `experimental` (_./experimental_): Special directory for "experimental" tools
103
119
  and features.
@@ -111,8 +127,8 @@ For the directories not represented in that schema:
111
127
 
112
128
  - `parsers` (_./parsers_): Various parsers for several formats
113
129
 
114
- - `tools` (_./tools_): Define "tools", APIs which are not part of the RxPlayer
115
- class.
130
+ - `tools` (_./tools_): Defines "tools", APIs which are not part of the
131
+ RxPlayer class.
116
132
 
117
133
  - `typings` (_./typings_): Define TypeScript typings.
118
134
 
@@ -429,7 +429,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
429
429
  // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
430
430
  videoElement.preload = "auto";
431
431
 
432
- this.version = /* PLAYER_VERSION */"3.28.0-dev.2022062000";
432
+ this.version = /* PLAYER_VERSION */"3.28.0-dev.2022062300";
433
433
  this.log = log;
434
434
  this.state = "STOPPED";
435
435
  this.videoElement = videoElement;
@@ -1051,12 +1051,18 @@ class Player extends EventEmitter<IPublicAPIEvent> {
1051
1051
  currentContentCanceller.cancel();
1052
1052
  });
1053
1053
 
1054
-
1055
1054
  // Link playback events to the corresponding callbacks
1056
1055
  playback$.subscribe({
1057
1056
  next: (x) => this._priv_onPlaybackEvent(x),
1058
1057
  error: (err : Error) => this._priv_onPlaybackError(err),
1059
- complete: () => this._priv_onPlaybackFinished(),
1058
+ complete: () => {
1059
+ if (!contentInfos.currentContentCanceller.isUsed) {
1060
+ log.info("API: Previous playback finished. Stopping and cleaning-up...");
1061
+ contentInfos.currentContentCanceller.cancel();
1062
+ this._priv_cleanUpCurrentContentState();
1063
+ this._priv_setPlayerState(PLAYER_STATES.STOPPED);
1064
+ }
1065
+ },
1060
1066
  });
1061
1067
 
1062
1068
  // initialize the content only when the lock is inactive
@@ -2450,19 +2456,6 @@ class Player extends EventEmitter<IPublicAPIEvent> {
2450
2456
  }
2451
2457
  }
2452
2458
 
2453
- /**
2454
- * Triggered when the playback Observable completes.
2455
- * Clean-up ressources and signal that the content has ended.
2456
- */
2457
- private _priv_onPlaybackFinished() : void {
2458
- log.info("API: Previous playback finished. Stopping and cleaning-up...");
2459
- if (this._priv_contentInfos !== null) {
2460
- this._priv_contentInfos.currentContentCanceller.cancel();
2461
- }
2462
- this._priv_cleanUpCurrentContentState();
2463
- this._priv_setPlayerState(PLAYER_STATES.ENDED);
2464
- }
2465
-
2466
2459
  /**
2467
2460
  * Triggered when we received a warning event during playback.
2468
2461
  * Trigger the right API event.
@@ -2941,7 +2934,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
2941
2934
  return activeRepresentations[currentPeriod.id];
2942
2935
  }
2943
2936
  }
2944
- Player.version = /* PLAYER_VERSION */"3.28.0-dev.2022062000";
2937
+ Player.version = /* PLAYER_VERSION */"3.28.0-dev.2022062300";
2945
2938
 
2946
2939
  /** Every events sent by the RxPlayer's public API. */
2947
2940
  interface IPublicAPIEvent {