vdotok_stream

A new Flutter plugin.

Getting Started

iOS

Add the following entry to your Info.plist file, located in

<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) Camera Usage!</string>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) Microphone Usage!</string>

Android

Ensure the following permission is present in your Android Manifest file, located in


    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />


And specify the service inside the


    <service android:name="changjoopark.com.flutter_foreground_plugin.FlutterForegroundService" android:foregroundServiceType="mediaProjection" android:enabled="true" android:exported="false"/>


Add JniLibs folder into android>app>src>main, of the project. Don’t forget to unzip jniLibs.zip file before adding.

Download

Create Client Instance:

First we need to create an instance of signaling client.


SignalingClient signalingClient = SignalingClient.instance; 

Add listeners:

Below described main helpful callbacks and listeners:


signalingClient.onConnect = (String msg) { 

} 



signalingClient.onError= (int code, String reason) { 

// called in case of getting any error. 

} 
 

signalingClient.onRegister= (Map<String, dynamic> res) { 

// called when user get register successfully 

} 
 


signalingClient.onLocalStream = (stream) { 

// called when local media stream completely prepared 

} 



signalingClient.onRemoteStream = (stream, String refID) { 

// called when remote media stream received from opponent 

} 



signalingClient.onReceiveCallFromUser = (String from, String mediaType) { 

// called when call received from opponent 

} 



signalingClient.onParticipantsLeft = (String refID) { 

// called when a participant left the call.  

} 


signalingClient.onCallAcceptedByUser = () { 

// called when received 'accept' signal from opponent 

} 


signalingClient.onCallHungUpByUser = () { 

// called when received 'HungUP' signal from opponent 

} 



signalingClient.onCallBusyCallback = () { 

// called when received 'busy' signal from opponent 

} 



SignalingClient.onAudioVideoStateInfo = (int audioFlag, int videoFlag) { 

// called when audio or video states get changed. 

} 


signalingClient.onAddparticpant = (int paticipantCount, String calltype) {

    // called when new participant added. 

}


signalingClient.unRegisterSuccessfullyCallBack = () {

    // called when unRegistered.

    }


signalingClient.onTargetAlerting = () {
     
    // called when call Alerting

    };


signalingClient.onReceiveUrlCallback = (String url) {

    //Called when receiving broadcast url

    }

signalingClient.internetConnectivityCallBack = (String mesg) {

        // called when user connected or disconnected

    }



VDOTOK_STREAM SDK Methods:

Connection:

Use this method to connect socket.


SignalingClient.connect(String auth_token, String project_id); 

Register:

Use this method to register user


SignalingClient.register(Map<String, dynamic> userData, String project_id); 

Initiate a call:

Use this method to initiate call. Make sure you are providing the following params in this method.


SignalingClient.startCall( 
    String from,  
    String to,  
    String mcToken,  
    String mediaType,  
    String callType,  
    String sessionType); 
    

Accept a call:

Use this method to accept the call.


SignalingClient.createAnswer(String incommingFrom_refID); 

Reject a call:

Use this method if you want to reject / decline the call.


SignalingClient.declineCall(String refID, String mcToken); 

End a call:

Use this method to stop the call.


SignalingClient.stopCall(String mcToken); 

Switch Camera:

Use this method to switch the camera.


signalingClient.switchCamera(); 

Switch Speaker:

Use this method to switch the speaker.


signalingClient.switchSpeaker(bool flag); 

Enable and Disable Camera:

Use this method to enable and disable the camera.


signalingClient.enableCamera(bool flag); 

Mute and Unmute Mic:

Use this method to mute and unmute the Mic.


signalingClient.muteMic(bool flag); 

unRegister:

Use this method to unRegister.


signalingClient.unRegister(String mcToken); 

StartCAll OneToOne:

Use this method to StartCall oneToOne.


signalingClient.startCallonetoone(
    {String? from,
      Map<String, dynamic>? customData,
      List<String>? to,
      String? meidaType,
      String? mcToken,
      String? callType,
      String? sessionType}
      ); 

StartCall OneToMany:

Use this method to StartCall OneToMany.


signalingClient.startCallonetomany(
      {String? from,
      Map<String, dynamic>? customData,
      List<String>? to,
      String? meidaType,
      String? mcToken,
      String? callType,
      String? sessionType,
      bool? ispublicbroadcast,
      String? broadcastype,
      String? authorizationToken}
      ); 

Send Ping

Use this method to unRegister.


signalingClient.sendPing(String mcToken); 

Mute Internal Mic

Use this method to mute internal mic.


signalingClient.muteInternalMic(); 

Enable ScreenShare

Use this method to enable or disable screenShare.


signalingClient.enableScreen(bool flag); 

Check Internet Connectivity

Use this method to check internet connectivity.

// return true if connected with internet 
// return false if not connected with internet

signalingClient.checkInternetConnectivity(); 


Audio Video State

Use this method to send states of Audio or Video.


signalingClient.audioVideoState(
    {int? audioFlag, int? videoFlag, String? mcToken}
    ); 

Check Connectivity

Use this method to check Internet Connectivity.


signalingClient.checkConnectivity(); 

Libraries

BroadCast
config
connectionManager
connectionManagerForIO
connectionManagerForWeb
connectionManagerStub
dart_webrtc
enums
factory
factory_impl
factory_impl
factory_impl
flutter_webrtc
helper
media_devices
media_devices
media_recorder
media_recorder
media_recorder
media_recorder_impl
media_recorder_impl
media_stream
media_stream_impl
media_stream_impl
media_stream_track
media_stream_track_impl
media_stream_track_impl
mediadevices
mediadevices_impl
mediadevices_impl
rtc_configuration
rtc_data_channel
rtc_data_channel_impl
rtc_data_channel_impl
rtc_dtmf_sender
rtc_dtmf_sender_impl
rtc_dtmf_sender_impl
rtc_ice_candidate
rtc_peerconnection
rtc_peerconnection_impl
rtc_peerconnection_impl
rtc_rtcp_parameters
rtc_rtp_parameters
rtc_rtp_parameters_impl
rtc_rtp_receiver
rtc_rtp_receiver_impl
rtc_rtp_receiver_impl
rtc_rtp_sender
rtc_rtp_sender_impl
rtc_rtp_sender_impl
rtc_rtp_transceiver
rtc_rtp_transceiver_impl
rtc_rtp_transceiver_impl
rtc_session_description
rtc_stats_report
rtc_track_event
rtc_track_event_impl
rtc_track_event_impl
rtc_video_element
rtc_video_renderer
rtc_video_renderer_impl
rtc_video_renderer_impl
rtc_video_view_impl
rtc_video_view_impl
signalingClient
socketManager
socketManagerForIO
socketManagerForWeb
socketManagerStub
utils
utils
vdotok_stream
vdotok_stream_web
web_socket_connection
webrtc_interface