@stormstreaming/stormstreamer 0.9.3-beta.0 → 1.0.0-rc.0
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 +6 -0
- package/LICENSE +133 -0
- package/README.md +211 -63
- package/dist/amd/index.js +45 -5
- package/dist/cjs/index.js +4 -4
- package/dist/esm/index.js +13 -13
- package/dist/iife/index.js +5 -5
- package/dist/types/events/StormStreamerEvent.d.ts +141 -0
- package/dist/types/playback/StreamerController.d.ts +5 -0
- package/dist/umd/index.js +5 -5
- package/package.json +6 -2
- package/samples/index_amd.html +50 -0
- package/samples/index_esm.html +46 -0
- package/samples/index_iife.html +45 -0
- package/samples/index_umd.html +45 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"Storm Streaming Server" software license
|
|
2
|
+
|
|
3
|
+
§ 1. Introduction
|
|
4
|
+
1) The following software license terms are a binding agreement between you, an individual user at least 18 years of age, or alternatively a single legal entity (hereinafter referred to as Licensee), and Web-Anatomy s.c. based in Poland (hereinafter referred to as Licensor).
|
|
5
|
+
2) By downloading, installing, or otherwise accessing Storm Streaming Server or Storm Player software, you consent to these terms and conditions.
|
|
6
|
+
3) If you purchase the software for the benefit of a legal entity (such as a company, institution), you declare that you are authorized to bind that entity under this License Agreement, and in the context of this agreement, thats entity will be called the Licensee.
|
|
7
|
+
|
|
8
|
+
§ 2. Definitions
|
|
9
|
+
Terms used in this agreement have the following meanings:
|
|
10
|
+
1) Agreement - means this license agreement and all its terms;
|
|
11
|
+
2) Software - means software developed and distributed by the Licensor under the names Storm Steaming Server and Storm Player;
|
|
12
|
+
3) Instance - means a single, unique installation of the Software on the Server;
|
|
13
|
+
4) Server - means a single, physical PC / Mac or equivalent computer, supported by a unique copy of the operating system. The term can also mean a virtual computer running on a physical Server;
|
|
14
|
+
5) Service period - means the period for which the rights to use the Software have been purchased;
|
|
15
|
+
6) Technical support - means providing technical support services by the Licensor in relation to the Software;
|
|
16
|
+
7) Update - means a newer version of the Software containing improvements in its functioning or new functionality;
|
|
17
|
+
8) License Key - the alphanumeric code required to run the Software and provided by the Licensor;
|
|
18
|
+
9) Technical documentation - means materials in written and graphic form describing the operation and functionality of the Software;
|
|
19
|
+
10) Program error - indicates a fault in the operation of the Program;
|
|
20
|
+
11) Source Code - means a sequence of instructions written in a programming language describing the principles of operation of the application;
|
|
21
|
+
12) Minimum requirements - means the minimum parameters that must be met by the Server to be able to properly operate the Software;
|
|
22
|
+
13) Example - a fragment of a program, script, graphic element illustrating the functionality of the Software;
|
|
23
|
+
14) Materials - input or output data in the form of binary strings representing multimedia content such as video, audio or other computer data.
|
|
24
|
+
15) Stream - Material in the form of an audio / video stream delivered in real time to the Software through external software or service;
|
|
25
|
+
16) Viewer - User who is the recipient of the Materials;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
§ 3. Rights granted
|
|
29
|
+
1) The software is licensed - not sold. The agreement does not transfer or change in any form the proprietary copyrights that absolutely belong to the Licensor.
|
|
30
|
+
2) Pursuant to this agreement and its terms, the Licensor grants the Licensee a worldwide, limited, non-exclusive, non-sublicensable, non-transferable license to use the Software.
|
|
31
|
+
3) The source code of the Software, excluding the Examples, is not provided to the Licensee in any way and is the secret of the Licensor.
|
|
32
|
+
4) The examples provided by the Licensor can be copied, installed, modified, used and integrated without any restrictions.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
§ 4. Restrictions
|
|
36
|
+
1) Taking into account the above restrictions, it is also prohibited to:
|
|
37
|
+
a. Sale, leasing, rental, distribution of part or all of the Software and / or License Keys in any form, including in particular the creation of products and services competitive for the Licensor.
|
|
38
|
+
b. Modifying the Software or creating your own IT solutions based on the analysis of its operation.
|
|
39
|
+
c. Use of the Software for transmission, reproduction, storage or sharing of Materials for which the Licensee does not have the appropriate license rights.
|
|
40
|
+
d. Use of Materials containing unlawful content, including in particular pedophile, criminal content or such inciting hatred on the basis of racial or nationality, etc.
|
|
41
|
+
e. Decompile, reverse engineer some or all of the Software to obtain the Source Code or its algorithms.
|
|
42
|
+
f. Remove, modify, cover or obfuscate the Licensee's trademarks in any element of the Software.
|
|
43
|
+
g. Offering the Software Technical Support service to other entities without the Licensor's written consent.
|
|
44
|
+
h. Make any changes to the Agreement without the Licensor's consent.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
§ 5. License types
|
|
48
|
+
1) The software is distributed in the following versions:
|
|
49
|
+
a. Free with limited functionality,
|
|
50
|
+
b. Commercial in the subscription model, without limitations in functionalities,
|
|
51
|
+
c. Commercial with a one-time fee with no restrictions in functionality
|
|
52
|
+
2) If you choose a free license, the following terms of use for the Software shall apply:
|
|
53
|
+
a. The license is free.
|
|
54
|
+
b. The license is limited to a single Instance. It is forbidden to install the Software in this version on more than one Server. The above is possible only after obtaining the written consent of the Licensor.
|
|
55
|
+
c. The license will automatically expire after 30 days. After this period, it may be resumed for the same period.
|
|
56
|
+
d. The license cannot be used commercially. It is only permitted to be used for integration with other software, websites and tests.
|
|
57
|
+
e. The license does not authorize the use of the Software Instance in the "Storm Streaming Marketplace" solution.
|
|
58
|
+
f. The software allows you to create only up to 5 parallel Streams and service a total of 10 Viewers.
|
|
59
|
+
g. The software may not offer all the functionality of the commercial version.
|
|
60
|
+
3) If you choose a commercial license in the subscription model, the following terms of use for the Software apply:
|
|
61
|
+
a. The license is payable. The fee is charged in the form of a subscription fee in advance for the period of use in a monthly or annual period.
|
|
62
|
+
b. The license is granted for the service period, which depends on the purchased license period.
|
|
63
|
+
c. The license may be used for commercial purposes.
|
|
64
|
+
d. Software updates are free of charge and can be downloaded from the Licensor's website at any time.
|
|
65
|
+
e. The license allows for a simultaneous number of Instances equal to the number of licenses purchased for a given Service Period.
|
|
66
|
+
f. The Licensor reserves the right to change the fees for the Software at any time. However, this change does not apply to licenses already purchased during their Service Period.
|
|
67
|
+
g. In the event of not receiving the entire remuneration for a given Service Period in respect of the remuneration for the Software, receiving a request for reimbursement of the fee already made by the payment operator, bank or card issuer or the inability to collect the fee, the Licensor has the right to remotely block the operation of all Software Instances belonging to the Licensee.
|
|
68
|
+
h. Licensor may, at his/her sole discretion, discontinue, restrict or discontinue licensing the Software without cause.
|
|
69
|
+
i. If this Agreement is terminated, withdrawn or expired for any reason, Licensee's obligations to pay the fees charged will remain in effect.
|
|
70
|
+
4) If you choose a commercial license with a one-time fee, the following terms of use for the Software apply:
|
|
71
|
+
a. The license is payable. The fee is charged as a one-off payment.
|
|
72
|
+
b. The license may be used for commercial purposes.
|
|
73
|
+
c. Software updates are paid, excluding updates containing critical security fixes.
|
|
74
|
+
d. The license allows you to have a simultaneous number of Instances equal to the number of licenses purchased.
|
|
75
|
+
e. The license is granted for an indefinite period.
|
|
76
|
+
f. In the event of termination, withdrawal or expiration of this Agreement for any reason, the Licensor retains the rights to the fees and charges already collected.
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
§ 6. Technical support
|
|
80
|
+
1) The Licensee offers a Technical Support service under which the Licensee undertakes to receive, through its Website, reports of errors, failures, technical problems and technical inquiries from the Licensee and to cooperate with them in order to solve them comprehensively.
|
|
81
|
+
2) As part of the technical support, the Licensor is obliged to deal with the Licensor's application in less than 24 hours. The Licensor does not guarantee the time of solving the defect or problem.
|
|
82
|
+
3) The Licensor may offer additional, paid technical support plans on its Website, which offer faster response times to error reports or other forms of communication with the Licensee.
|
|
83
|
+
4) Technical support is offered to commercial licenses only, free licenses are excluded.
|
|
84
|
+
5) Technical support for a commercial license in the subscription model is directly related to the Service Term of the license itself.
|
|
85
|
+
6) Technical support for a one-time license is provided for a full 365 days from the moment of purchase. It is possible to extend this period for an additional fee.
|
|
86
|
+
7) The Licensor may refuse to provide Technical Support in the event of:
|
|
87
|
+
a. Unauthorized modification of the Software by the Licensee or a third party.
|
|
88
|
+
b. If the Server does not meet the Minimum Requirements for the Software or its operation indicates a hardware failure or malfunction of the dependent software, such as the Web Server or the Operating System.
|
|
89
|
+
c. In the event of failure to receive the entire amount due for the granted license or related services
|
|
90
|
+
d. In case of errors, failures or incorrect configuration of the network architecture in which the Server is located
|
|
91
|
+
8) Technical support does not cover the issue of Storm Player video compatibility with other scripts of the Websites.
|
|
92
|
+
9) Technical support does not cover the operation and compatibility of the Software with third party or third party programs and scripts.
|
|
93
|
+
10) The Licensor reserves the right to collect IT data from all Software Instances, including in particular error data, transmission statistics and generated load for the entire period of use of the Software. At the same time, the Licensor ensures that individual data of the Viewers or persons operating the Software, which in any form would allow their subsequent identification, are not and will never be collected.
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
§ 7. Intellectual property
|
|
97
|
+
1) The software and all copies thereof are the exclusive intellectual property of the Licensor and are protected by proprietary and patent law. The organizational structure of the software along with the source code and the object code are confidential and valuable trade secrets of the Licensor.
|
|
98
|
+
2) The Licensor is obliged to maintain the confidentiality of the Software, in particular the execution files and License Keys.
|
|
99
|
+
3) The Licensee is not granted any rights, titles or licenses to use the trademarks of the Software or the Licensor himself. It is strictly forbidden to publish the Trademarks in any form without the prior written consent of the Licensor.
|
|
100
|
+
4) The Licensee agrees that the Licensor may use his/her name, the name of the represented entity, logos and other identifying information free of charge in his/her advertising materials and on the Website.
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
§ 8. Termination, withdrawal and expiration
|
|
104
|
+
1) The Licensor has the right to withdraw from this Agreement in the event of a breach of any of its provisions with a 30-day notice period.
|
|
105
|
+
2) In the event of termination, withdrawal or expiry of this Agreement, Licensee must remove and destroy all copies of the Software from all Servers and scripts of the Website within 7 days from the date of receipt of the relevant notice.
|
|
106
|
+
3) Payments made under this Agreement to the Licensor are non-refundable.
|
|
107
|
+
|
|
108
|
+
§ 9. Limited Warranty
|
|
109
|
+
1) The Licensor ensures that the Software complies with the advertisements, graphic materials and descriptions available on the Licensor's Website. In the event of any incompatibility or deficiencies in the functionality of the Software, the Licensor is obliged to supplement these deficiencies within 90 days from the moment the Licensee reports this fact.
|
|
110
|
+
2) The Licensor ensures that the Software does not infringe the rights of entities and third parties and is free from legal defects.
|
|
111
|
+
3) The Licensor is not liable for any damages and lost profits caused by the operation of the Software.
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
§ 10. Taxes
|
|
115
|
+
1) All prices listed on the Licensor's website or presented in the form of an individual offer are net prices. Depending on the Licensee's tax residence and the nature of the business activity (or lack thereof), an appropriate value added tax (VAT) may be added to the final price.
|
|
116
|
+
2) The Licensee is obliged to pay all taxes in the form of value added tax (VAT), withholding tax, customs duties and the like to the relevant tax authority.
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
§ 11. Other legal issues
|
|
120
|
+
1) In matters not covered by this contract, the provisions of the civil law of the Republic of Poland shall apply.
|
|
121
|
+
2) Any disputes arising from this Agreement shall be submitted to the common courts of law competent for the Licensor.
|
|
122
|
+
3) The Licensor has the right to transfer its obligations resulting from this agreement to a third party at any time, after prior notification to the Licensee.
|
|
123
|
+
|
|
124
|
+
§ 12. Other provisions
|
|
125
|
+
1) Licensor's contact details:
|
|
126
|
+
• Web-Anatomy s.c., 43-502, Czechowice-Dziedzice, Łężna 12
|
|
127
|
+
• https://stormstreaming.com
|
|
128
|
+
• contact@stormstreaming.com
|
|
129
|
+
|
|
130
|
+
2) Date of publication: 14.12.2020
|
|
131
|
+
3) License version: 1.00
|
|
132
|
+
|
|
133
|
+
|
package/README.md
CHANGED
|
@@ -18,11 +18,51 @@ This library comes in **IIFE**, **ESM**, **AMD**, **UMD**, and **CJS** versions
|
|
|
18
18
|
|
|
19
19
|
3. Manually - if you are clueless about NPM/Yarn or simply want to test it out, just grab`/dist/iife/index.js` file and embed it on your website.
|
|
20
20
|
|
|
21
|
+
## Attaching and detaching events
|
|
22
|
+
|
|
23
|
+
```JavaScript
|
|
24
|
+
/**
|
|
25
|
+
* An event can be registered using the addEventListener method (preferably before the initialize() method is called)
|
|
26
|
+
*/
|
|
27
|
+
stormStreamer.addEventListener("streamerReady", onStreamerReady);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Inline functions work well too...
|
|
31
|
+
*/
|
|
32
|
+
stormStreamer.addEventListener("streamerReady", function(event){
|
|
33
|
+
console.log("streamerReady!");
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* An event can also be removed...
|
|
38
|
+
*/
|
|
39
|
+
stormStreamer.removeEventListener("streamerReady", onStreamerReady);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* All event listeners of a specific type can be removed like this
|
|
43
|
+
*/
|
|
44
|
+
stormStreamer.removeEventListener("streamerReady");
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Starting and stopping devices (manual method)
|
|
48
|
+
|
|
49
|
+
```JavaScript
|
|
50
|
+
/**
|
|
51
|
+
* Starts cameras/microphones (might initiate a popup in a browser)
|
|
52
|
+
*/
|
|
53
|
+
stormStreamer.start();
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Stops all cameras/microphones
|
|
57
|
+
*/
|
|
58
|
+
stormStreamer.stop();
|
|
59
|
+
```
|
|
60
|
+
|
|
21
61
|
## Publishing and unpublishing to a streamKey (manual method)
|
|
22
62
|
|
|
23
63
|
```JavaScript
|
|
24
64
|
/**
|
|
25
|
-
* Publishing to streamKey called "test"
|
|
65
|
+
* Publishing to streamKey called "test" (make sure that a camera and microphone are active via getInputDevicesState() == READY)
|
|
26
66
|
*/
|
|
27
67
|
stormStreamer.publish("test");
|
|
28
68
|
|
|
@@ -79,71 +119,179 @@ stormStreamer.setWidth("100%");
|
|
|
79
119
|
stormStreamer.setHeight("720px");
|
|
80
120
|
```
|
|
81
121
|
|
|
122
|
+
## StormStreamer Event List
|
|
123
|
+
|
|
124
|
+
| Event name | Additional data | Description |
|
|
125
|
+
|:------------------------------|:-------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
126
|
+
| `streamerReady` | - | Triggered when a streamer instance is initialized via the initialize() method. |
|
|
127
|
+
| `serverConnectionInitiate` | serverURL:*string* | Fired when a streamer instance initiates a connection with a Storm Streaming Server/Cloud instance. |
|
|
128
|
+
| `serverConnect` | serverURL:*string*, sequenceNum:*number* | Triggered when a streamer instance successfully establishes a connection with a Storm Streaming Server/Cloud instance. |
|
|
129
|
+
| `statusServerConnect` | serverURL:*string*, sequenceNum:*number* | Triggered when a streamer instance successfully establishes a connection with a status server. |
|
|
130
|
+
| `serverDisconnect` | serverURL:*string*, restart:*boolean*, sequenceNum:*number* | Called when a streamer instance is disconnected from the Storm Streaming Server/Cloud (after a connection was previously established), which may occur due to publisher networking issues or Storm Streaming Server/Cloud problems. |
|
|
131
|
+
| `statusServerDisconnect` | serverURL:*string*, restart:*boolean*, sequenceNum:*number* | Called when a streamer instance is disconnected from the status server. |
|
|
132
|
+
| `serverConnectionError` | serverURL:*string*, restart:*boolean*, sequenceNum:*number* | Triggered when a streamer instance fails to establish a connection with a Storm Streaming Server/Cloud instance, possibly due to networking issues. If there are additional servers on the configuration list and the "restartOnError" parameter is set to true, the streamer will attempt to connect to a different server instead. |
|
|
133
|
+
| `statusServerConnectionError` | serverURL:*string*, restart:*boolean*, sequenceNum:*number* | Triggered when a streamer instance fails to establish a connection with a status server. |
|
|
134
|
+
| `allConnectionsFailed` | mode:*string* | Associated with serverConnectionError. If a streamer instance is unable to connect to any of the servers provided in the configuration list, this event indicates that no further action can be taken. |
|
|
135
|
+
| `interactionRequired` | mode:*string* | Certain browsers and devices do not permit a video element to initiate on its own and necessitate direct user interaction, such as a mouse click or a touch gesture. This event signifies that such an engagement is required. |
|
|
136
|
+
| `compatibilityError` | message:*string* | Triggered if a browser or device does not support the required features for streaming. Please note that the streamer will attempt all possible measures to ensure maximum compatibility with a given device. |
|
|
137
|
+
| `playbackForcePause` | - | Fired when the preview playback is forcefully paused by the system (not by user interaction). |
|
|
138
|
+
| `playbackForceMute` | - | Fired when the preview playback is forcefully muted by the system (not by user interaction). |
|
|
139
|
+
| `volumeChange` | volume:*number*, muted:*boolean*, invokedBy:*"user"* \| *"browser"* | Notifies that video volume was changed (either its value was changed, or video was muted/un-muted). |
|
|
140
|
+
| `videoElementCreate` | videoElement:*HTMLVideoElement* | Triggered whenever a video element within a streamer instance is either created or recreated. |
|
|
141
|
+
| `containerChange` | container:*HTMLElement* \| *null* | Fired whenever a streamer is detached or attached to a new container. |
|
|
142
|
+
| `resizeUpdate` | width:*number*, height:*number* | Triggered when the video preview size is changed or updated. |
|
|
143
|
+
| `videoUnmuted` | - | Fired when the video preview is successfully unmuted. |
|
|
144
|
+
| `SSLError` | mode:*string* | Fired if an SSL layer is required for streaming and the browser does not provide it. |
|
|
145
|
+
| `incompatibleProtocol` | clientProtocolVer:*number*, serverProtocolVersion:*number* | Fired when there is a protocol version mismatch between the client and server. |
|
|
146
|
+
| `authorizationError` | - | Fired when a streamer instance fails to authorize with a server application on Storm Streaming Server/Cloud instance (e.g. incorrect token). |
|
|
147
|
+
| `authorizationComplete` | - | Called when a streamer instance successfully authorizes with a server application on Storm Streaming Server/Cloud instance. |
|
|
148
|
+
| `invalidLicense` | - | Fired whenever a Storm Streaming Server/Cloud license expires. |
|
|
149
|
+
| `streamConfigChange` | newConfig:*ConfigManager* | Notifies that basic stream configuration has been updated. |
|
|
150
|
+
| `fullScreenEnter` | - | Fired whenever a streamer instance enters browser fullscreen mode (either native or overlay type). |
|
|
151
|
+
| `fullScreenExit` | - | Fired whenever a streamer instance exits fullscreen mode (either native or overlay type). |
|
|
152
|
+
| `noCameraFound` | - | Triggered when no camera device is found on the system. |
|
|
153
|
+
| `publishStateChange` | state:*PublishState* | Notifies about changes in the publishing state (e.g., NOT_INITIALIZED, INITIALIZING, PUBLISHING, etc.). |
|
|
154
|
+
| `noMicrophoneFound` | - | Triggered when no microphone device is found on the system. |
|
|
155
|
+
| `deviceListUpdate` | cameraList:*InputDevice[]*, microphoneList:*InputDevice[]* | Fired when the list of available input devices (cameras and microphones) is updated. |
|
|
156
|
+
| `inputDeviceError` | - | Triggered when there is an error accessing or using an input device. |
|
|
157
|
+
| `cameraAccessDenied` | - | Fired when camera access permission is denied by the user or the system. |
|
|
158
|
+
| `deviceStateChange` | state:*InputDevicesState*, selectedCamera:*InputDevice* \| *null*, selectedMicrophone:*InputDevice* \| *null* | Notifies about changes in the state of input devices and provides information about selected camera and microphone. |
|
|
159
|
+
| `publishMetadataUpdate` | metadata:*PublishMetadata* | Fired when new metadata about the publishing stream is available. |
|
|
160
|
+
| `streamStatusUpdate` | streamStatus:*StreamStatusInfo* | Provides updated information about the status of the published stream on the server. |
|
|
161
|
+
| `cameraDeviceStateChange` | state:*DeviceState*, selectedCamera:*InputDevice* \| *null* | Notifies about changes in the camera device state and provides information about the selected camera. |
|
|
162
|
+
| `microphoneDeviceStateChange` | state:*DeviceState*, selectedMicrophone:*InputDevice* \| *null* | Notifies about changes in the microphone device state and provides information about the selected microphone. |
|
|
163
|
+
| `microphoneAccessDenied` | - | Fired when microphone access permission is denied by the user or the system. |
|
|
164
|
+
| `savedCameraNotFound` | savedDeviceID:*string* \| *null* | Triggered when a previously saved camera device is no longer available on the system. |
|
|
165
|
+
| `savedMicrophoneNotFound` | savedDeviceID:*string* \| *null* | Triggered when a previously saved microphone device is no longer available on the system. |
|
|
166
|
+
| `streamKeyInUse` | streamKey:*string* | Fired when attempting to publish with a stream key that is already in use by another publisher. |
|
|
167
|
+
| `streamKeyInUseInterval` | streamKey:*string*, count:*number*, maxCount:*number* | Fired periodically when attempting to publish with a stream key that is already in use, providing retry count information. |
|
|
168
|
+
| `soundMeter` | high:*number*, low:*number* | Provides real-time audio level information from the microphone. |
|
|
169
|
+
| `microphoneStateChange` | isMuted:*boolean* | Notifies about changes in the microphone mute state. |
|
|
170
|
+
| `metadata` | videoWidth:*number*, videoHeight:*number* | Provides metadata about the video being published, including dimensions. |
|
|
171
|
+
| `publish` | streamKey:*string* | Fired when publishing to a stream key is initiated. |
|
|
172
|
+
| `unpublish` | - | Fired when publishing is stopped. |
|
|
173
|
+
|
|
174
|
+
|
|
82
175
|
## Basic API
|
|
83
176
|
|
|
84
|
-
|
|
|
85
|
-
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
| setSize(width:number/string, height:number/string)
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
| createMicrophoneGraph(container:string
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
177
|
+
| Method | Returns | Return type | Description |
|
|
178
|
+
|:---------------------------------------------------------|:-----------------------------------------------------------------:|:------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
179
|
+
| `initialize()` | - | *void* | Initializes the streamer object. From this point, a connection to the server is established and authentication occurs. It is recommended to add all event listeners before calling this method to ensure they can be properly captured. |
|
|
180
|
+
| `isInitialized()` | _true_ if this streamer instance was already initialized | *boolean* | Returns _true_ if this streamer instance has already been initialized. |
|
|
181
|
+
| `isConnected()` | _true_ if this streamer instance is connected to a server | *boolean* | Returns _true_ if this streamer instance is currently connected to a Storm Server/Cloud instance. |
|
|
182
|
+
| `getStreamerID()` | Streamer ID (first instance starts with 0, next one gets 1, etc.) | *number* | Returns the unique ID of this streamer instance. Each subsequent instance has a higher number. |
|
|
183
|
+
| `getBranch()` | Name of a development branch | *string* | Returns the development branch of this streamer (e.g., main, experimental). |
|
|
184
|
+
| `getVersion()` | Streamer version in xx.xx.xx format | *string* | Returns the version of this streamer instance. The version is returned in the SemVer format (Major.Minor.Patch). |
|
|
185
|
+
| `start()` | - | *Promise<void>* | Starts the streaming process. |
|
|
186
|
+
| `stop()` | - | *void* | Stops the streaming process. |
|
|
187
|
+
| `mute()` | - | *void* | Mutes the streamer's video object. Audio output will be silenced. |
|
|
188
|
+
| `unmute()` | - | *void* | Unmutes the streamer's video object. Audio output will be restored. |
|
|
189
|
+
| `toggleMute()` | New mute state after toggling | *boolean* | Toggles between mute and unmute states. Returns the new mute state. |
|
|
190
|
+
| `isMute()` | _true_ if the streamer is muted | *boolean* | Checks whether the streamer audio is currently muted. |
|
|
191
|
+
| `setVolume(newVolume:number)` | - | *void* | Sets new volume for the streamer (0-100). Once the method is performed, the _volumeChange_ event will be triggered. If the video was muted prior to the volume change, it will be automatically unmuted. |
|
|
192
|
+
| `getVolume()` | Current volume level 0-100 | *number* | Returns current streamer volume (0-100). |
|
|
193
|
+
| `getCameraList()` | Array containing available cameras | *InputDevice[]* | Returns the list of available camera devices. |
|
|
194
|
+
| `getMicrophoneList()` | Array containing available microphones | *InputDevice[]* | Returns the list of available microphone devices. |
|
|
195
|
+
| `setCamera(cameraID:string)` | - | *void* | Sets the active camera device by ID. |
|
|
196
|
+
| `setMicrophone(microphoneID:string)` | - | *void* | Sets the active microphone device by ID. |
|
|
197
|
+
| `getCurrentCamera()` | Currently active camera or null | *InputDevice* \| *null* | Returns the currently active camera device or null if none is active. |
|
|
198
|
+
| `getCurrentMicrophone()` | Currently active microphone or null | *InputDevice* \| *null* | Returns the currently active microphone device or null if none is active. |
|
|
199
|
+
| `muteMicrophone(microphoneState:boolean)` | - | *void* | Mutes or unmutes the microphone. True to mute, false to unmute. |
|
|
200
|
+
| `isMicrophoneMuted()` | _true_ if the microphone is currently muted | *boolean* | Checks if the microphone is currently muted. |
|
|
201
|
+
| `getPublishState()` | Current publish state | *PublishState* | Returns the current publishing state of the streamer. |
|
|
202
|
+
| `getPublishTime()` | Time in milliseconds since publishing | *number* | Returns the total time the stream has been publishing in milliseconds. |
|
|
203
|
+
| `publish(streamKey:string)` | _true_ if publishing was successfully initiated | *boolean* | Starts publishing a stream with the given stream key. |
|
|
204
|
+
| `unpublish()` | - | *void* | Stops publishing the current stream. |
|
|
205
|
+
| `getInputDevicesState()` | Current state of input devices (camera and microphone) | *InputDevicesState* | Returns the current state of input devices (camera and microphone). |
|
|
206
|
+
| `getCameraState()` | Current camera device state | *DeviceState* | Returns the current state of the camera device. |
|
|
207
|
+
| `getMicrophoneState()` | Current microphone device state | *DeviceState* | Returns the current state of the microphone device. |
|
|
208
|
+
| `clearSavedDevices()` | - | *void* | Clears saved device preferences from storage. |
|
|
209
|
+
| `messSavedDevices()` | - | *void* | Randomizes saved device preferences (for testing purposes). |
|
|
210
|
+
| `isStreamReady()` | _true_ if the stream is ready for publishing | *boolean* | Checks if the stream is ready for publishing. |
|
|
211
|
+
| `setSize(width:number/string, height:number/string)` | - | *void* | Sets a new width and height for the streamer. The values can be given as a number (in which case they are treated as the number of pixels), or as a string ending with "px" (this will also be the number of pixels) or "%", where the number is treated as a percentage of the parent container's value. |
|
|
212
|
+
| `setWidth(width:number/string)` | - | *void* | Sets a new width for the streamer. The value can be given as a number (in which case it is treated as the number of pixels), or as a string ending with "px" (this will also be the number of pixels) or "%", where the number is treated as a percentage of the parent container's value. |
|
|
213
|
+
| `getWidth()` | Streamer object width | *number* | Returns current streamer width in pixels. |
|
|
214
|
+
| `setHeight(height:number/string)` | - | *void* | Sets a new height for the streamer. The value can be given as a number (in which case it is treated as the number of pixels), or as a string ending with "px" (this will also be the number of pixels) or "%", where the number is treated as a percentage of the parent container's value. |
|
|
215
|
+
| `getHeight()` | Streamer object height | *number* | Returns current streamer height in pixels. |
|
|
216
|
+
| `updateToSize()` | - | *void* | Forces the streamer to recalculate its size based on parent internal dimensions. |
|
|
217
|
+
| `setScalingMode(newMode:string)` | - | *void* | Changes the streamer scaling mode. Available modes include fill, letterbox, original, and crop. |
|
|
218
|
+
| `getScalingMode()` | Current scaling mode | *ScalingType* | Returns the current streamer scaling mode. |
|
|
219
|
+
| `setStreamConfig(config:StreamerConfig)` | - | *void* | Sets stream config for the streamer (or overwrites an existing one). |
|
|
220
|
+
| `makeScreenshot()` | A promise containing either a blob or null | *Promise<Blob \| null>* | Returns a promise that resolves with a screenshot of the video element as a blob, or null if taking the screenshot was not possible. |
|
|
221
|
+
| `destroy()` | - | *void* | Destroys this instance of StormStreamer, releasing all resources and disconnecting from the server. After calling this method, the instance should not be used anymore. |
|
|
222
|
+
| `createFPSGraph(container:string \| HTMLElement)` | Graph for FPS performance | *FPSGraph* | Creates a FPS performance graph in the specified location (container ID or reference). The graph is a separate object that must be started using its start() method and stopped using its stop() method. The dimensions of the graph depend on the dimensions of the specified container. |
|
|
223
|
+
| `createBitrateGraph(container:string \| HTMLElement)` | Graph for bitrate performance | *BitrateGraph* | Creates a bitrate performance graph in the specified location (container ID or reference). The graph is a separate object that must be started using its start() method and stopped using its stop() method. The dimensions of the graph depend on the dimensions of the specified container. |
|
|
224
|
+
| `createMicrophoneGraph(container:string \| HTMLElement)` | Graph for microphone input | *MicrophoneGraph* | Creates a microphone input graph in the specified location (container ID or reference). The graph is a separate object that must be started using its start() method and stopped using its stop() method. The dimensions of the graph depend on the dimensions of the specified container. |
|
|
225
|
+
| `stopAllGraphs()` | - | *void* | Stops all active performance graphs. |
|
|
226
|
+
| `attachToContainer(containerID:string \| HTMLElement)` | _true_ if attaching was successful | *boolean* | Attaches the streamer to a new parent container using either a container ID (string) or a reference to an HTMLElement. If the instance is already attached, it will be moved to a new parent. |
|
|
227
|
+
| `detachFromContainer()` | _true_ if detaching was successful | *boolean* | Detaches the streamer from the current parent element, if possible. |
|
|
228
|
+
| `getContainer()` | Parent HTMLElement or null | *HTMLElement* \| *null* | Returns the current parent element of the streamer, or _null_ if none exists. |
|
|
229
|
+
| `enterFullScreen()` | - | *void* | Enters fullscreen mode for the streamer container. |
|
|
230
|
+
| `exitFullScreen()` | - | *void* | Exits fullscreen mode. |
|
|
231
|
+
| `isFullScreenMode()` | _true_ if the streamer is in fullscreen mode | *boolean* | Returns _true_ if the streamer is currently in fullscreen mode. |
|
|
232
|
+
| `getStreamKey()` | Current stream key or null | *string* \| *null* | Returns the current stream key or null if none is set. |
|
|
233
|
+
| `getStatsController()` | Object containing streaming statistics | *StatsController* \| *null* | Returns the Stats Controller instance which contains statistical data about streaming performance. |
|
|
234
|
+
| `getVideoElement()` | Reference to the main Video Element | *HTMLVideoElement* \| *null* | Returns the HTML video element used by this streamer instance. |
|
|
235
|
+
| `getNetworkController()` | Object responsible for managing server communication | *NetworkController* \| *null* | Returns the network controller which manages all server communication. |
|
|
236
|
+
| `getStreamerController()` | Object responsible for media stream operations | *StreamerController* \| *null* | Returns the streamer controller which manages media stream operations. |
|
|
237
|
+
| `getStageController()` | Object responsible for visual presentation | *StageController* \| *null* | Returns the stage controller which manages visual presentation. |
|
|
238
|
+
| `getStorageManager()` | Object responsible for data storage | *StorageManager* \| *null* | Returns the storage manager which handles persistent data storage. |
|
|
239
|
+
|
|
240
|
+
## Objects & Enums
|
|
241
|
+
|
|
242
|
+
## InputDevice Getters
|
|
243
|
+
|
|
244
|
+
| Getter | Return Type | Description |
|
|
245
|
+
|:-------------|:------------|:---------------------------------------------------------------|
|
|
246
|
+
| `label` | string | Returns the display name of the input device. |
|
|
247
|
+
| `id` | string | Returns the unique identifier of the input device. |
|
|
248
|
+
| `groupID` | string | Returns the group identifier that the input device belongs to. |
|
|
249
|
+
| `isSelected` | boolean | Returns whether the input device is currently selected. |
|
|
250
|
+
|
|
251
|
+
### PublishState Enum
|
|
252
|
+
|
|
253
|
+
| Value | Description |
|
|
254
|
+
|:------------------|:--------------------------------------------|
|
|
255
|
+
| `NOT_INITIALIZED` | Initial state, before initialization. |
|
|
256
|
+
| `INITIALIZED` | Component has been initialized. |
|
|
257
|
+
| `CONNECTING` | In the process of connecting to the server. |
|
|
258
|
+
| `CONNECTED` | Connected to the server. |
|
|
259
|
+
| `PUBLISHED` | Stream is actively being published. |
|
|
260
|
+
| `UNPUBLISHED` | Stream has been stopped (by user). |
|
|
261
|
+
| `STOPPED` | Stream has been stopped (by system). |
|
|
262
|
+
| `UNKNOWN` | Unknown state. |
|
|
263
|
+
| `ERROR` | An error occurred during publishing. |
|
|
264
|
+
|
|
265
|
+
### DeviceState Enum
|
|
266
|
+
|
|
267
|
+
| Value | Description |
|
|
268
|
+
|:------------------|:--------------------------------------------------------------|
|
|
269
|
+
| `NOT_INITIALIZED` | Initial state, device has not been initialized yet. |
|
|
270
|
+
| `ENABLED` | Device is enabled and ready to use. |
|
|
271
|
+
| `ACCESS_DENIED` | Permission to access the device was denied by user or system. |
|
|
272
|
+
| `NOT_FOUND` | Device could not be found on the system. |
|
|
273
|
+
| `STOPPED` | Device has been intentionally stopped. |
|
|
274
|
+
|
|
275
|
+
### InputDevicesState Enum
|
|
276
|
+
|
|
277
|
+
| Value | Description |
|
|
278
|
+
|:------------------|:------------------------------------------------------------------|
|
|
279
|
+
| `NOT_INITIALIZED` | Initial state, input devices have not been initialized yet. |
|
|
280
|
+
| `INITIALIZED` | Input devices have been initialized but may not be ready for use. |
|
|
281
|
+
| `READY` | Input devices are initialized and ready for use. |
|
|
282
|
+
| `UPDATING` | Input devices list or configuration is currently being updated. |
|
|
283
|
+
| `INVALID` | Input devices configuration is invalid or incompatible. |
|
|
284
|
+
| `UNKNOWN` | Input devices state cannot be determined. |
|
|
285
|
+
| `STOPPED` | Input devices have been intentionally stopped. |
|
|
286
|
+
|
|
287
|
+
### ScalingType Enum
|
|
146
288
|
|
|
289
|
+
| Value | Description |
|
|
290
|
+
|:-------------|:------------------------------------------------------------------------------------------|
|
|
291
|
+
| `FILL` | Scales content to fill the entire container, may distort aspect ratio. |
|
|
292
|
+
| `LETTER_BOX` | Scales content to fit within container while preserving aspect ratio, may add black bars. |
|
|
293
|
+
| `CROP` | Scales content to fill container while preserving aspect ratio, may crop edges. |
|
|
294
|
+
| `ORIGINAL` | Displays content at its original size without scaling. |
|
|
147
295
|
|
|
148
296
|
# Browser compatibility
|
|
149
297
|
|