Closed planetcrypton closed 10 months ago
Hi @planetcrypton
I tried to build and play the stream with the react native play sample page and its working fine for me , I think this may be related to TURN Server are you in a strict Firewall condition ?
Can you please try configuring a turn server on the example and let me know if it works for you.
const peer_connection_config = {
iceServers: [
url: 'stun:stun.l.google.com:19302' ,
{
urls: ['turn:*****:3478'],
username: '*****',
credential: '***',
}
]
};
when the client is behind a firewall or strict NAT policies TURN server is required to establish the webrtc connection. The TURN server acts as a relay, forwarding the media streams between the clients, ensuring that the communication can take place despite any network restrictions. here is the documentation for installing and configuring a turn server with ant media server
Hi @USAMAWIZARD ,
Thank you for getting back on this. It seems that you're totally right! First we disabled the firewall, with the result that it did work on Android, but not on iOS just yet. But setting up a TURN server made it it work for iOS as well - also on Android 😅.
Though (likely a whole different issue) I can not play a stream after I have stopped it (on both Android and iOS). The Play button bounces down a few pixels, so it seems like the player "is making some room", but it never starts playing. On iOS a warning comes saying: "No video stream for react tag: 7F452A41-5323-484F-BDBB-ACCB7EF4DB4C". On Android no warning is given.
For the record: The peer_connection_config
property of useAntMedia
Params
is typed with any
, so for people landing on this thread, these are the properties I used:
peer_connection_config: {
iceServers: [
{
urls: string,
username: string,
credential: string,
},
],
},
I want to emphasize that setting up a turn server of version 2.4.4 or higher on the server side suffices. There's no need for separate configuration on the client side. https://antmedia.io/docs/guides/configuration-and-testing/configuring-stun-addresses/#configuring-for-ant-media-244-and-later-versions
@planetcrypton Can you please create a new issue for this problem that you mentioned in the above comments , It will help us to better track the issues. Thank you.
Closing this issue because it's working for @planetcrypton .
Feel free to re-open if it does not work for you.
@USAMAWIZARD @mekya I encounter this in PLAY Example
IOS Player Android Publisher
Short description
I can't make the Play example (nor the Publish) to work. Whether it's iOS or Android, emulator or real device.
Environment
BrowserPlatform name and version: iOS (16.1 + 15) and Android (API 34), both emulator and real device.Steps to reproduce
@antmedia/react-native-ant-media
andreact-native-webrtc
Info.plist
andAndroidManifest.xml
as described at react-native-webrtcExpected behavior
I expected to connect to the live stream and see it playing in the app
Actual behavior
Did see nothing at all in the app. If I click the button again within exactly 10 seconds, I get an
callbackError already_playing
When I edit the stream-id or the websocket url to a value that doesn't exist, I get a 404 in the log. So the values I use are certainly correct. (Also I can activate a playtoken and only passing a correct playtoken won't give me any errors)
Also
adaptor.remoteStreams
seems to be an empty object all the time, when I log it.Logs
Please let me know if you need some more details about the log
Have a great day everyone! cheers Sjoerd