flutterjanus / flutter_janus_client

A plugin that allows the flutter app to communicate with a Janus server using different transport mechanisms, such as WebSocket and HTTP(rest). It features a developer-friendly api to interact with various WebRTC Janus Plugins. Hence, it can be considered as a swiss-knife for WebRTC solutions.
MIT License
134 stars 76 forks source link

isUnifiedPlan = true is not working #153

Closed anewgate closed 10 months ago

anewgate commented 10 months ago

Hi ~ everyone.

I am using the video call plugin. If you set isUnifiedPlan = true Remote video cannot be received. I would be grateful if you could tell me how.

Thank you.

shivanshtalwar commented 10 months ago

If you set isUnified plan to false remotetrack will not work instead you will receive remotestream

anewgate commented 10 months ago

Thank you for the reply. But both remoteTrack and remoteStream do not work.

shivanshtalwar commented 10 months ago

Can you share the code snippet that is not working or example project with minimal reproduction that i can run and investigate

anewgate commented 10 months ago

Can you share the code snippet that is not working or example project with minimal reproduction that i can run and investigate

I just downloaded the master branch code and ran the example. Mainly used for Android, iPhone, and iPad. I also used the MacBook Pro's Chrome web browser, but the results were the same.

Also, I tried running the https://flutterjanus.github.io/flutter_janus_client/ link and the result was the same.

The code was executed as is without any changes, and when debugging, the remoteTrack event was not called. publishVideo.remoteTrack?.listen((event) async { if (event.track != null && event.flowing == true) { remoteVideoStream?.addTrack(event.track!); _remoteVideoRenderer.srcObject = remoteVideoStream; // this is done only for web since web api are muted by default for local tagged mediaStream if (kIsWeb) { _remoteVideoRenderer.muted = false; } } });

However, by changing the isUnifiedPlan value in the code below from true to false, I was able to receive remote video. client = JanusClient(transport: ws, iceServers: [RTCIceServer(urls: "stun:stun.voip.eutelia.it:3478", username: "", credential: "")], isUnifiedPlan: true);

By looking at the sdp value of the offer or answer sent every time the isUnifiedPlan value is changed, we checked whether UnifiedPlan was set properly and confirmed that the isUnifiedPlan setting was working properly.

IMG_0186

스크린샷 2024-01-13 오후 10 42 37
shivanshtalwar commented 10 months ago

i think latest commit should work for you turns out videocall plugin from janus side doesn't work as expected with addTransreciever(that is simulcast) i verified this behaviour with janus videocall demo page so therefore if you are not using simulcast the code should work until janus fixes this issue or propose a solution for the same

shivanshtalwar commented 10 months ago

lmk if it works @anewgate

anewgate commented 10 months ago

@shivanshtalwar I also confirmed that the unified plan works well in the master branch. thank you so so so so so much. :)