StreamInfo
Defined in: core/streaminfo.ts:38
The StreamInfo class provides methods to monitor the current active streams activity and other details.
This can be used together with #core/Output Output Class and check the details of the currently live outputs.
Basic Usage
Section titled “Basic Usage”var xjs = require('xjs');
xjs.ready().then(xjs.StreamInfo.getActiveStreamChannels).then(function(channels) { var stream = [] channels.forEach(function(channel){ channel.getName() .then(name => { if(name.includes('Twitch')) { stream.push(channel) } }) }) return stream}).then(function(stream) { // Get any stream information you need here return stream[0].getStreamRenderedFrames()})Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new StreamInfo(
props):StreamInfo
Defined in: core/streaminfo.ts:44
StreamInfo constructor (only used internally)
Parameters
Section titled “Parameters”channel
Section titled “channel”string
Returns
Section titled “Returns”StreamInfo
Methods
Section titled “Methods”getBandwidthUsage()
Section titled “getBandwidthUsage()”getBandwidthUsage():
Promise<number>
Defined in: core/streaminfo.ts:169
return: Promise
Gets the current bandwidth usage of the stream
Returns
Section titled “Returns”Promise<number>
getGOPDrops()
Section titled “getGOPDrops()”getGOPDrops():
Promise<number>
Defined in: core/streaminfo.ts:120
return: Promise
Gets the number of GOP frames dropped
Returns
Section titled “Returns”Promise<number>
getName()
Section titled “getName()”getName():
Promise<string>
Defined in: core/streaminfo.ts:86
return: Promise
Gets the name of the channel.
Returns
Section titled “Returns”Promise<string>
getStreamDrops()
Section titled “getStreamDrops()”getStreamDrops():
Promise<number>
Defined in: core/streaminfo.ts:104
return: Promise
Gets the number of frames dropped
Returns
Section titled “Returns”Promise<number>
getStreamRenderedFrames()
Section titled “getStreamRenderedFrames()”getStreamRenderedFrames():
Promise<number>
Defined in: core/streaminfo.ts:139
return: Promise
Gets the number of frames rendered
Returns
Section titled “Returns”Promise<number>
getStreamTime()
Section titled “getStreamTime()”getStreamTime():
Promise<number>
Defined in: core/streaminfo.ts:155
return: Promise
Gets the current duration of the stream in microseconds
Returns
Section titled “Returns”Promise<number>
getActiveStreamChannels()
Section titled “getActiveStreamChannels()”
staticgetActiveStreamChannels():Promise<StreamInfo[]>
Defined in: core/streaminfo.ts:55
return: Promise<StreamInfo[]>
Gets the list of currently active channels.
Returns
Section titled “Returns”Promise<StreamInfo[]>