vdotok_stream 0.0.16 copy "vdotok_stream: ^0.0.16" to clipboard
vdotok_stream: ^0.0.16 copied to clipboard

outdated

By using this package you can connect with vdotok and use vdotok services. you can make one 2 one, many 2 many, Group calls , broadcast etc.

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(); 

2
likes
0
pub points
0%
popularity

Publisher

verified publishervdotok.com

By using this package you can connect with vdotok and use vdotok services. you can make one 2 one, many 2 many, Group calls , broadcast etc.

License

unknown (license)

Dependencies

battery_plus, connectivity_plus, crypto, dart_ipify, device_info, device_info_plus, flutter, flutter_device_type, flutter_web_plugins, http, media_projection_creator, path_provider, permission_handler, replay_kit_launcher, web_socket_channel

More

Packages that depend on vdotok_stream