srcObject property

  1. @override
MediaStream? get srcObject
inherited

Implementation

@override
MediaStream? get srcObject => _srcObject;
  1. @override
set srcObject (MediaStream? stream)
inherited

Implementation

@override
set srcObject(MediaStream? stream) {
  if (_disposed) {
    throw 'Can\'t set srcObject: The RTCVideoRenderer is disposed';
  }
  if (textureId == null) throw 'Call initialize before setting the stream';
  _srcObject = stream;
  WebRTC.invokeMethod('videoRendererSetSrcObject', <String, dynamic>{
    'textureId': textureId,
    'streamId': stream?.id ?? '',
    'ownerTag': stream?.ownerTag ?? ''
  }).then((_) {
    value = (stream == null)
        ? RTCVideoValue.empty
        : value.copyWith(renderVideo: renderVideo);
  }).catchError((e) {
    print('Got exception for RTCVideoRenderer::setSrcObject: ${e.message}');
  }, test: (e) => e is PlatformException);
}