Giter VIP home page Giter VIP logo

Comments (17)

ArjunBhilare avatar ArjunBhilare commented on June 3, 2024 1

I'm facing the same issue. Any solution?

from flutter-webrtc.

0010SS avatar 0010SS commented on June 3, 2024 1

I'm facing the same issue. Any solution?

For me, the issue is not with GetUserMedia(). I found out in the WebRTC console log of Safari that it requires Member RTCIceServer.urls, and hence changing ICE Server configuration keys in the Peer Connection Configuration from "url" to "urls" solve the issue in Safari. Namely,

final configuration = <String, dynamic>{
  "iceServers": [
    {
      "urls": "..",  // the key here should be "urls" not "url"
      "username": "...",
      "credential": "..."
    },
  ],
  'sdpSemantics': 'unified-plan',
};

_peerConnection = await createPeerConnection(configuration);

Now, GetUserMedia() works, and the browsers on both my iPhone and Mac work to request the camera and render the stream. However, the WebRTC connection still does not work for browsers, either Chrome or Safari, on my iPhone. The media stream track is connected, but no frames are sent from the iPhone to the other peer. I believe this is a problem with IOS, but I'm still working it out. Does anyone have a solution to this?

from flutter-webrtc.

cloudwebrtc avatar cloudwebrtc commented on June 3, 2024 1

I think you need to call _localRenderer.srcObject = _localStream; in setState to notify flutter to update your widget.

setState((){
   _localRenderer.srcObject = _localStream;
});

from flutter-webrtc.

ArjunBhilare avatar ArjunBhilare commented on June 3, 2024

I am building flutter-webrtc based app on iOS and Android. I have

final Map<String, dynamic> configuration = {
    "sdpSemantics": "plan-b",
    'iceServers': [
      {
        "urls": [
          'stun:stun.l.google.com:19302',
          'stun:stun1.l.google.com:19302'
        ],
      }
    ]
  };
  1. In this when I set

'sdpSemantics': 'unified-plan',

then the app crashes on user joined

  1. Also I have
final _localRenderer = RTCVideoRenderer();

await _localRenderer.initialize();

MediaStream _localStream =
     await navigator.mediaDevices.getUserMedia(mediaConstraints);

_localRenderer.srcObject = _localStream;
 
 Positioned(
       bottom: 10,
       right: 10,
       child: SizedBox(
         width: 150,
         height: 200,
         child: RTCVideoView(
           _localRenderer,
           mirror: true,
           objectFit: RTCVideoViewObjectFit.RTCVideoViewObjectFitCover,
         ),
       ),
     ),

The camera is turning ON but the RTCVideoView _localRenderer shows nothing, also no video stream is shown to the other user. Any insights on this?

The audio works, but the video is not shown, on iOS

from flutter-webrtc.

Garciconx avatar Garciconx commented on June 3, 2024

I'm facing the same issue. Any solution?

For me, the issue is not with GetUserMedia(). I found out in the WebRTC console log of Safari that it requires Member RTCIceServer.urls, and hence changing ICE Server configuration keys in the Peer Connection Configuration from "url" to "urls" solve the issue in Safari. Namely,

final configuration = <String, dynamic>{
  "iceServers": [
    {
      "urls": "..",  // the key here should be "urls" not "url"
      "username": "...",
      "credential": "..."
    },
  ],
  'sdpSemantics': 'unified-plan',
};

_peerConnection = await createPeerConnection(configuration);

Now, GetUserMedia() works, and the browsers on both my iPhone and Mac work to request the camera and render the stream. However, the WebRTC connection still does not work for browsers, either Chrome or Safari, on my iPhone. The media stream track is connected, but no frames are sent from the iPhone to the other peer. I believe this is a problem with IOS, but I'm still working it out. Does anyone have a solution to this?

I'm facing the same issue I already have the urls key instead of url but keep failing on Safari and Chrome for iOS and on Safari for MacOS

Any possible solution? CC @cloudwebrtc @0010SS

from flutter-webrtc.

0010SS avatar 0010SS commented on June 3, 2024

I'm facing the same issue. Any solution?

For me, the issue is not with GetUserMedia(). I found out in the WebRTC console log of Safari that it requires Member RTCIceServer.urls, and hence changing ICE Server configuration keys in the Peer Connection Configuration from "url" to "urls" solve the issue in Safari. Namely,

final configuration = <String, dynamic>{
  "iceServers": [
    {
      "urls": "..",  // the key here should be "urls" not "url"
      "username": "...",
      "credential": "..."
    },
  ],
  'sdpSemantics': 'unified-plan',
};

_peerConnection = await createPeerConnection(configuration);

Now, GetUserMedia() works, and the browsers on both my iPhone and Mac work to request the camera and render the stream. However, the WebRTC connection still does not work for browsers, either Chrome or Safari, on my iPhone. The media stream track is connected, but no frames are sent from the iPhone to the other peer. I believe this is a problem with IOS, but I'm still working it out. Does anyone have a solution to this?

I'm facing the same issue I already have the urls key instead of url but keep failing on Safari and Chrome for iOS and on Safari for MacOS

Any possible solution? CC @cloudwebrtc @0010SS

Could you provide a snapshot of your code?

from flutter-webrtc.

Garciconx avatar Garciconx commented on June 3, 2024
Map<String, dynamic> configuration = {
    'iceServers': [
      {
        'urls': [
          'stun:stun1.l.google.com:19302',
          'stun:stun2.l.google.com:19302',
        ]
      }
    ]
  };

CC @0010SS

from flutter-webrtc.

Garciconx avatar Garciconx commented on June 3, 2024

Any possible solution? @cloudwebrtc

from flutter-webrtc.

0010SS avatar 0010SS commented on June 3, 2024

Any possible solution? @cloudwebrtc

Have you tried to check out the WebRTC console log for Safari? You can probably spot the errors there and see how they go.

from flutter-webrtc.

Garciconx avatar Garciconx commented on June 3, 2024

CC @0010SS @cloudwebrtc

Screenshot 2024-03-22 at 8 58 53 a m Screenshot 2024-03-22 at 8 59 42 a m Screenshot 2024-03-22 at 9 00 47 a m

image

´´´

Timer(const Duration(seconds: 2), () {
  peer_connection.onTrack = (RTCTrackEvent event) {
    debugPrint('Got remote track: ${event.streams[0]}');

    event.streams[0].getTracks().forEach((track) {
      debugPrint('Add a track to the remoteStream $track');
      remote_streams.last.addTrack(track);
    });
  };
});

´´´

from flutter-webrtc.

Garciconx avatar Garciconx commented on June 3, 2024

CC @0010SS @cloudwebrtc

The problem is that It's failing to add the track on Safari, this issue is not presented on Google Chrome, Android nor iOS.

On the Mobile App, the code is capable of adding both tracks local and remote but Safari fails to add the remote track.

from flutter-webrtc.

0010SS avatar 0010SS commented on June 3, 2024

CC @0010SS @cloudwebrtc

The problem is that It's failing to add the track on Safari, this issue is not presented on Google Chrome, Android nor iOS.

On the Mobile App, the code is capable of adding both tracks local and remote but Safari fails to add the remote track.

Have you checked out the WebRTC console log of Safari to see whether there are any errors? That's how I solve the problem.

from flutter-webrtc.

Garciconx avatar Garciconx commented on June 3, 2024

CC @0010SS @cloudwebrtc
The problem is that It's failing to add the track on Safari, this issue is not presented on Google Chrome, Android nor iOS.
On the Mobile App, the code is capable of adding both tracks local and remote but Safari fails to add the remote track.

Have you checked out the WebRTC console log of Safari to see whether there are any errors? That's how I solve the problem.

Yes I posted a Screenshot and the code in my past comment

from flutter-webrtc.

Garciconx avatar Garciconx commented on June 3, 2024

Safari doesn't tell me much about the error, the browser just tells the line of code where it is

from flutter-webrtc.

harshmdr-devslane avatar harshmdr-devslane commented on June 3, 2024

Any update here?

from flutter-webrtc.

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.