This message was deleted.
# helpdesk
s
This message was deleted.
👀 1
f
Have you tried updating the compilation and clearing the browser cache? The example app works correctly locally for me,
1.5.4
w
wdym by updating the compliation
f
You can try using a different port
flutter run -d web-server --web-port 8087
I mean is to avoid browser caching of the previous version after compilation. You can try different ports to load your newly compiled web app
Are there any red prompts in safari or FF console?
w
so I deplouyed the front end release build
built with flutter build web --release
and now any screen controller that user Room wont work with safari or fiorefox
there is no red prompts nothing. The livekit server just sends that person a room disconnected event but we can see that they are able to connect to the room before the livekit server sends that
the users get a white screen but yeah nothing in the console
f
This is CI deployed web app from main branch (release build) to see if it runs correctly (it worked for me) https://livekit.github.io/client-sdk-flutter/
w
Then its probably something in our livekit server 😅
Really hard to debug as no red messages
f
Technically, the flutter app should pop up an error dialog box (with the reason) when the connection is refused. Didn’t you get any prompt? so weird. 😲
w
It connects to the room
But then server sends roomdisconnected event to the client
No i get nothing on my app
f
ah, i see
w
I found the root cause
if the app is deployed
the _audioTrack OR _videoTrack cant be null here ON safari and firefox only 🤯
if either one isnt null its fine. That is the strangest thing ive seen in my career@freezing-lifeguard-43174
f
you mean
args.isMicOn = true
,
_audioTrack = null
Will something strange happen?
w
args.isMicOn = false, _audioTrack = null
OR
args.isShowVideo = false, _videoTrack = null
so the thing we discussed earlier. Now the thing is that the user will have the redball forever showing that his devices are being used even if he leaves the call 😢
The TrackOption is totally ignoring the
enabled
even if it has false
f
So what we should discuss is, when passing
enabled = false
, and a
non-null _track
, Then we should call
_track.dispose();
after the room is connected.
But what I suggest is,
if enabled == false
, we should not use
fastConnectOptions:
, Of course, calling track.dispose() within the sdk; when enabled = false is a feasible solution, which can allow the suspended _track to be disposed.
w
im calling that when disconnecting
f
What do you think
w
Yeah it seems I can actually make it so only if either enabled is true I will pass fastConnectOptions
else i pass null to fastConnectOptions
nvm that doesent work
Yeah we have to dispose the tracks no matter how they are created and allow fastConnectOptions to work with all the parameter scenarios it can take
@freezing-lifeguard-43174 https://livekit-users.slack.com/archives/C01KVTJH6BX/p1703158432747469?thread_ts=1703144442.022679&cid=C01KVTJH6BX I dont totally understand this because the problem will occur when enabled = false and track is null
f
So I was thinking about changing the structure of the Trackoptions. This will not cause ambiguity
TrackOptions ({bool enabled = true});
TrackOptions.fromDeviceid ({required String deviceid});
TrackOptions.fromTrack ({required Track track});
w
but now it will require a non null track?
f
The current TrackOptions can be either enabled or non-null track.
enabled actually enables the default device, and non-null-track is used for the track you have selected to create, so I want to change the TrackOptions construction method so that it will be more clear
w
for me it allows enabled and track to be null
aaaaaaah
bro that would be good
so wait there is no point for me to create a videoTrack if I create it with the default device as I could just pass TrackOption(enabled) 💀 ?
f
yes
w
omg i was screwed by the prejoin example then
daaaaaaaammm 😄
Thank you for clarifying that made all the difference ❤️
Out of interest what will happen if video or mic inputs are empty?
It doesent care? in a sense that nothing bad will happen?
well i noticed that if I just use the below code. The video image is laggy
Copy code
fastConnectOptions: FastConnectOptions(
          microphone: TrackOption(enabled: args.isMicOn),
          camera: TrackOption(enabled: args.isShowVideo),
        ),
same thing if I only use this
fastConnectOptions: FastConnectOptions(
microphone: TrackOption(track: _audioTrack),
camera: TrackOption(track: _videoTrack),
),
f
Yes, there will be an operation delay for getUserMedia.
But if _audioTrack/_videoTrack is turned on in the prejoin interface, the delay when passing in should be lower.
w
and but when I use both parameters there is no delay?
Sadly I cant passed objects to screens because im doing web and I can only pass url parameters 😞
Because refreshing the web browser will throw those objects away
So could we somehow go with the option that if enabled false and track null everything works fine 😄?
if that is doable for you
f
using
TrackOptions.fromDeviceid ({required String deviceid});
will it help you? You can store the deviceId in a cookie.
or url parameters
w
I dont have a method like that
and then I would have to pass it even if isMicOn false
It just doesent seem right that fastConnectOptions in prod build only care if one the tracks is not null
f
Makes sense, I know, the other methods are not really fast (with enable, deviceId), 😄
✅ 1
w
Its strange that when running locally the following is perfectly fine on safari and firefox. Why is that
Copy code
if (audioInputs.isNotEmpty && args.isMicOn) {
      _audioTrack = await LocalAudioTrack.create(AudioCaptureOptions(
        deviceId: audioInputs.first.deviceId,
      ));
    }

    //Video part
    if (videoInputs.isNotEmpty && args.isShowVideo) {
      _videoTrack =
          await LocalVideoTrack.createCameraTrack(CameraCaptureOptions(
        deviceId: videoInputs.first.deviceId,
        params: _selectedVideoParameters,
      ));
    }
Anyhow look like safari still has issue. Even if I create the tracks no matter what the args are safari doesent work...
and this only applies to release builds
😲 1
@freezing-lifeguard-43174 Anyhow are you planning on doing the dispose fix? If needed I could ask for permission to have a session with you where I can share some of the code I use so itmight be easier for you to debug?
f
yeah, it would be best if there is a reproducible code
w
Alright I will be going to vacation but after that aka in 14.1 I can share it with you
👌 1