Giter Club home page Giter Club logo

Comments (6)

TatankaConCube avatar TatankaConCube commented on June 20, 2024

will check it later in our sample. have you debugged why it can happen? still the issue reproduces after switching the camera or clicking any buttons?

from connectycube-flutter-samples.

radyhaggag avatar radyhaggag commented on June 20, 2024

will check it later in our sample. have you debugged why it can happen? still the issue reproduces after switching the camera or clicking any buttons?

No, i still debugging it, but the code on conversation call screen is too complex on this point, so i still try.

for some reasons, this method return without invoke the update method, so the all conditions on first if statement is satsified.

void updatePrimaryUser(
int userId,
bool force,
int currentUserId,
MapEntry<int, RTCVideoRenderer>? primaryRenderer,
Map<int, RTCVideoRenderer> minorRenderers,
Map<int, Map<String, bool>> participantsMediaConfigs, {
required Function(MapEntry<int, RTCVideoRenderer>? primaryRenderer,
Map<int, RTCVideoRenderer> minorRenderers)?
onRenderersUpdated,
}) {
final userEnableCamera = getUserWithEnabledVideo(
minorRenderers,
currentUserId,
participantsMediaConfigs,
);
logger.i("userEnableCamera $userEnableCamera");
logger.i(
"!minorRenderers.containsKey(userId) ${!minorRenderers.containsKey(userId)}",
);
logger.i("userId == primaryRenderer?.key ${userId == primaryRenderer?.key}");
logger.i(
"(userId == currentUserId && !force) ${(userId == currentUserId && !force)}",
);
logger.i("userEnableCamera == null ${userEnableCamera == null}");
if (!minorRenderers.containsKey(userId) ||
userId == primaryRenderer?.key ||
(userId == currentUserId && !force) ||
userEnableCamera == null) {
logger.i("updatePrimaryUser Has failed on the conditions");
return;
}

if (primaryRenderer?.key != userId) {
minorRenderers.addEntries([primaryRenderer!]);
}

primaryRenderer = MapEntry(userId, minorRenderers.remove(userId)!);

onRenderersUpdated?.call(primaryRenderer, minorRenderers);
}

from connectycube-flutter-samples.

radyhaggag avatar radyhaggag commented on June 20, 2024

int? getUserWithEnabledVideo(Map<int, RTCVideoRenderer> renderers,
int currentUserId, Map<int, Map<String, bool>> config) {
var resultUserId = -1;

renderers.forEach((userId, renderer) {
if ((resultUserId == -1 || resultUserId == currentUserId) &&
canShowVideo(userId, renderer.srcObject, config)) {
resultUserId = userId;
}
});

return resultUserId == -1 ? null : resultUserId;
}

This method return resultUserId with -1 in this case always, and you cannot switch the video.

from connectycube-flutter-samples.

radyhaggag avatar radyhaggag commented on June 20, 2024

Can you please tell me a reason or expectation for this problem and i will debug it? because i didn't know if it from the code or from the remote data source or anyting about it.

also i tried 7 times and it didn't occur then on the try no 8 its occur, after that its occur many times?!

from connectycube-flutter-samples.

radyhaggag avatar radyhaggag commented on June 20, 2024

@TatankaConCube ?

from connectycube-flutter-samples.

radyhaggag avatar radyhaggag commented on June 20, 2024

After many tries i think the problem is with this method onRemoteStreamTrackReceived, sometimes the camera is working on other side but when see the primary render and minor render, the primary render media is not fetched so the problem occur.

@TatankaConCube

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.