👉 iOS SDK
Style of IVSBroadcastCameraView
component.
Type | Required | Platform |
---|---|---|
StyleProp<ViewStyle> |
No | iOS, Android |
Used to locate IVSBroadcastCameraView
component in the end-to-end tests.
Type | Required | Platform |
---|---|---|
string |
No | iOS, Android |
The RTMPS endpoint provided by IVS.
Type | Required | Platform |
---|---|---|
string |
No | iOS, Android |
The RTMPS url can be also provided via start
method.
The broadcaster’s stream key that has been provided by IVS.
Type | Required | Platform |
---|---|---|
string |
No | iOS, Android |
The stream key can be also provided via start
method.
Predefined video configuration for broadcast session. Can be overridden by providing videoConfig
prop.
Type | Required | Platform |
---|---|---|
ConfigurationPreset |
No | iOS, Android |
A configuration object describing the desired format of the final output Video stream.
Type | Required |
---|---|
IVideoConfig |
No |
IVSBroadcastCameraView
component will not have any effect. A copy of the configuration is made and kept internally.
Default video config unless configurationPreset
is provided:
Key | Value | Platform |
---|---|---|
width |
720 |
iOS, Android |
height |
1280 |
iOS, Android |
bitrate |
2100000 |
iOS, Android |
targetFrameRate |
30 |
iOS, Android |
keyframeInterval |
2 |
iOS, Android |
isBFrames |
true |
iOS, Android |
isAutoBitrate |
true |
iOS, Android |
autoBitrateProfile |
conservative |
iOS, Android |
maxBitrate |
6000000 |
iOS, Android |
minBitrate |
300000 |
iOS, Android |
A configuration object describing the desired format of the final output Audio stream.
Type | Required |
---|---|
IAudioConfig |
No |
IVSBroadcastCameraView
component will not have any effect. A copy of the configuration is made and kept internally.
Default audio config:
Key | Value | Platform |
---|---|---|
bitrate |
96000 |
iOS, Android |
channels |
2 |
iOS, Android |
audioSessionStrategy |
playAndRecord |
iOS |
quality |
medium |
iOS |
In order to catch logs at a more granular level than Error
during the initialization process, use this property instead of the sessionLogLevel
.
Type | Required | Platform | Default value |
---|---|---|---|
LogLevel |
No | iOS, Android | error |
Logging level for the broadcast session.
Type | Required | Platform | Default value |
---|---|---|---|
LogLevel |
No | iOS, Android | error |
Determines how view's aspect ratio will be maintained.
Type | Required | Platform | Default value |
---|---|---|---|
CameraPreviewAspectMode |
No | iOS, Android | none |
Flips the camera preview horizontally.
Type | Required | Platform | Default value |
---|---|---|---|
boolean |
No | iOS, Android | false |
The position of the input camera relative to the host device. Can be used to swap camera during session live.
Type | Required | Platform | Default value |
---|---|---|---|
CameraPosition |
No | iOS, Android | back |
Puts the active microphone on mute.
Type | Required | Platform | Default value |
---|---|---|---|
boolean |
No | iOS, Android | false |
peak
and rms
values of IAudioStats
are equal to -100
.
Indicates that module' internal error occurred.
Type | Required | Platform |
---|---|---|
onError(errorMessage: string): void |
No | iOS, Android |
Indicates that broadcast session error occurred. Errors may or may not be fatal. In the case of a fatal error the broadcast session moves into DISCONNECTED
state status.
Type | Required | Platform |
---|---|---|
onBroadcastError(error: IBroadcastSessionError ): void |
No | iOS, Android |
Fires(once) when initialization(including adding camera preview to the view hierarchy) is done.
Type | Required | Platform |
---|---|---|
onIsBroadcastReady(isReady: boolean): void |
No | iOS, Android |
Periodically called with audio peak
and rms
in dBFS
.
Type | Required | Platform |
---|---|---|
onBroadcastAudioStats(audioStats: IAudioStats ): void |
No | iOS, Android |
Indicates that the broadcast state changed.
Type | Required | Platform |
---|---|---|
onBroadcastStateChanged(stateStatus: StateStatusUnion , metadata?: StateChangedMetadata ): void |
No | iOS, Android |
CONNECTED
state status only.
Periodically called with current statistics on the broadcast, such as the measured bitrate, recommended bitrate by the SDK's adaptive bitrate algorithm, average round trip time, broadcast quality (relative to configured minimum and maximum bitrates), and network health.
Type | Required | Platform |
---|---|---|
onTransmissionStatisticsChanged(transmissionStatistics: ITransmissionStatistics ): void |
No | iOS, Android |
🚧 DEPRECATED in favor of onTransmissionStatisticsChanged
event handler.
Represents the quality of the stream.
Type | Required | Platform |
---|---|---|
onBroadcastQualityChanged(quality: number): void |
No | iOS, Android |
quality
is a number between 0
and 1
that represents the quality of the stream based on minimum and maximum bitrate provided in the videoConfig
. 0
means the stream is at the lowest possible quality, or streaming is not possible at all. 1
means the bitrate is near the maximum allowed.
🚧 DEPRECATED in favor of onTransmissionStatisticsChanged
event handler.
Provides updates when the instantaneous quality of the network changes. It can be used to provide feedback about when the broadcast might have temporary disruptions.
Type | Required | Platform |
---|---|---|
onNetworkHealthChanged(networkHealth: number): void |
No | iOS, Android |
networkHealth
is a number between 0
and 1
that represents the current health of the network. 0
means the network is struggling to keep up and the broadcast may be experiencing latency spikes. The SDK may also reduce the quality of the broadcast on low values in order to keep it stable, depending on the minimum allowed bitrate in the videoConfig
. A value of 1
means the network is easily able to keep up with the current demand and the SDK will be trying to increase the broadcast quality over time, depending on the maximum allowed bitrate. Lower values like 0.5
are not necessarily bad, it just means the network is being saturated, but it is still able to keep up.
Indicates that audio session has been interrupted.
Type | Required | Platform |
---|---|---|
onAudioSessionInterrupted(): void |
No | iOS |
- User receives a phone call or FaceTime call
- User activates Siri
Indicates that audio session has been resumed (after interrupted).
Type | Required | Platform |
---|---|---|
onAudioSessionResumed(): void |
No | iOS |
In very rare cases, the entire media subsystem on an iOS device will crash. In this scenario, the SDK can no longer broadcast.
Indicates that the media server services are terminated. Respond by stopping and completely deallocating broadcast session. All internal components used by the broadcast session will be invalidated.
Type | Required | Platform |
---|---|---|
onMediaServicesWereLost(): void |
No | iOS |
Indicates that the media server services are reset. Respond by notifying consumers that they can broadcast again. Depending on the case, you may be able to automatically start broadcasting again at this point.
Type | Required | Platform |
---|---|---|
onMediaServicesWereReset(): void |
No | iOS |
Start the configured broadcast session.
Type | Required | Platform |
---|---|---|
(options?: StartMethodOptions ): void |
No | iOS, Android |
rtmpsUrl
and streamKey
which are passed to the start
method take precedence over the equivalent component props.
Stop the broadcast session, but do not deallocate resources.
Type | Required | Platform |
---|---|---|
(): void |
No | iOS, Android |
🚧 DEPRECATED in favor of declarative way using cameraPosition
prop.
Swap back camera to front camera and vice versa.
Type | Required | Platform |
---|---|---|
(): void |
No | iOS, Android |