GithubHelp home page GithubHelp logo

enablex / one-to-one-video-calling-open-source-flutter-application Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 1.0 389.1 MB

Flutter SampleApp" is an ideal beginning for your Flutter app development journey. Explore Flutter's potential with lab tutorials and practical code samples in the Cookbook.

Home Page: https://www.enablex.io/cpaas/video-api

Ruby 3.76% Objective-C 0.05% Dart 35.45% Kotlin 0.17% Swift 2.16% CMake 24.34% C++ 29.96% C 1.78% HTML 2.34%
webrtc videochat videocall flutter-toolkit enablex enablex-platform

one-to-one-video-calling-open-source-flutter-application's Issues

App is Crashing

When I run the app and press the join button , its crashed and app got closed.

Attempt to invoke virtual method 'android.view.ViewParent android.widget.FrameLayout.getParent()' on a null object reference

This error comes on Android only. Works fine on iOS.

When I initiate or join a video call from Android for the very first time, then everything works fine. I am able to see the remote video as well as local video. But if I disconnect and try to initiate/join the call the 2nd time then I am not able to view my local video and it throws this error in the log.

Android 9, 10

Flutter Version - 2.5.3

enx_flutter_plugin: ^1.9.4

I use EnxRtc.disconnect(); to disconnect from the call.

This works fine on iOS but throws this exception on Android only


onEventInfo

[onEventInfo] {msg: Invaid Frame Rate, result: 5088, desc: Failed to initiate stream with invalid Frame Rate. Max Frame Rate is 30}


_addEnxrtcEventHandlers

`
void _addEnxrtcEventHandlers() async {
EnxRtc.onRoomConnected = (Map<dynamic, dynamic> map) async {
log('${map.toString()}', name: 'onRoomConnected', error: map);

  setState(() {
    EnxRtc.publish();
  });
};

EnxRtc.onRemoteStreamAudioMute = (Map<dynamic, dynamic> map) {
  log('onRemoteStreamAudioMute',
      name: 'onRemoteStreamAudioMute', error: map.toString());
  setState(() {
    try {
      isRemoteAudioMuted = map['user']['audioMuted'];
    } catch (e) {}
  });
  showFlushBar(
    context,
    0,
    '$otherUserName muted their audio',
    durationInMilliseconds: flushbarDurationInMilliseconds,
    flushbarPosition: FlushbarPosition.TOP,
  );
};

EnxRtc.onRemoteStreamAudioUnMute = (Map<dynamic, dynamic> map) {
  log('onRemoteStreamAudioUnMute',
      name: 'onRemoteStreamAudioUnMute', error: map.toString());
  setState(() {
    try {
      isRemoteAudioMuted = map['user']['audioMuted'];
    } catch (e) {}
    showFlushBar(
      context,
      1,
      '$otherUserName unmuted their audio',
      durationInMilliseconds: flushbarDurationInMilliseconds,
      flushbarPosition: FlushbarPosition.TOP,
    );
  });
};
EnxRtc.onRemoteStreamVideoMute = (Map<dynamic, dynamic> map) {
  setState(() {
    try {
      isRemoteVideoMuted = map['user']['videoMuted'];
    } catch (e) {}

    log('onRemoteStreamVideoMute',
        name: 'onRemoteStreamVideoMute', error: map.toString());
  });
  showFlushBar(
    context,
    0,
    '$otherUserName stopped their video',
    durationInMilliseconds: flushbarDurationInMilliseconds,
    flushbarPosition: FlushbarPosition.TOP,
  );
};

EnxRtc.onRemoteStreamVideoUnMute = (Map<dynamic, dynamic> map) {
  setState(() {
    try {
      isRemoteVideoMuted = map['user']['videoMuted'];
    } catch (e) {}
    log('${map['user']['videoMuted']}',
        name: 'onRemoteStreamVideoUnMute', error: map.toString());
  });
};

EnxRtc.onRoomError = (Map<dynamic, dynamic> map) {
  setState(() {
    log('onRoomError', name: 'onRoomError', error: map.toString());
  });
};

EnxRtc.onRoomDisConnected = (Map<dynamic, dynamic> map) {
  log(map.toString(), name: 'onRoomDisConnected');
};

EnxRtc.onConnectionLost = (Map<dynamic, dynamic> map) {
  // In case connection lost due to internet lose
  setState(() {});
};

EnxRtc.onConnectionInterrupted = (Map<dynamic, dynamic> map) {
  // In case any interruption in connection
  setState(() {});
};

EnxRtc.onUserReconnectSuccess = (Map<dynamic, dynamic> map) {
  // When reconnect done successfully
  setState(() {});
};

EnxRtc.onPublishedStream = (Map<dynamic, dynamic> map) async {
  log(map.toString(), name: 'onPublishedStream');
  setState(() {
    EnxRtc.setupVideo(0, 0, true, 300, 200);
  });
};

EnxRtc.onStreamAdded = (Map<dynamic, dynamic> map) async {
  log(map.toString(), name: 'onStreamAdded');

  try {
    EnxRtc.switchMediaDevice('Speaker');
  } catch (e) {
    log('', name: 'onStreamAdded switch error', error: e);
  }

  String streamId = '';
  setState(() {
    streamId = map['streamId'];
  });
  EnxRtc.subscribe(streamId);
};

EnxRtc.onNotifyDeviceUpdate = (String deviceName) {
  log(deviceName, name: 'onNotifyDeviceUpdate');
  setState(() {});
};

EnxRtc.onActiveTalkerList = (Map<dynamic, dynamic> map) {
  log(map.toString(), name: 'onActiveTalkerList');
  final items = (map['activeList'] as List)
      .map((i) => new ActiveListModel.fromJson(i));
  if (items.length > 0) {
    setState(() {
      for (final item in items) {
        if (!_remoteUsers.contains(item.streamId)) {
          log(
            '_remoteUsers \n' + map.toString(),
            name: 'onActiveTalkerList',
          );
          _remoteUsers.add(item.streamId);
        }
      }
    });
  }
};

EnxRtc.onEventError = (Map<dynamic, dynamic> map) {
  setState(() {
    log(
      'onEventError',
      name: 'onEventError',
      error: map.toString(),
    );
  });
};

EnxRtc.onEventInfo = (Map<dynamic, dynamic> map) {
  log(map.toString(), name: 'onEventInfo');
  setState(() {});
};

EnxRtc.onUserConnected = (Map<dynamic, dynamic> map) {
  log(map.toString(), name: 'onUserConnected');
  otherUserName = map['name'];
  setState(() {
    didUserJoinCall = true;
    showFlushBar(
      context,
      1,
      '$otherUserName has joined the call',
      durationInMilliseconds: flushbarDurationInMilliseconds,
      flushbarPosition: FlushbarPosition.TOP,
    );
  });
};

EnxRtc.onUserDisConnected = (Map<dynamic, dynamic> map) async {
  log(map.toString(), name: 'onUserDisConnected');
  setState(() {
    _showAlert(
        context: context, message: '${map['name']} disconnected call');
  });
};

EnxRtc.onAudioEvent = (Map<dynamic, dynamic> map) {
  log(map.toString(), name: 'onAudioEvent');
  setState(() {
    if (map['msg'].toString().toLowerCase() == "audio off") {
      isAudioMuted = true;
    } else {
      isAudioMuted = false;
    }
  });
};

EnxRtc.onVideoEvent = (Map<dynamic, dynamic> map) {
  log(map.toString(), name: 'onVideoEvent');
  setState(() {
    if (map['msg'].toString().toLowerCase() == "video off") {
      isVideoMuted = true;
    } else {
      isVideoMuted = false;
    }
  });
};

}
`


disconnectRoom

EnxRtc.disconnect()


@jaykumarvcx @subratthayal @Vinodrajbhar @abhiramsk

ios build error

Hi,
Once I try to create a build for ios I am getting this error:

Showing Recent Messages
Undefined symbol: OBJC_CLASS$_EnxPlayerView

Undefined symbol: OBJC_CLASS$_EnxUtilityManager

Undefined symbol: OBJC_CLASS$_EnxRtc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.