vdotok_stream

Creator: coderz1093

Last updated:

0 purchases

vdotok_stream Image
vdotok_stream Images
Add to Cart

Description:

vdotok stream

vdotok_stream #
A new Flutter plugin.
Getting Started #
iOS #
Add the following entry to your Info.plist file, located in < project root >/ios/Runner/Info.plist:
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) Camera Usage!</string>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) Microphone Usage!</string>

copied to clipboard
Android #
Ensure the following permission is present in your Android Manifest file, located in < project root >/android/app/src/main/AndroidManifest.xml:

<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" />


copied to clipboard
And specify the service inside the

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


copied to clipboard
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;

copied to clipboard
Add listeners: #
Below described main helpful callbacks and listeners:

signalingClient.onConnect = (String response)
{

// called when socket is connected successfully

};

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

// called when user get register successfully

};

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

// called in case of getting any error

};

signalingClient.onLocalStream = (MediaStream stream)
{

// called when local media stream is completely prepared

};

signalingClient.onRemoteStream = (MediaStream stream, String refId)
{

// called when remote media stream is received from opponent

};

signalingClient.onReceiveCallFromUser = (Map<String, dynamic> incoming , bool isMultiSession)
{

// called when call is received from opponent

};

signalingClient.onParticipantsLeft = (String refId, bool isReceive, bool isMultiSession)
{

// called when a participant leave the call

};

signalingClient.onCallAcceptedByUser = ()
{

// called when participant accepts the call

};

signalingClient.onCallHungUpByUser = (bool isLocal)
{

// called when call is hung up from any side

};

signalingClient.onCallBusyCallback = ()
{

// called when caller receives busy signal from opponent

};

signalingClient.onAudioVideoStateInfo = (int audioFlag, int videoFlag, String refId)
{

// called when audio or video states get changed

};

signalingClient.onTargetAlerting = ()
{

// called when the caller receives that callee gets alert

};

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

// called when new participant added

};

signalingClient.unRegisterSuccessfullyCallBack = ()
{

// called when user successfully unregisters

};


signalingClient.onReceiveUrlCallback = (String url)
{

// called in case of publich broadcasting when user receives public url

};

signalingClient.internetConnectivityCallBack = (String mesg)
{

// called when user connected or disconnected

};

signalingClient.onMissedCall = (String mesg)
{

// called when call is missed

};

signalingClient.onCallDial = ()
{

// called when call is dialed

};

signalingClient.onHvInfo = ()
{

// called when user gets hv info

};

copied to clipboard
Models: #
Below are the Models:
// Use this Model for login/sign up

class User {

final String auth_token;
final String authorization_token;
final String email;
final String full_name;
final String message;
final int process_time;
final String ref_id;
final int status;
final int user_id;

}

// Use this Model for Groups

class GroupModel {

dynamic admin_id;
dynamic auto_created;
dynamic channel_key;
dynamic channel_name;
dynamic group_title;
dynamic id;
dynamic created_datetime;

}

// Use this Model for Getting All Users

class Contact {

int user_id;
dynamic email;
String ref_id;
String full_name;

}

copied to clipboard
Constants: #
Class used for Media Type:

class MediaType {
static String video = "video";
static String audio = "audio";
}

copied to clipboard
Class used for Call Type:

class CallType {
static String one2one = "one_to_one";
static String one2many = "one_to_many";
static String many2many = "many_to_many";

}

copied to clipboard
Class used for Session Type:

class SessionType {
static String call = "call";
static String screen = "screen";
}

copied to clipboard
VDOTOK_STREAM SDK Methods: #
Connection: #
Use this method to connect socket.

signalingClient.connect(
String deviceId, // any random String
String projectId,
String completeAddress, // in Login/SignUp response
String authorization_token, // in Login/SignUp response
String ref_id // in Login/SignUp response
);

copied to clipboard
Initiate Call: #
Use these method to initiate call. Make sure you are providing the following parameters in this method.
One-to-One #
signalingClient.startCallOneToOne(
String from, // your own refId which you will get from Login/Signup response
Map < String, dynamic > customData, // Any kind of custom data which you want to use on incoming side
List < String > to, // list of participant's refIds
String mediaType, // "audio" or "video"
String mcToken, // mcToken will receive upon register response/onRegister callback
String callType, // "one_to_one"
String sessionType // "call"
);

copied to clipboard
Many-to-Many #
signalingClient.startCall(
Map < String, dynamic > customData, // Any kind of custom data which you want to use on incoming side
String from, // your own refId which you will get from Login/Signup response
List < String > to, // list of participant's refIds
String mcToken, // mcToken will receive upon register response/onRegister callback
String mediaType, // "audio" or "video"
String callType, // "many_to_many"
String sessionType // "call"
);

copied to clipboard
One-to-Many #
signalingClient.startCallOneToMany(
String from, // your own refId which you will get from Login/Signup response
Map < String, dynamic > customData, // Any kind of custom data which you want to use on incoming side
List < String > to, // list of participant's refIds
String mediaType, "audio" or "video"
String mcToken, // mcToken will receive upon register response/onRegister callback
String callType, // "one_to_many"
String sessionType, // "call" or "screen"
bool isPublicBroadcast, // true or false
String broadcastType, // "appaudio" or "camera" or "micaudio" or "appaudioandcamera" or "micaudioandcamera"
String authorizationToken // your own authorizationToken which you will get from Login/SignUp response
);

copied to clipboard
Accept Call: #
Use this method to accept the call.

signalingClient.createAnswer(String incomingRefId);

copied to clipboard
Reject Call: #
Use this method if receiver wants to reject / decline the call.

signalingClient.declineCall(String refId, String mcToken);

copied to clipboard
End Call: #
Use this method to stop the call.

signalingClient.stopCall(String mcToken);

copied to clipboard
Enable/Disable Screen Share: #
Use this method to enable/disable screen share.

signalingClient.enableScreen(bool flag)

copied to clipboard
Switch Camera: #
Use this method to switch the camera (between front and rear).

signalingClient.switchCamera();

copied to clipboard
Switch Speaker: #
Use this method to switch the speaker.

signalingClient.switchSpeaker(bool flag);

copied to clipboard
Enable and Disable Camera: #
Use this method to enable and disable the camera.

signalingClient.enableCamera(bool flag);

copied to clipboard
Mute and Unmute Mic: #
Use this method to mute and unmute the Mic.

signalingClient.muteMic(bool flag);

copied to clipboard
Mute and Unmute Internal Mic: #
Use this method to mute and unmute Internal Mic.

signalingClient.muteInternalMic();

copied to clipboard
unRegister: #
Use this method to unregister once the user logs out.

signalingClient.unRegister(String mcToken);

copied to clipboard
Send Ping #
Use this method to check if socket is connected or not. If it’s not connected then the User won’t get “Pong” from server.

signalingClient.sendPing(String mcToken);

copied to clipboard
Close Socket #
Use this method to close the socket manually.
signalingClient.closeSocket();

copied to clipboard
Audio Video State #
Use this method to send audio (mute/unmute) and video (enable/disable camera) state.

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

copied to clipboard
Listener for Internet Connection/Disconnection #
Use this method to listen changes every time the User’s device is connected to internet or disconnected from internet.

signalingClient.checkConnectivity();

copied to clipboard
Internet Status #
Use this method to check whether or not the User’s device is connected to internet. It will return true or false value.

signalingClient.getInternetStatus();

copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.