AirenSoft / OvenPlayer

OvenPlayer is JavaScript-based LLHLS and WebRTC Player for OvenMediaEngine.
https://airensoft.com/ome.html
MIT License
515 stars 126 forks source link

WebRTC on Firefox doesn't work with or without a TURN server #128

Closed mpisat closed 4 years ago

mpisat commented 4 years ago

I'm getting this error on the console WebRTC: ICE failed, add a TURN server and see about:webrtc for more details

The same video plays fine on Safari and Chrome (both windows, mac os and mobile phones)

image

OvenMedia is running on Docker with default ICE ports 10000-10005/udp

mpisat commented 4 years ago

I tested with TURN only, it said add STUN servers, so I added STUN servers to config and it still doesn't work. Is firefox incapable of receiving WebRTC streams from OME and other Media servers?

    <div id="player_id"></div>

    <script>

    let webrtcSources = [{type : "webrtc", file : "wss://domain.com:3334/app/stream_o", label : "1080"}];
    let player = OvenPlayer.create("player_id", {
        sources: webrtcSources, 
    loop : false,
    autoStart : true,
    mute : true,
    controls : true,
webrtcConfig: {
    iceServers: [
        {
            "urls": [
                "stun:stun.l.google.com:19302"
            ]
        },
        {
            "urls": [
                "turn:165.22.50.93:3478?transport=tcp",
                "turn:165.22.50.93:3478?transport=udp"
            ],
            "username": "myuser",
            "credential": "mypass"
        }
    ]
}
    });
      player.on("error", function(error){
        console.log(error);
      });
    </script>
SangwonOh commented 4 years ago

No. Firefox should have to work fine too. Basic playback with OME via firefox works fine on my enviroment. Can I get your WebRTC signaling adress for testing?

mpisat commented 4 years ago

No. Firefox should have to work fine too. Basic playback with OME via firefox works fine on my enviroment. Can I get your WebRTC signaling adress for testing?

I suspected from double nat under Dockerproxy.

My previous docker run command was this: docker run -d --restart always --env OME_ICE_CANDIDATES=*:10000-10005/udp -p 1935:1935 -p 3333:3333 -p 8080:8080 -p 9000:9000/udp -p 10000-10005:10000-10005/udp airensoft/ovenmediaengine:latest

I added external IP and now it's working on Firefox

docker run -d --restart always --env OME_ICE_CANDIDATES=165.x.x.x:10000-10005/udp -p 1935:1935 -p 3333:3333 -p 8080:8080 -p 9000:9000/udp -p 10000-10005:10000-10005/udp airensoft/ovenmediaengine:latest

if I don't add --env OME_ICE_CANDIDATES=165.x.x.x:10000-10005/udp and expect it to use internal values, it doesn't work on Firefox (double nat issue due to docker?)

SangwonOh commented 4 years ago

@mpisat Hi. We just strengthen the connectivity with OME running on private network like a docker proxy.

updated #133 commit.