Novage / p2p-media-loader

An open-source engine for P2P streaming of live and on demand video directly in a web browser HTML page
https://novage.com.ua/p2p-media-loader/demo.html
Apache License 2.0
1.43k stars 314 forks source link

Debugging of peers not connecting #168

Closed danielfomin96 closed 3 years ago

danielfomin96 commented 3 years ago

Firstly I would to say thank you for such an awesome project.

I am trying to setup p2p-media-loader with my own wt-tracker on example.com/wt and my own coturn on turn.example.com which is on a seperate machine on the net. My config looks the following way:

 const config = {
                    loader: {
                        trackerAnnounce: [
                            "wss://example.com/wt",
                        ],
                                    rtcConfig: {
                                      iceServers: [
                                        { urls: "stun:turn.example.com:5349?transport=udp" },
                                        { urls: ["turns:turn.example.com:5349?transport=udp","turn:turn.example.com:5349?transport=udp"],
                                          username: turn_user,
                                          credentials: turn_pass },
                                      ]
                                    },
                    }};

I also enabled the peer_connect and segment_loaded message from the FAQ which show me that the peers do not connect to each other even peers on the same machine. The turn/stun server should work correctly as indicated by the output of Trickle ICE.

How could one debug such a problem where there are no error messages?

danielfomin96 commented 3 years ago

I had a problem with supplying the credentials to the iceServers object as they were both undefined, I also mispelled credentials as it should be credential. It is now solved.