Skip to content

Commit

Permalink
Update HMSPeer object
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 committed Nov 7, 2023
1 parent c913bf6 commit 1bf4201
Showing 1 changed file with 2 additions and 35 deletions.
37 changes: 2 additions & 35 deletions packages/hmssdk_flutter/lib/src/model/hms_peer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,42 +80,9 @@ class HMSPeer {
int get hashCode => peerId.hashCode;

factory HMSPeer.fromMap(Map map) {
HMSRole role = HMSRole.fromMap(map['role']);

// TODO: add auxiliary tracks

HMSPeer peer = (map['is_local'] == true)
return (map['is_local'] == true)
? HMSLocalPeer.fromMap(map)
: HMSRemotePeer(
peerId: map['peer_id'],
name: map['name'],
isLocal: map['is_local'],
isHandRaised: map['is_hand_raised'],
role: role,
metadata: map['metadata'],
customerUserId: map['customer_user_id'],
networkQuality: map['network_quality'] == null
? null
: HMSNetworkQuality.fromMap(map['network_quality']),
joinedAt: map.containsKey("joined_at")
? HMSDateExtension.convertDate(map["joined_at"])
: null,
updatedAt: map.containsKey("updated_at")
? HMSDateExtension.convertDate(map["updated_at"])
: null,
);

if (map['audio_track'] != null) {
peer.audioTrack = HMSAudioTrack.fromMap(
map: map['audio_track']!, isLocal: peer.isLocal);
}

if (map['video_track'] != null) {
peer.videoTrack = HMSVideoTrack.fromMap(
map: map['video_track']!, isLocal: peer.isLocal);
}

return peer;
: HMSRemotePeer.fromMap(map);
}

@override
Expand Down

0 comments on commit 1bf4201

Please sign in to comment.