1

I was going through this PubNub WebRTC demo. https://kevingleason.me/SimpleRTC/minivid.html Which works fine within same network (same browser or different devices across same network). But I tried using it over internet, I am able to connect a call but can not see anything but a black screen. This is the source for same tutorial https://github.com/pubnub/SimpleRTC I have gone through many such application, such as AndroidRTC and I face same problem (black screen after connection over internet). I am unable to figure out why, any help is appreciated.

xdumaine
  • 10,096
  • 6
  • 62
  • 103
AgR
  • 21
  • 4
  • 1
    Are you using a TURN/STUN service to punch holes through the network? Xirsys.com is an example of such a service. – Michael Gorham Feb 03 '16 at 18:38
  • I want to use PubNub data stream network as it is free and don't have to pay for any of the bandwidth, unlike Xirsys. Please help me solve the problem related to PubNub itself. – AgR Feb 04 '16 at 04:17
  • NOTE: [PubNub is free](https://www.pubnub.com/pricing/) up to 100 daily active devices and 1MM msgs/month. And PubNub is only the signaling part of the full WebRTC solution. Xirsys provides hosted video streaming which you will likely need for any production ready app. You should review this [SO thread about PubNub/WebRTC](http://stackoverflow.com/questions/28740230/how-to-use-webrtc-pubnub-api-for-video-chat-client-in-native-android-app). – Craig Conover Feb 04 '16 at 09:19
  • Can I integrate webRTC functionalities in my application without using PubNub or Xirsys and directly using webRTC api. I am new to this and hence not quite sure. Please provide some sources if possible. – AgR Feb 04 '16 at 10:18
  • 1
    @mtbikemike is right. PubNub (or similar signal protocol to get through firewall issues) is required and definitely required to improve the QoS of connecting (call) and disconnecting (hangup). [HTML5Rocks.com has great, unbiased content](http://www.html5rocks.com/en/tutorials/webrtc/basics/) about all this. – Craig Conover Feb 04 '16 at 16:48
  • Thank you, for the guide lines, that definitely helped. – AgR Feb 05 '16 at 03:42
  • @mtbikemike - if you can, add answer based on your comment. I'll up vote. – Craig Conover Feb 06 '16 at 23:50
  • @AgR Did you found a solution ? Can you explain it please ? I'm having the same issue : i'm using pubnub for signaling, and i'v hosted the video page on an online website. If the two peers are connected from the same network it works, but if they are from different netwokrs the video won't work (knowing that with some other peoples it worked fine !) – Sami Mar 22 '18 at 20:09
  • @Sam, Sorry I was unable to resolve it and it was long back so I forgot what we went forward with.. – AgR Mar 24 '18 at 02:22

1 Answers1

0

You need some sort of signaling mechanism (PubNub, Firebase, or your own software [nodejs seems the preferred choice these days]) to get the webRTC API communicating P2P on your local network. To get webRTC to work from one network to another you need a STUN server/service. Google provides free stun servers (stun:stun.l.google.com:19302). To get webRTC to traverse strict firewall settings and complicated networks you need a TURN server/service like xirsys.com.

This article covers it all ... http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/

Michael Gorham
  • 1,234
  • 2
  • 16
  • 24