@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
@@ -1,15 +1,49 @@
1
1
  import { StormStreamerEvent } from "./StormStreamerEvent";
2
2
  import { StormStreamerListener } from "./StormStreamerListener";
3
3
  import { Logger } from "../logger/Logger";
4
+ /**
5
+ * General class for event-listeners
6
+ */
4
7
  export declare class EventDispatcher {
8
+ /**
9
+ * Whenever instance of this class has been removed
10
+ * @protected
11
+ */
5
12
  protected _isRemoved: boolean;
13
+ /**
14
+ * Logger attached to this player
15
+ * @private
16
+ */
6
17
  protected _logger: Logger;
18
+ /**
19
+ * An array storing all the listeners
20
+ * @private
21
+ */
7
22
  protected _listeners: {
8
23
  [K in keyof StormStreamerEvent]?: Array<StormStreamerListener<K>>;
9
24
  };
10
25
  constructor();
26
+ /**
27
+ * Method registers event listener with the object
28
+ * @param eventName name of an event (as a string)
29
+ * @param listener a reference to a method
30
+ * @param removable whenever this listener can be removed or not
31
+ */
11
32
  addEventListener<K extends keyof StormStreamerEvent>(eventName: K, listener: (ev: StormStreamerEvent[K]) => void, removable?: boolean): boolean;
33
+ /**
34
+ * Method removes a listener from this object based on event name and used method
35
+ * @param eventName name of an event (as a string)
36
+ * @param listenera reference to a method (optional)
37
+ */
12
38
  removeEventListener<K extends keyof StormStreamerEvent>(eventName: K, listener?: (ev: StormStreamerEvent[K]) => void): boolean;
39
+ /**
40
+ * Method removes all event listeners
41
+ */
13
42
  removeAllEventListeners<K extends keyof StormStreamerEvent>(): void;
43
+ /**
44
+ * Method dispatches an event of a given eventName
45
+ * @param eventName
46
+ * @param event
47
+ */
14
48
  dispatchEvent<K extends keyof StormStreamerEvent>(eventName: K, event: StormStreamerEvent[K]): void;
15
49
  }
@@ -0,0 +1,11 @@
1
+ import { StormStreamer } from "../StormStreamer";
2
+ import { IGraph } from "./IGraph";
3
+ export declare class MicrophoneGraph implements IGraph {
4
+ private _object;
5
+ private _main;
6
+ private _graph;
7
+ constructor(main: StormStreamer, container: string | HTMLElement);
8
+ start(): MicrophoneGraph;
9
+ private onStreamStatsUpdate;
10
+ stop(): MicrophoneGraph;
11
+ }
@@ -1,26 +1,129 @@
1
+ /**
2
+ * Logger that helps outputting messages
3
+ */
1
4
  import { DebugData } from "../config/DebugData";
2
5
  import { StormStreamer } from "../StormStreamer";
3
6
  export declare class Logger {
7
+ /**
8
+ * Defines what color an info log would be outputted (can be either a color name or #hex)
9
+ * @private
10
+ */
4
11
  private static INFO_COLOR;
12
+ /**
13
+ * Defines what color a warning log would be outputted (can be either a color name or #hex)
14
+ * @private
15
+ */
5
16
  private static WARNING_COLOR;
17
+ /**
18
+ * Defines what color an error log would be outputted (can be either a color name or #hex)
19
+ * @private
20
+ */
6
21
  private static ERROR_COLOR;
22
+ /**
23
+ * Defines what color a success log would be outputted (can be either a color name or #hex)
24
+ * @private
25
+ */
7
26
  private static SUCCESS_COLOR;
27
+ /**
28
+ * Defines what color a success log would be outputted (can be either a color name or #hex)
29
+ * @private
30
+ */
8
31
  private static TRACE_COLOR;
32
+ /**
33
+ * Stores original debug config object
34
+ * @private
35
+ */
9
36
  private _debugConfig;
37
+ /**
38
+ * Reference to main object
39
+ * @private
40
+ */
10
41
  private _stormStreamer;
42
+ /**
43
+ * List of colors used for monoColor option
44
+ * @private
45
+ */
11
46
  private colorOrder;
47
+ /**
48
+ * Selected monocolor
49
+ * @private
50
+ */
12
51
  private _monoColor;
52
+ /**
53
+ * Stores all loges within this array
54
+ * @private
55
+ */
13
56
  private _logMemory;
57
+ /**
58
+ * Main name of the instance
59
+ * @private
60
+ */
14
61
  private _streamerInstanceID;
62
+ /**
63
+ * Constructor
64
+ *
65
+ * @param config object containing settings for logger
66
+ * @param stormLibrary reference to main class
67
+ */
15
68
  constructor(config: DebugData, stormStreamer: StormStreamer);
69
+ /**
70
+ * Creates new "info" type log
71
+ *
72
+ * @param objectName object that called the log
73
+ * @param message log message
74
+ */
16
75
  info(objectName: any, message: string): void;
76
+ /**
77
+ * Creates new "warning" type log
78
+ *
79
+ * @param objectName object that called the log
80
+ * @param message log message
81
+ */
17
82
  warning(objectName: any, message: string): void;
18
83
  decoratedLog(text: string, scheme: string): void;
84
+ /**
85
+ * Creates new "error" type log
86
+ *
87
+ * @param objectName object that called the log
88
+ * @param message log message
89
+ */
19
90
  error(objectName: any, message: string): void;
91
+ /**
92
+ * Creates new "success" type log
93
+ *
94
+ * @param objectName object that called the log
95
+ * @param message log message
96
+ */
20
97
  success(objectName: any, message: string): void;
98
+ /**
99
+ * Creates new "trace" type log
100
+ *
101
+ * @param objectName object that called the log
102
+ * @param message log message
103
+ */
21
104
  trace(objectName: any, message: string): void;
105
+ /**
106
+ * Prepares console message and formats its text
107
+ * @param _objectName object that called the log
108
+ * @param message log message
109
+ * @private
110
+ */
22
111
  private logData;
112
+ /**
113
+ * Writes log to a DOM container
114
+ *
115
+ * @param message the message
116
+ * @param color of the log
117
+ * @private
118
+ */
23
119
  private writeToContainer;
120
+ /**
121
+ * Sets player id
122
+ * @param playerID
123
+ */
24
124
  setPlayerID(playerID: number): void;
125
+ /**
126
+ * Returns all logs
127
+ */
25
128
  getAllLogs(): Array<string>;
26
129
  }
@@ -1,9 +1,32 @@
1
1
  import { ProtocolType } from "../config/enum/ProtocolType";
2
2
  import { StreamInfo } from "./StreamInfo";
3
+ /**
4
+ * Abstract class for all source items (e.g. webrtc, rtmp, mpeg-dash)
5
+ */
3
6
  export declare class AbstractSourceItem {
7
+ /**
8
+ * Protocol type e.g. RTMP, RTSP
9
+ * @private
10
+ */
4
11
  protected type: ProtocolType;
12
+ /**
13
+ * Info object (cointains data related to video width, height, fps, bitrate e.g.)
14
+ * @private
15
+ */
5
16
  protected streamInfo: StreamInfo;
17
+ /**
18
+ * Constructor
19
+ *
20
+ * @param type
21
+ * @param info
22
+ */
6
23
  constructor(type: ProtocolType, info: StreamInfo);
24
+ /**
25
+ * Returns protocol type
26
+ */
7
27
  getType(): ProtocolType;
28
+ /**
29
+ * Return info object
30
+ */
8
31
  getStreamInfo(): StreamInfo;
9
32
  }
@@ -1,17 +1,70 @@
1
1
  import { IServerItem } from "./IServerItem";
2
+ /**
3
+ * Class stores information related to storm gateway servers
4
+ */
2
5
  export declare class GatewayServerItem implements IServerItem {
6
+ /**
7
+ * Server url
8
+ * @private
9
+ */
3
10
  private host;
11
+ /**
12
+ * Application name
13
+ * @private
14
+ */
4
15
  private application;
16
+ /**
17
+ * Port for storm (default is 443)
18
+ * @private
19
+ */
5
20
  private port;
21
+ /**
22
+ * Whenver connection should be made via SSL (default is true)
23
+ * @private
24
+ */
6
25
  private isSSL;
26
+ /**
27
+ * Whenever player could not establish connection with this host
28
+ * @private
29
+ */
7
30
  private hasFaild;
31
+ /**
32
+ * Constructor
33
+ *
34
+ * @param host server URL e.g. "cdn-e001.stormstreaming.com"
35
+ * @param applicationName e.g. "live
36
+ * @param port usually 443
37
+ * @param isSSL whenever connection should be stablished via SSL (true by default)
38
+ */
8
39
  constructor(host: string, application: string, port?: number, isSSL?: boolean);
40
+ /**
41
+ * Returns server URL
42
+ */
9
43
  getHost(): string;
44
+ /**
45
+ * Returns port number
46
+ */
10
47
  getPort(): number;
48
+ /**
49
+ * Returns whenever connection should be established via SSL
50
+ */
11
51
  getIfSSL(): boolean;
52
+ /**
53
+ * Returns whenever connection faild while trying to connect
54
+ */
12
55
  getIfFaild(): boolean;
56
+ /**
57
+ * Marks this server as faild, prevent it from being used anymore
58
+ * @param value
59
+ */
13
60
  setAsFaild(value: boolean): void;
61
+ /**
62
+ * Returns application
63
+ */
14
64
  getApplication(): string;
65
+ /**
66
+ * Returns data from this object
67
+ */
15
68
  getData(): any;
16
69
  toString(): string;
17
70
  }
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Interface for source item
3
+ */
1
4
  export interface IServerItem {
2
5
  getHost(): string;
3
6
  getApplication(): string;
@@ -1,5 +1,8 @@
1
1
  import { ProtocolType } from "../config/enum/ProtocolType";
2
2
  import { StreamInfo } from "./StreamInfo";
3
+ /**
4
+ * Interface for source item
5
+ */
3
6
  export interface ISourceItem {
4
7
  getType(): ProtocolType;
5
8
  getStreamInfo(): StreamInfo;
@@ -1,4 +1,7 @@
1
1
  import { ProtocolType } from "../config/enum/ProtocolType";
2
+ /**
3
+ * Interface for source item
4
+ */
2
5
  export interface IStreamItem {
3
6
  getType(): ProtocolType;
4
7
  getStreamName(): string;
@@ -1,17 +1,67 @@
1
1
  import { AbstractSourceItem } from "./AbstractSourceItem";
2
2
  import { ISourceItem } from "./ISourceItem";
3
3
  import { StreamInfo } from "./StreamInfo";
4
+ /**
5
+ * Class containing RTMP Source Item
6
+ */
4
7
  export declare class RTMPSourceItem extends AbstractSourceItem implements ISourceItem {
8
+ /**
9
+ * RTMP URL
10
+ * @private
11
+ */
5
12
  private host;
13
+ /**
14
+ * RTMP Application name. May also include instance e.g. "live/test")
15
+ * @private
16
+ */
6
17
  private application;
18
+ /**
19
+ * Name of the stream. May include prefix and paths e.g. mp4:/vod/test
20
+ * @private
21
+ */
7
22
  private streamKey;
23
+ /**
24
+ * RTMP Port
25
+ * @private
26
+ */
8
27
  private port;
28
+ /**
29
+ * Whenever this source item is default
30
+ * @private
31
+ */
9
32
  private defaultSource;
33
+ /**
34
+ * Constructor
35
+ * @param host rtmp url
36
+ * @param application
37
+ * @param streamName
38
+ * @param port rtmp port
39
+ * @param streamInfo
40
+ * @param defaultSource
41
+ */
10
42
  constructor(host: string, application: string, streamKey: string, port: number, streamInfo: StreamInfo, defaultSource: boolean);
43
+ /**
44
+ * Returns source URL
45
+ */
11
46
  getHost(): string;
47
+ /**
48
+ * Returns source port
49
+ */
12
50
  getPort(): number;
51
+ /**
52
+ * Returns source application name
53
+ */
13
54
  getApplicationName(): string;
55
+ /**
56
+ * Returns source stream name
57
+ */
14
58
  getStreamKey(): string;
59
+ /**
60
+ * Returns whenver source is default for this playback
61
+ */
15
62
  isDefaultSource(): boolean;
63
+ /**
64
+ * Creates a string containing source information in readble form
65
+ */
16
66
  toString(): string;
17
67
  }
@@ -1,17 +1,67 @@
1
1
  import { AbstractSourceItem } from "./AbstractSourceItem";
2
2
  import { ISourceItem } from "./ISourceItem";
3
3
  import { StreamInfo } from "./StreamInfo";
4
+ /**
5
+ * Class containing RTMP Source Item
6
+ */
4
7
  export declare class RTSPSourceItem extends AbstractSourceItem implements ISourceItem {
8
+ /**
9
+ * RTMP URL
10
+ * @private
11
+ */
5
12
  private host;
13
+ /**
14
+ * RTMP Application name. May also include instance e.g. "live/test")
15
+ * @private
16
+ */
6
17
  private application;
18
+ /**
19
+ * Name of the stream. May include prefix and paths e.g. mp4:/vod/test
20
+ * @private
21
+ */
7
22
  private streamKey;
23
+ /**
24
+ * RTMP Port
25
+ * @private
26
+ */
8
27
  private port;
28
+ /**
29
+ * Whenever this source item is default
30
+ * @private
31
+ */
9
32
  private defaultSource;
33
+ /**
34
+ * Constructor
35
+ * @param host rtmp url
36
+ * @param application
37
+ * @param streamName
38
+ * @param port rtmp port
39
+ * @param streamInfo
40
+ * @param defaultSource
41
+ */
10
42
  constructor(host: string, application: string, streamKey: string, port: number, streamInfo: StreamInfo, defaultSource: boolean);
43
+ /**
44
+ * Returns source URL
45
+ */
11
46
  getHost(): string;
47
+ /**
48
+ * Returns source port
49
+ */
12
50
  getPort(): number;
51
+ /**
52
+ * Returns source application name
53
+ */
13
54
  getApplicationName(): string;
55
+ /**
56
+ * Returns source stream name
57
+ */
14
58
  getStreamKey(): string;
59
+ /**
60
+ * Returns whenver source is default for this playback
61
+ */
15
62
  isDefaultSource(): boolean;
63
+ /**
64
+ * Creates a string containing source information in readble form
65
+ */
16
66
  toString(): string;
17
67
  }
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Interface for source item
3
+ */
1
4
  export declare class StormMetaDataItem {
2
5
  private videoWidth;
3
6
  private videoHeight;
@@ -1,17 +1,70 @@
1
1
  import { IServerItem } from "./IServerItem";
2
+ /**
3
+ * Class stores information related to storm servers
4
+ */
2
5
  export declare class StormServerItem implements IServerItem {
6
+ /**
7
+ * Server url
8
+ * @private
9
+ */
3
10
  private host;
11
+ /**
12
+ * Application name
13
+ * @private
14
+ */
4
15
  private application;
16
+ /**
17
+ * Port for storm (default is 443)
18
+ * @private
19
+ */
5
20
  private port;
21
+ /**
22
+ * Whenver connection should be made via SSL (default is true)
23
+ * @private
24
+ */
6
25
  private isSSL;
26
+ /**
27
+ * Whenever player could not establish connection with this host
28
+ * @private
29
+ */
7
30
  private hasFaild;
31
+ /**
32
+ * Constructor
33
+ *
34
+ * @param host server URL e.g. "cdn-e001.stormstreaming.com"
35
+ * @param applicationName e.g. "live
36
+ * @param port usually 443
37
+ * @param isSSL whenever connection should be stablished via SSL (true by default)
38
+ */
8
39
  constructor(host: string, application: string, port?: number, isSSL?: boolean);
40
+ /**
41
+ * Returns server URL
42
+ */
9
43
  getHost(): string;
44
+ /**
45
+ * Returns server application
46
+ */
10
47
  getApplication(): string;
48
+ /**
49
+ * Returns port number
50
+ */
11
51
  getPort(): number;
52
+ /**
53
+ * Returns whenever connection should be established via SSL
54
+ */
12
55
  getIfSSL(): boolean;
56
+ /**
57
+ * Returns whenever connection faild while trying to connect
58
+ */
13
59
  getIfFaild(): boolean;
60
+ /**
61
+ * Marks this server as faild, prevent it from being used anymore
62
+ * @param value
63
+ */
14
64
  setAsFaild(value: boolean): void;
65
+ /**
66
+ * Returns data from this object
67
+ */
15
68
  getData(): any;
16
69
  toString(): string;
17
70
  }
@@ -1,11 +1,38 @@
1
1
  import { AbstractSourceItem } from "./AbstractSourceItem";
2
2
  import { ISourceItem } from "./ISourceItem";
3
3
  import { StreamInfo } from "./StreamInfo";
4
+ /**
5
+ * Class containing Storm Source Item
6
+ */
4
7
  export declare class StormSourceItem extends AbstractSourceItem implements ISourceItem {
8
+ /**
9
+ * Name of the stream.
10
+ * @private
11
+ */
5
12
  private streamKey;
13
+ /**
14
+ * Whenever this source item is default
15
+ * @private
16
+ */
6
17
  private defaultSource;
18
+ /**
19
+ * Constructor
20
+ * @param streamKey
21
+ * @param applicationName
22
+ * @param streamInfo
23
+ * @param defaultSource
24
+ */
7
25
  constructor(streamKey: string, streamInfo: StreamInfo, defaultSource: boolean);
26
+ /**
27
+ * Returns source stream name
28
+ */
8
29
  getStreamKey(): string;
30
+ /**
31
+ * Returns whenver source is default for this playback
32
+ */
9
33
  isDefaultSource(): boolean;
34
+ /**
35
+ * Creates a string containing source information in readble form
36
+ */
10
37
  toString(): string;
11
38
  }
@@ -1,17 +1,63 @@
1
+ /**
2
+ * Class containing information related to the stream
3
+ */
1
4
  export declare class StreamInfo {
5
+ /**
6
+ * Label (e.g. "720p)
7
+ * @private
8
+ */
2
9
  private label;
10
+ /**
11
+ * Monogram (e.g. "hd")
12
+ * @private
13
+ */
3
14
  private monogram;
15
+ /**
16
+ * Video width
17
+ * @private
18
+ */
4
19
  private width;
20
+ /**
21
+ * Video height
22
+ * @private
23
+ */
5
24
  private height;
25
+ /**
26
+ * Video Frames Per Seconds
27
+ * @private
28
+ */
6
29
  private fps;
30
+ /**
31
+ * Video BitRate
32
+ * @private
33
+ */
7
34
  private bitrate;
35
+ /**
36
+ * Constructor
37
+ * @param config object with video data
38
+ */
8
39
  constructor(config: any);
9
40
  assignMonogram(): void;
41
+ /**
42
+ * Returns source label
43
+ */
10
44
  getLabel(): string;
11
45
  getMonogram(): string;
46
+ /**
47
+ * Returns video width
48
+ */
12
49
  getWidth(): number;
50
+ /**
51
+ * Returns video height
52
+ */
13
53
  getHeight(): number;
54
+ /**
55
+ * Returns video fps
56
+ */
14
57
  getFPS(): number;
58
+ /**
59
+ * Returns video BitRate
60
+ */
15
61
  getBitrate(): number;
16
62
  toString(): string;
17
63
  }