Class: AmazonIVSBroadcastClient
A class implementing the Web Broadcast SDK API.
Constructors
new AmazonIVSBroadcastClient()
new AmazonIVSBroadcastClient(
config):AmazonIVSBroadcastClient
Creates an instance of the AmazonIVSBroadcastClient.
Parameters
• config: Config
[[Config]]
Returns
Properties
config
config:
Config
[[Config]]
emitter
emitter:
IEventEmitter
Methods
addAudioInputDevice()
addAudioInputDevice(
device,name):Promise<void>
Adds the specified audio input to the broadcast stream.
Parameters
• device: MediaStream
Audio input to add to the stream.
• name: string
Unique string you assign to the audio-input device.
Returns
Promise<void>
addImageSource()
addImageSource(
image,name,position):Promise<void>
Adds the specified image to the broadcast stream.
Parameters
• image: HTMLVideoElement | HTMLCanvasElement | HTMLImageElement | ImageBitmap
Image to add to the stream. Must be of type HTMLImageElement, HTMLVideoElement, HTMLCanvasElement or ImageBitmap.
• name: string
Unique string you assign to the image.
• position: VideoComposition
The desired position of the image in the stream.
Returns
Promise<void>
addVideoInputDevice()
addVideoInputDevice(
device,name,position):Promise<void>
Adds the specified video input to the broadcast stream.
Parameters
• device: MediaStream
Video input to add to the stream.
• name: string
Unique string you assign to the video-input device.
• position: VideoComposition
The desired position of the video in the stream.
Returns
Promise<void>
attachPreview()
attachPreview(
element):void
Attach a HTMLCanvasElement to display a preview of the output.
Parameters
• element: HTMLCanvasElement
An HTMLCanvasElement on which to draw the composited preview.
Returns
void
delete()
delete():
void
Explicitly stop and/or free internal components that would otherwise leak.
Returns
void
detachPreview()
detachPreview():
void
Detach the HTMLCanvasElement preview element.
Returns
void
disableAudio()
disableAudio():
void
Disables all audio content from the stream.
Returns
void
disableVideo()
disableVideo():
void
Disables all video content from the stream.
Returns
void
enableAudio()
enableAudio():
void
Enables all audio content from the stream if previously disabled.
Returns
void
enableVideo()
enableVideo():
void
Enables all video content from the stream if previously disabled.
Returns
void
exchangeVideoDevicePositions()
exchangeVideoDevicePositions(
name1,name2):void
Exchanges (swaps) the VideoComposition settings of two video devices.
Parameters
• name1: string
Unique name of the video device to swap (one of two).
• name2: string
Unique name of the video device to swap (two of two).
Returns
void
getAudioContext()
getAudioContext():
AudioContext
Returns the Media Stream Manager's Audio Context to allow a user to have more direct control over the audio stream.
Returns
AudioContext
getAudioInputDevice()
getAudioInputDevice(
name):Maybe<MediaStream>
Gets the MediaStream of the specified audio device.