dial_videocall 0.0.5 copy "dial_videocall: ^0.0.5" to clipboard
dial_videocall: ^0.0.5 copied to clipboard

discontinued
outdated

Dial VideoCall dependencies is a dependency that use OpenVidu video call service built on Flutter. This dependency run on both iOS and Android.

Dial-VideoCall #

Dial VideoCall library using OpenVidu on Flutter

How to Install #

Step 1. Add the Dependencies to your pubspec.yaml #

Add it in your pubspec.yaml. Make sure you use the latest release version!

dependencies:
  flutter:
    sdk: flutter

  dial_videocall: ^0.0.4

Step 2. Ask for permission #

To ensure all feature works, ask for camera and microphone permission before starting video call. You can handle this process manually, or ease this process by using permission_handler.

Step 3. Handle Incoming Video Call #

On your project, handle the incoming call from FirebaseMessaging instance.

On below, this is example how to handle incoming call

  Future<void> _checkIncomingNotification() async {
    RemoteMessage initialMessage =
    await FirebaseMessaging.instance.getInitialMessage();

    if (initialMessage?.data !=null) {
      sessionFrom = await initialMessage.data['session_from'];
      sessionTo = await initialMessage.data['session_to'];
      _goToCallPage();
    }

    FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
      if(message.notification!=null){
        if(message.data!=null){
          sessionFrom = message.data['session_from'];
          sessionTo = message.data['session_to'];
          _goToCallPage();
        }
      }
    });

    FirebaseMessaging.onMessage.listen((RemoteMessage message) {
      print('Got a message whilst in the foreground!');
      print('Message data: ${message.data}');

      if (message.notification != null) {
        print('Message also contained a notification: ${message.notification.toString()}');
        if(message.data!=null){
          sessionFrom = message.data['session_from'];
          sessionTo = message.data['session_to'];
          _goToCallPage();
        }
      }
    });
  }

After the FCM arrived, call _goToCallPage() method to start videocall.

    void _goToCallPage(){
        if(!isOnCall){
        isOnCall = true;
        DialVideoCall.startVideoCallDev(
            context: context,
            sessionFrom: sessionFrom,
            sessionTo: sessionTo
        ).then((value) {
            isOnCall = false;
            sessionFrom = null;
            sessionTo = null;
        });
        }
    }

Step 4. (OPTIONAL) Add Custom Notification Sound on iOS #

To add custom notification sound on iOS platform, you can check this link.

API #

We provide two method, to handle production and development:

Production

Method Call #

DialVideoCall.startVideoCall(context, sessionFrom, sessionTo);

Call This method when you want to start video call in production server

Production URL #

https://call.dial.id/softphone/clicktovcallov/?clientSid=AAAA&apikey=4k535D14LVc4LlPR0d12345&from=BBBB&to=CCCC&fcm_server_key=DDDD&fcm_token=EEEE#CCCC

Change following parameter using your configuration:

  1. clientSid
  2. from
  3. to
  4. fcm_server_key
  5. fcm_token

At the end of parameter, after the #, fill it with to session name

Development

Method Call #

DialVideoCall.startVideoCallDev(context, sessionFrom, sessionTo);

Call This method when you want to start video call in development server

Production URL #

https://devcall.dial.id/softphone/clicktovcall/?clientSid=AAAA&apikey=4k535D14LVc4Ll12345&from=BBBB&to=CCCC&fcm_server_key=DDDD&fcm_token=EEEE#CCCC

Change following parameter using your configuration:

  1. clientSid
  2. from
  3. to
  4. fcm_server_key
  5. fcm_token

At the end of parameter, after the #, fill it with to session name

0
likes
40
points
15
downloads

Publisher

unverified uploader

Weekly Downloads

Dial VideoCall dependencies is a dependency that use OpenVidu video call service built on Flutter. This dependency run on both iOS and Android.

Homepage

License

MIT (license)

Dependencies

flutter, flutter_webrtc, html

More

Packages that depend on dial_videocall