View constructor Null safety
- {required String streamName,
- required Function tokenGenerator,
- RTCVideoRenderer? mediaElement,
- bool autoReconnect = true}
Implementation
View(
{required String streamName,
required Function tokenGenerator,
RTCVideoRenderer? mediaElement,
bool autoReconnect = true})
: super(
streamName: streamName,
tokenGenerator: tokenGenerator,
autoReconnect: autoReconnect,
logger: _logger) {
if (mediaElement != null) {
webRTCPeer.on(webRTCEvents['track'], this, (ev, context) {
mediaElement.srcObject = ev.eventData as MediaStream?;
});
}
}