Jump to content
  • 0

React Native SDK - Errors with sample code - undefined is not a function at addStream


Shin
 Share

Question

Short description

I implemented everything as described in the React Native SDK sample inside publish folder and I am still getting this error that says:

startPublishing error undefined is not a function TypeError: undefined is not a function at addStream

Environment

  • Operating system and version: Macbook M1 Pro. Server running on Ubuntu 18
  • Java version: javac 11.0.11
  • Ant Media Server version: ant-media-server-community-2.5.3
  • Browser name and version: Chrome Version 111.0.5563.146

Steps to reproduce

  1. Install @antmedia/react-native-ant-media
  2. install react-native-webrtc
  3. Copy all the code from the sample project inside the publish folder.
  4. change the web socket URL to your server.
  5. change the streamId
  6. don't change anything other than that

Expected behaviour

When you click the Start Publishing button, the webRTC app on the Ant Media Server should become online.

Actual behaviour

When the screen loads, I get the following logs:

 LOG   localStream.current  null
 LOG  in verify
 LOG  web socket opened !
 LOG  got stream
 LOG  in stream {"_reactTag": "e8ebfbbe-8d79-4150-87af-2a82ee6f22ef", "_tracks": [{"_constraints": [Object], "_enabled": true, "_muted": false, "_settings": [Object], "id": "1f106d61-52b4-46f9-b632-2ae5152dbe7a", "kind": "audio", "label": "1f106d61-52b4-46f9-b632-2ae5152dbe7a", "readyState": "live", "remote": false}, {"_constraints": [Object], "_enabled": true, "_muted": false, "_settings": [Object], "id": "b3e3ec43-d3ac-47d8-a7a8-ce2dc1066ccb", "kind": "video", "label": "b3e3ec43-d3ac-47d8-a7a8-ce2dc1066ccb", "readyState": "live", "remote": false}], "active": true, "id": "e8ebfbbe-8d79-4150-87af-2a82ee6f22ef"}
 LOG   onmessage {"command": "pong"}
 LOG   in pong {"command": "pong"}
 LOG  in verify
 LOG  in verify if adaptor local stream {"current": {"_reactTag": "e8ebfbbe-8d79-4150-87af-2a82ee6f22ef", "_tracks": [[MediaStreamTrack], [MediaStreamTrack]], "active": true, "id": "e8ebfbbe-8d79-4150-87af-2a82ee6f22ef"}}
 LOG  localStream.current.toURL() e8ebfbbe-8d79-4150-87af-2a82ee6f22ef

When I click on Start Publishing, it throws an error: startPublishing error undefined is not a function TypeError: undefined is not a function.

Logs

startPublishing error undefined is not a function TypeError: undefined is not a function
    at addStream (http://192.168.100.7:8081/index.bundle?platform=android&dev=true&minify=false&app=com.infinitysports.bluemoon&modulesOnly=false&runModule=true:198383:45)
    at ?anon_0_ (http://192.168.100.7:8081/index.bundle?platform=android&dev=true&minify=false&app=com.infinitysports.bluemoon&modulesOnly=false&runModule=true:197803:55)
    at next (native)
    at asyncGeneratorStep (http://192.168.100.7:8081/index.bundle?platform=android&dev=true&minify=false&app=com.infinitysports.bluemoon&modulesOnly=false&runModule=true:1154:26)
    at _next (http://192.168.100.7:8081/index.bundle?platform=android&dev=true&minify=false&app=com.infinitysports.bluemoon&modulesOnly=false&runModule=true:1173:29)
    at anonymous (http://192.168.100.7:8081/index.bundle?platform=android&dev=true&minify=false&app=com.infinitysports.bluemoon&modulesOnly=false&runModule=true:1178:14)
    at tryCallTwo (/root/react-native/ReactAndroid/hermes-engine/.cxx/Release/4383e266/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:61:9)

 

Link to comment
Share on other sites

  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

1 answer to this question

Recommended Posts

 Share


×
×
  • Create New...