Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QUESTION: How to Retrieve MediaStream Using its ID? #459

Open
Vinayak0-0 opened this issue Aug 5, 2024 · 3 comments
Open

QUESTION: How to Retrieve MediaStream Using its ID? #459

Vinayak0-0 opened this issue Aug 5, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Vinayak0-0
Copy link

Description:
I'm working on a Flutter project where I need to pass a MediaStream between different isolates. Since MediaStream and MediaStreamTrack are not primitive types and cannot be passed directly between isolates, I'm trying to find a way to pass an identifier (like a stream ID) and then retrieve the MediaStream using this ID in the main isolate.

Questions:
How can I properly fetch a MediaStream using its ID?
Are there any best practices or alternative methods for passing MediaStream between isolates or through method channels?

@Vinayak0-0 Vinayak0-0 added the bug Something isn't working label Aug 5, 2024
@victortive
Copy link
Contributor

Since there is no dart method of retrieving the MediaStream by ID, you may need to save the media stream id in your app and pass that saved variable into the different isolates.

final MediaStream userMediaStream = await navigator.mediaDevices.getUserMedia(constraints);
final MediaStream displayMediaStream = await navigator.mediaDevices.getDisplayMedia(constraints);

It looks like it may also be possible to write a PR in the WebRTC plugin to get the userMedia by id as the plugin seems to cache the streams c++ objective-c java

@Vinayak0-0
Copy link
Author

@victortive Can you please check this out -> flutter-webrtc/flutter-webrtc#1644? I have tried a method mentioned in that issue.

@Ruban-07
Copy link

Ruban-07 commented Aug 8, 2024

Actually, I too faced this issue, but there is no solution for this problem in dart method, if anybody knows any option, please let me know!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants