import 'package:fis_lib_media_rt/base/member.dart';
import 'package:fis_lib_media_rt/implementations/trtc/channel.dart';

class TrtcRemoteMember extends RemoteMember {
  TrtcRemoteMember({super.userId});

  void handleVideoAvailableChange(bool available) {
    final channel = getDefaultChannel();
    channel.setVideoMute(!available);
  }

  void handleAudioAvailableChange(bool available) {
    final channel = getDefaultChannel();
    channel.setAudioMute(!available);
  }

  TrtcPlayChannel getDefaultChannel() {
    if (channels.isEmpty) {
      final channel = TrtcPlayChannel(member: this);
      addChannel(channel);
      return channel;
    } else {
      return channels.first as TrtcPlayChannel;
    }
  }
}

class TrtcLocalMember extends LocalMember {
  TrtcLocalMember({required super.params});
}
