@@ -40,7 +40,8 @@ class FLVideoView: NSObject, FlutterPlatformView {
4040 do {
4141 let participantId : String ? = try flutterArguments. asDictionary ( argKey: " participant_id " ) . decode ( )
4242 let mediaStreamId : String ? = try flutterArguments. asDictionary ( argKey: " media_stream_id " ) . decode ( )
43- try attach ( participantId: participantId, mediaStreamId: mediaStreamId)
43+ let scaleType : String ? = try flutterArguments. asDictionary ( argKey: " scale_type " ) . decode ( )
44+ try attach ( participantId: participantId, mediaStreamId: mediaStreamId, scaleType: scaleType)
4445 } catch {
4546 completionHandler. failure ( error)
4647 }
@@ -65,7 +66,7 @@ class FLVideoView: NSObject, FlutterPlatformView {
6566 completionHandler. success ( flutterConvertible: false ) // TODO: Implement this properly
6667 }
6768
68- private func attach( participantId: String ? , mediaStreamId: String ? ) throws {
69+ private func attach( participantId: String ? , mediaStreamId: String ? , scaleType : String ? ) throws {
6970 guard
7071 let participantId = participantId, participantId != " " ,
7172 let mediaStreamId = mediaStreamId, mediaStreamId != " " ,
@@ -78,8 +79,20 @@ class FLVideoView: NSObject, FlutterPlatformView {
7879 _view. unattach ( )
7980 return
8081 }
82+ updateScaleType ( view: _view, scaleType: scaleType)
8183 _view. attach ( participant: participantObject, stream: mediaStreamObject)
8284 }
85+
86+ private func updateScaleType( view: VTVideoView , scaleType: String ? , animated: Bool = false ) {
87+ switch scaleType {
88+ case " SCALE_TYPE_FILL " :
89+ view. contentFill ( true , animated: animated)
90+ case " SCALE_TYPE_FIT " :
91+ view. contentFill ( false , animated: animated)
92+ default :
93+ break
94+ }
95+ }
8396}
8497
8598extension FLVideoView : FlutterBinding {
0 commit comments