Cordova using WEBRTC and web-side and mobile video, voice chat

Source: Internet
Author: User

Recently doing a mobile end with mobile, web-side text, video, voice chat features. Text chat using WebSocket, a lot of information on the Internet, there is no difficulty. But in the video, voice chat encountered a small difficulty. have been looking for some of the SDK to quickly develop, such as Opentok, cloud communications, etc., but the project is used in the intranet, these SDKs must be used in an external network, you need to obtain signaling on their servers. Later, I will try to use WEBRTC to do a video voice chat, because it has been used websocket. In WebRTC's official website, see the source code Android has more than 3G, after compiling almost 9G, directly frighten urine. Even if you write a plugin to Cordova, this app will be very large. Then you want to directly through the web to achieve the entire process, the following record the problem-solving process.

1. Read the official English document of Google WebRTC and learn about WEBRT's overall framework and workflow. Read part of the official hosting in the Githu source code, determine the front-end and background implementation program.

2. Write the video, voice chat background, using Nodejs as the service side, completed the channel login, signaling exchange, channel establishment and other functions of code writing. and completed the client login request, signaling send, signaling save, channel establishment, camera and microphone call code writing. Passed through the web-side test, but all Android 4.0-4.4 are not available.

3. Access the blocked Google Browser developer site via VPN, query Chrome's WEBRTC development documentation and find that only 26 versions of WebView support WEBRTC. The Android 5.0 successfully invokes the camera and microphone in the system's built-in browser and communicates with the web side. However, the authorization window cannot be ejected in the Cordova project, causing the video to appear dark.

4. By writing to Android permissions, the WEBRTC kernel is successfully implemented in a system of 5.0 to achieve video voice chat via the Cordova call system. However, the system version requirements are high, compatibility is poor, but the 5.0 system just a few months, the popularity of small and occupy more memory, so continue to find a better solution.

5. Extensive information was accessed on foreign web sites, Finally began to attempt to extract the Android 5.0 WebView kernel, and successfully ported to the project, so that the Cordova project from the Android system itself WebView, directly using the transplanted WebView, successfully completed on Android 4.0-5.0 all platforms successful video, voice chat, and test pass. At this point, mobile and web-side video, voice chat function demo completed.

Cordova using WEBRTC and web-side and mobile video, voice chat

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.