Application Flow for Android peer to peer connection?
I am creating an application in android on webrtc for peer to peer connection for video call and chat .
I have downloaded the demo code from WEBRTC site and successfully ran that code ( can see only video , no voice exchange), I printed all the response on log wherever I had doubt and found that after entering the room URL on dialog it return a response with lot of details like media//iceserver//stun//turn//pcconfig etc.. Here I am getting confused , like what I need to send to the server from mobile to make call and what response should I expect of other peer from server for connection . In android I am using libjingle_peerconnection.jar. I also read about crosswalk and intel xdk but I think its on phonegap , and I need it to be completely on android. I want to go to deep of the webrtc but not finding the right path . Is there any extra things required to make connection between APP calling and Browser ? Also you can suggest me topics which are helpful.
First, you need to compile webrtc code base for Android platform. You can find compiling details in the following link : http://www.webrtc.org/native-code/android
After the compilation, you'll have a libjingle_peerconnection_so.so file and a libjingle_peerconnection.jar file. You should include them into your android project.
Besides compiling code, you need a signalling server which is able to exchange webRTC session description object between peers. Session description objects are given by webrtc engine to your application. You need just send it to another peer and set incoming session object to webrtc engine.
After signalling server, you can make a P2P video call with using webRTC API ( MediaStream and PeerConnection API) Sam Dutton's webrtc posts on html5rocks.com are very helpful in order to understand webrtc structure and flow.
To set up a call you will need a signalling server for the android app to exchange messages with the web browser. Client one sends an offer to client two. Client two responds with an answer. Client one and client two get local ice candidates, which is information on how to connect to them, and exchange this information with one another. Once each client has the SDP (coming from and offer or an answer), and a list of ice candidates (list of way to connect p2p to the other client).
You will need a server to make all this communication happen, in order to start the actual p2p video/audio communication
链接地址: http://www.djcxy.com/p/23482.html上一篇: 在Android中加载内存中的声音
下一篇: Android对等连接的应用程序流?