GithubHelp home page GithubHelp logo

Comments (9)

TatankaConCube avatar TatankaConCube commented on July 23, 2024

What do you mean? Please describe in detail which functionality you need.

from connectycube-flutter-samples.

ShyamKrishna122 avatar ShyamKrishna122 commented on July 23, 2024

I have an app with 5 screens. When caller calls another person from one screen(chat screen) the receiver is receiving the incoming call if the receiver is also in the chat screen. But I want the receiver to get the incoming call when the receiver is in one of the 5 screens.

from connectycube-flutter-samples.

TatankaConCube avatar TatankaConCube commented on July 23, 2024

What about a variant with the special manager that will listen to calls? You will init it after connecting to the chat and it will open an incoming screen after receiving a new call. Make sense? Or you mean another way?

from connectycube-flutter-samples.

ShyamKrishna122 avatar ShyamKrishna122 commented on July 23, 2024

Yes,i want to listen for incoming calls in every screen but how to implement it? also, can u elaborate with a sample code snippet?

from connectycube-flutter-samples.

TatankaConCube avatar TatankaConCube commented on July 23, 2024

can u elaborate with a sample code snippet?

do you mean manager?

from connectycube-flutter-samples.

himanshukh avatar himanshukh commented on July 23, 2024

Yes,i want to listen for incoming calls in every screen but how to implement it? also, can u elaborate with a sample code snippet?

Initialize P2PSession and P2PClient in a common environment. Create session and then create instant of these.. After that you can get call anywhere in your application.

from connectycube-flutter-samples.

ShyamKrishna122 avatar ShyamKrishna122 commented on July 23, 2024

How to initialize p2psession and p2pclient in a common environment? Can u give an example?

from connectycube-flutter-samples.

himanshukh avatar himanshukh commented on July 23, 2024

How to initialize p2psession and p2pclient in a common environment? Can u give an example?

Step1: Create a Environment file and added P2PClient and P2PSession:

class Environment {
static P2PClient callClient;
static P2PSession currentCall;
}

Step2: Create session on your login screen after successful login or Create on first screen of your app if there is not any login screen.

Step3: Goto the screen which is first screen after login or your app.. Use Environment variable here and assign session instance.

void initState() {
super.initState();
_initCustomMediaConfigs();
_initCalls();
}

void _initCalls() {
Environment.callClient = P2PClient.instance;

Environment.callClient.init();
Environment.callClient.onReceiveNewSession = (callSession) {
if (Environment.currentCall != null &&
Environment.currentCall.sessionId != callSession.sessionId) {
callSession.reject();
return;
}
//_showIncomingCallScreen(callSession);
};

Environment.callClient.onSessionClosed = (callSession) {
if (Environment.currentCall != null &&
Environment.currentCall.sessionId == callSession.sessionId) {
Environment.currentCall = null;
}
};
}

void _initCustomMediaConfigs() {
RTCMediaConfig mediaConfig = RTCMediaConfig.instance;
mediaConfig.minHeight = 720;
mediaConfig.minWidth = 1280;
mediaConfig.minFrameRate = 30;
}

from connectycube-flutter-samples.

TatankaConCube avatar TatankaConCube commented on July 23, 2024

No activity for a long time. Closing...

from connectycube-flutter-samples.

Related Issues (20)

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.