@stormstreaming/stormstreamer 0.9.2-beta.2 → 0.9.3-beta.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.
Files changed (51) hide show
  1. package/README.md +130 -3
  2. package/dist/amd/index.js +2206 -105
  3. package/dist/cjs/index.js +3 -3
  4. package/dist/esm/index.js +3 -3
  5. package/dist/iife/index.js +4 -4
  6. package/dist/types/StormStreamer.d.ts +394 -3
  7. package/dist/types/config/AudioData.d.ts +46 -0
  8. package/dist/types/config/ConfigManager.d.ts +47 -0
  9. package/dist/types/config/DebugData.d.ts +108 -0
  10. package/dist/types/config/IConfig.d.ts +3 -0
  11. package/dist/types/config/SettingsData.d.ts +114 -0
  12. package/dist/types/config/StorageData.d.ts +46 -0
  13. package/dist/types/config/StreamData.d.ts +75 -0
  14. package/dist/types/config/VideoData.d.ts +115 -0
  15. package/dist/types/config/enum/LogType.d.ts +3 -0
  16. package/dist/types/config/enum/ProtocolType.d.ts +3 -0
  17. package/dist/types/config/enum/ScalingType.d.ts +3 -0
  18. package/dist/types/config/enum/SecurityType.d.ts +3 -0
  19. package/dist/types/config/enum/SizeCalculationType.d.ts +3 -0
  20. package/dist/types/events/EventDispatcher.d.ts +34 -0
  21. package/dist/types/graph/MicrophoneGraph.d.ts +11 -0
  22. package/dist/types/logger/Logger.d.ts +103 -0
  23. package/dist/types/model/AbstractSourceItem.d.ts +23 -0
  24. package/dist/types/model/GatewayServerItem.d.ts +53 -0
  25. package/dist/types/model/IServerItem.d.ts +3 -0
  26. package/dist/types/model/ISourceItem.d.ts +3 -0
  27. package/dist/types/model/IStreamItem.d.ts +3 -0
  28. package/dist/types/model/RTMPSourceItem.d.ts +50 -0
  29. package/dist/types/model/RTSPSourceItem.d.ts +50 -0
  30. package/dist/types/model/StormMetaDataItem.d.ts +3 -0
  31. package/dist/types/model/StormServerItem.d.ts +53 -0
  32. package/dist/types/model/StormSourceItem.d.ts +27 -0
  33. package/dist/types/model/StreamInfo.d.ts +46 -0
  34. package/dist/types/network/AbstractSocket.d.ts +94 -0
  35. package/dist/types/network/NetworkController.d.ts +33 -0
  36. package/dist/types/network/WowzaConnection.d.ts +63 -0
  37. package/dist/types/network/WowzaStatusConnection.d.ts +54 -0
  38. package/dist/types/playback/CooldownMonitor.d.ts +17 -0
  39. package/dist/types/playback/StreamerController.d.ts +267 -1
  40. package/dist/types/playback/enum/ConnectionState.d.ts +3 -0
  41. package/dist/types/playback/player/AbstractPlayer.d.ts +23 -0
  42. package/dist/types/playback/task/IPlaybackTask.d.ts +3 -0
  43. package/dist/types/stage/ScreenElement.d.ts +54 -0
  44. package/dist/types/stage/StageController.d.ts +86 -0
  45. package/dist/types/statistics/StatsController.d.ts +8 -0
  46. package/dist/types/storage/StorageManager.d.ts +37 -0
  47. package/dist/types/utilities/DomUtilities.d.ts +7 -0
  48. package/dist/types/utilities/NumberUtilities.d.ts +7 -0
  49. package/dist/types/utilities/UserCapabilities.d.ts +44 -0
  50. package/dist/umd/index.js +4 -4
  51. package/package.json +1 -1
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # [Storm JavaScript Streamer](http://stormstreaming.com/)
2
2
 
3
- Storm Library is a core web video streamer for embedding live-video streams on a website. It is a part of **Storm Streaming
4
- Suite** and requires **Storm Streaming Server** instance or **Cloud** subscription to work. This library contains only core network and media
5
- functionality and comes with no GUI (user interface), except for a video element.
3
+ StormStreamer is a core web broadcasting component for publishing live-video streams from a website. It is a part of Storm Streaming Suite and requires a Storm Streaming
4
+ Server instance or Cloud subscription to work. This library contains only core network and media functionality for streaming from cameras and microphones and comes with
5
+ no GUI (user interface).
6
6
 
7
7
  This library comes in **IIFE**, **ESM**, **AMD**, **UMD**, and **CJS** versions (if you don't know these, grab IIFE, and it will be OK). Typings are now also included.
8
8
 
@@ -18,6 +18,133 @@ 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
+ ## Publishing and unpublishing to a streamKey (manual method)
22
+
23
+ ```JavaScript
24
+ /**
25
+ * Publishing to streamKey called "test"
26
+ */
27
+ stormStreamer.publish("test");
28
+
29
+ /**
30
+ * Unpublishes stream.
31
+ */
32
+ stormStreamer.unpublish();
33
+ ```
34
+
35
+
36
+ ## Attaching and detaching streamer (manual method)
37
+
38
+ ```JavaScript
39
+ /**
40
+ * Attaching streamer to a container by container ID
41
+ */
42
+ stormStreamer.attachToContainer("containerName");
43
+
44
+
45
+ /**
46
+ * Attaching streamer to a container by a reference
47
+ */
48
+ const myContainer = document.getElementById("containerName")
49
+ stormStreamer.attachToContainer(myContainer);
50
+
51
+ /**
52
+ * Detaching streamer from a container (it'll also stop the stream)
53
+ */
54
+ stormStreamer.detachFromContainer();
55
+ ```
56
+
57
+
58
+ ## Resizing streamer (manual method)
59
+
60
+ ```JavaScript
61
+ /**
62
+ * Setting streamer width and height to 100% of its parent
63
+ */
64
+ stormStreamer.setSize("100%", "100%");
65
+
66
+ /**
67
+ * Setting width and height to 1280x720
68
+ */
69
+ stormStreamer.setSize("1280px", "720px");
70
+
71
+ /**
72
+ * Setting just width to 100%
73
+ */
74
+ stormStreamer.setWidth("100%");
75
+
76
+ /**
77
+ * Setting height to 720px
78
+ */
79
+ stormStreamer.setHeight("720px");
80
+ ```
81
+
82
+ ## Basic API
83
+
84
+ | Method | Returns | Return type | Description |
85
+ |:---------------------------------------------------:|:-----------------------------------------------------------------:|:-----------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
86
+ | 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. |
87
+ | isInitialized() | _true_ if this streamer instance was already initialized | boolean | Returns _true_ if this streamer instance has already been initialized. |
88
+ | 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. |
89
+ | 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. |
90
+ | getBranch() | Name of a development branch | string | Returns the development branch of this streamer (e.g., main, experimental). |
91
+ | 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). |
92
+ | start() | - | Promise<void> | Starts the streaming process. |
93
+ | stop() | - | void | Stops the streaming process. |
94
+ | mute() | - | void | Mutes the streamer's video object. Audio output will be silenced. |
95
+ | unmute() | - | void | Unmutes the streamer's video object. Audio output will be restored. |
96
+ | toggleMute() | New mute state after toggling | boolean | Toggles between mute and unmute states. Returns the new mute state. |
97
+ | isMute() | _true_ if the streamer is muted | boolean | Checks whether the streamer audio is currently muted. |
98
+ | 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. |
99
+ | getVolume() | Current volume level 0-100 | number | Returns current streamer volume (0-100). |
100
+ | getCameraList() | Array containing available cameras | InputDevice[] | Returns the list of available camera devices. |
101
+ | getMicrophoneList() | Array containing available microphones | InputDevice[] | Returns the list of available microphone devices. |
102
+ | setCamera(cameraID:string) | - | void | Sets the active camera device by ID. |
103
+ | setMicrophone(microphoneID:string) | - | void | Sets the active microphone device by ID. |
104
+ | getCurrentCamera() | Currently active camera or null | InputDevice / null | Returns the currently active camera device or null if none is active. |
105
+ | getCurrentMicrophone() | Currently active microphone or null | InputDevice / null | Returns the currently active microphone device or null if none is active. |
106
+ | muteMicrophone(microphoneState:boolean) | - | void | Mutes or unmutes the microphone. True to mute, false to unmute. |
107
+ | isMicrophoneMuted() | _true_ if the microphone is currently muted | boolean | Checks if the microphone is currently muted. |
108
+ | getPublishState() | Current publish state (NOT_INITIALIZED, INITIALIZING, etc.) | PublishState | Returns the current publishing state of the streamer. |
109
+ | getPublishTime() | Time in milliseconds since publishing | number | Returns the total time the stream has been publishing in milliseconds. |
110
+ | publish(streamKey:string) | _true_ if publishing was successfully initiated | boolean | Starts publishing a stream with the given stream key. |
111
+ | unpublish() | - | void | Stops publishing the current stream. |
112
+ | getInputDevicesState() | Current state of input devices (camera and microphone) | InputDevicesState | Returns the current state of input devices (camera and microphone). |
113
+ | getCameraState() | Current camera device state | DeviceState | Returns the current state of the camera device. |
114
+ | getMicrophoneState() | Current microphone device state | DeviceState | Returns the current state of the microphone device. |
115
+ | clearSavedDevices() | - | void | Clears saved device preferences from storage. |
116
+ | messSavedDevices() | - | void | Randomizes saved device preferences (for testing purposes). |
117
+ | isStreamReady() | _true_ if the stream is ready for publishing | boolean | Checks if the stream is ready for publishing. |
118
+ | 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. |
119
+ | 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. |
120
+ | getWidth() | Streamer object width | number | Returns current streamer width in pixels. |
121
+ | 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. |
122
+ | getHeight() | Streamer object height | number | Returns current streamer height in pixels. |
123
+ | updateToSize() | - | void | Forces the streamer to recalculate its size based on parent internal dimensions. |
124
+ | setScalingMode(newMode:string) | - | void | Changes the streamer scaling mode. Available modes include fill, letterbox, original, and crop. |
125
+ | getScalingMode() | Current scaling mode | ScalingType | Returns the current streamer scaling mode. |
126
+ | setStreamConfig(config:StreamerConfig) | - | void | Sets stream config for the streamer (or overwrites an existing one). |
127
+ | 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. |
128
+ | 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. |
129
+ | 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. |
130
+ | 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. |
131
+ | 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. |
132
+ | stopAllGraphs() | - | void | Stops all active performance graphs. |
133
+ | 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. |
134
+ | detachFromContainer() | _true_ if detaching was successful | boolean | Detaches the streamer from the current parent element, if possible. |
135
+ | getContainer() | Parent HTMLElement or null | HTMLElement / null | Returns the current parent element of the streamer, or _null_ if none exists. |
136
+ | enterFullScreen() | - | void | Enters fullscreen mode for the streamer container. |
137
+ | exitFullScreen() | - | void | Exits fullscreen mode. |
138
+ | isFullScreenMode() | _true_ if the streamer is in fullscreen mode | boolean | Returns _true_ if the streamer is currently in fullscreen mode. |
139
+ | getStreamKey() | Current stream key or null | string / null | Returns the current stream key or null if none is set. |
140
+ | getStatsController() | Object containing streaming statistics | StatsController/null | Returns the Stats Controller instance which contains statistical data about streaming performance. |
141
+ | getVideoElement() | Reference to the main Video Element | HTMLVideoElement/null | Returns the HTML video element used by this streamer instance. |
142
+ | getNetworkController() | Object responsible for managing server communication | NetworkController/null | Returns the network controller which manages all server communication. |
143
+ | getStreamerController() | Object responsible for media stream operations | StreamerController/null | Returns the streamer controller which manages media stream operations. |
144
+ | getStageController() | Object responsible for visual presentation | StageController/null | Returns the stage controller which manages visual presentation. |
145
+ | getStorageManager() | Object responsible for data storage | StorageManager/null | Returns the storage manager which handles persistent data storage. |
146
+
147
+
21
148
  # Browser compatibility
22
149
 
23
150
  - Edge 12+