CN114928595A - System for realizing WebRTC function based on applet platform - Google Patents
System for realizing WebRTC function based on applet platform Download PDFInfo
- Publication number
- CN114928595A CN114928595A CN202210410462.5A CN202210410462A CN114928595A CN 114928595 A CN114928595 A CN 114928595A CN 202210410462 A CN202210410462 A CN 202210410462A CN 114928595 A CN114928595 A CN 114928595A
- Authority
- CN
- China
- Prior art keywords
- applet
- webrtc
- layer
- code
- streaming media
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 claims description 14
- 238000009877 rendering Methods 0.000 claims description 6
- 238000004806 packaging method and process Methods 0.000 claims description 3
- 238000004891 communication Methods 0.000 abstract description 12
- 239000008186 active pharmaceutical agent Substances 0.000 description 11
- 238000010586 diagram Methods 0.000 description 2
- 238000013467 fragmentation Methods 0.000 description 2
- 238000006062 fragmentation reaction Methods 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/44012—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving rendering scenes according to scene graphs, e.g. MPEG-4 scene graphs
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client
- H04N21/63—Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
- H04N21/643—Communication protocols
- H04N21/6437—Real-time Transport Protocol [RTP]
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Multimedia (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to the technical field of WebRTC webpage instant messaging, and particularly discloses a system for realizing a WebRTC function based on an applet platform, which comprises the following steps: the system comprises an applet code layer, an applet base library and an applet mobile terminal SDK, wherein the applet base library comprises an applet base library logic layer and an applet base library view layer. The system for realizing the WebRTC function based on the small program platform, which is provided by the invention, is based on the WebRTCAPI standard, provides a small program environment capable of directly running WebRTC codes, and provides two standard interfaces of a Media API and a RTCPeerconnection in the WebRTC, so that the small program platform can directly run the codes of the standard WebRTC, point-to-point communication is supported, and the audio and video communication function is realized.
Description
Technical Field
The invention relates to the technical field of WebRTC webpage instant messaging, in particular to a system for realizing a WebRTC function based on an applet platform.
Background
WebRTC, the name of which is derived from the acronym of Web instant messaging (english), is an interface that supports Real-Time voice conversations or video conversations for Web browsers. The bottom layer is based on SRTP (secure real-time transport protocol) and UDP (user datagram protocol), the optimization space of the weak network condition is large, the functions of video and audio acquisition, encoding and decoding, data transmission, audio and video display and the like are included, point-to-point communication can be realized, the time delay of both communication parties is low, and an audio and video communication application can be quickly established through related technologies.
In the web, the prior art solution is based on three types of WebRTC standard APIs, namely Media API (multimedia interface), rtp peeerconnection (instant messaging connection), and Peer-to-Peer Data API (point-to-point Data interface), so that developers can easily develop web applications similar to web video chat.
In the prior art, a mobile phone client generates Webview (a container for loading a web page), renders a page in a conventional web page loading manner, and establishes communication on the page by using WebRTC (instant messaging connection function), so as to connect to a remote client. In the prior art, webview adopted is limited by a mobile phone system version, an iOS (internet operating system) end can support the webview only by a higher version, and the android end has more fragmentation problems due to serious fragmentation.
On the applet platform, the WebRTC standard interface cannot be directly used, so that the audio and video application is limited to a certain extent, and the WebRTC code on the web page cannot run in the applet.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a system for realizing the WebRTC function based on a small program platform, so as to solve the problems that in the prior art, a WebRTC standard interface cannot be directly used on the small program platform, the realization of audio and video application is limited to a certain extent, and WebRTC codes on a webpage cannot run in the small program.
As a first aspect of the present invention, there is provided a system for implementing WebRTC function based on an applet platform, including: the system comprises an applet code layer, an applet base library and an applet mobile terminal SDK, wherein the applet base library comprises an applet base library logic layer and an applet base library view layer;
the applet code layer is used for storing WebRTC codes input by a user;
the applet basic library logic layer is used for calling the WebRTC code from the applet code layer when a WebRTC function calling request input by a user is received, packaging a WebRTC function related parameter, a server address and a WebRTC code calling method name input by the user into a WebRTC function calling data block, and sending the WebRTC function calling data block to the applet mobile terminal SDK;
the applet mobile terminal SDK is used for generating a WebRTC function connection when receiving the WebRTC function calling data block; executing corresponding interface logic according to the WebRTC code calling method name in the WebRTC function calling data block, transmitting related parameters of the WebRTC function and a server address, creating the WebRTC function, and then establishing a binding relationship with the WebRTC function; and returning streaming media data and a streaming media ID to the applet base library logic layer;
the applet basic library logic layer is used for returning the streaming media data and the streaming media ID to the applet code layer;
the applet code layer is used for acquiring the stream media ID and sending the stream media ID to the applet base library view layer;
the small program base library view layer is used for creating a video and audio small program component according to the streaming media ID and transmitting the video and audio small program component and the streaming media ID to the small program mobile terminal SDK;
and the applet mobile terminal SDK is used for rendering and displaying the video and audio applet components on the applet code layer according to the streaming media ID and playing corresponding streaming media data when receiving the component rendering request sent by the applet code layer, so that the applet code layer realizes audio and video display.
Further, the WebRTC code includes related methods of the RTCPeerConnection and MediaDevices interface.
Furthermore, two API interfaces, namely RTCPererConnection and MediaDevices, are embedded in the applet base library.
Further, the WebRTC function related parameters include a server account password and whether to open the audio and video.
Further, the applet basic library logic layer comprises a JSbridge module, and information is transmitted between the applet basic library logic layer and the applet mobile terminal SDK through the JSbridge module.
Further, the streaming media data includes a video stream and an audio stream.
The system for realizing the WebRTC function based on the applet platform has the following advantages that: based on the WebRTC API standard, a small program environment capable of directly operating WebRTC codes is provided, and two standard interfaces of Media API and RTCPererConnection in WebRTC are provided, so that the small program platform can directly operate the codes of standard WebRTC, point-to-point communication is supported, and the audio and video communication function is realized.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention.
Fig. 1 is a schematic structural diagram of a system for implementing WebRTC function based on an applet platform according to the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description will be given to the specific implementation, structure, features and effects of the system for implementing WebRTC based on applet platform according to the present invention with reference to the accompanying drawings and preferred embodiments. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without any inventive step, are within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged as appropriate in order to facilitate the embodiments of the invention described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the explanation of the present invention, it should be noted that the terms "mounted," "connected," and "connected" should be construed broadly unless otherwise indicated. For example, the connection may be a fixed connection, a connection through a special interface, or an indirect connection via an intermediate medium. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In this embodiment, a system for implementing a WebRTC function based on an applet platform is provided, and fig. 1 is a schematic structural diagram of the system for implementing a WebRTC function based on an applet platform provided in the present invention, and as shown in fig. 1, the system for implementing a WebRTC function based on an applet platform includes: the system comprises an applet code layer, an applet base library and an applet mobile terminal SDK, wherein the applet base library comprises an applet base library logic layer and an applet base library view layer;
the applet code layer is used for storing WebRTC codes input by a user;
the applet basic library logic layer is used for calling the WebRTC code from the applet code layer when a WebRTC function calling request input by a user is received, packaging a WebRTC function related parameter, a server address and a WebRTC code calling method name input by the user into a WebRTC function calling data block, and sending the WebRTC function calling data block to the applet mobile terminal SDK;
the applet mobile terminal SDK is used for generating a WebRTC function connection when receiving the WebRTC function calling data block; executing corresponding interface logic according to the WebRTC code calling method name in the WebRTC function calling data block, transmitting related parameters of the WebRTC function and a server address, creating the WebRTC function, and then establishing a binding relationship with the WebRTC function; and returning streaming media data and a streaming media ID to the applet basic library logic layer;
it should be noted that the applet mobile terminal SDK runs in an applet environment of the APP, and implements standard WebRTC interfaces such as Media API and RTCPeerConnection based on a google WebRTC standard library (google web page instant messaging processing library).
The applet basic library logic layer is used for returning the streaming media data and the streaming media ID (unique identifier) to the applet code layer;
the applet code layer is used for acquiring the stream media ID and sending the stream media ID to the applet base library view layer;
the small program base library view layer is used for creating a video and audio small program component according to the streaming media ID and transmitting the video and audio small program component and the streaming media ID to the small program mobile terminal SDK;
and the applet mobile terminal SDK is used for rendering and displaying the video and audio applet components on the applet code layer according to the streaming media ID and playing corresponding streaming media data when receiving the component rendering request sent by the applet code layer, so that the applet code layer realizes audio and video display.
Preferably, the WebRTC code includes related methods of RTCPeerConnection and MediaDevices interfaces.
Preferably, two API interfaces, namely, RTCPeerConnection and MediaDevices, are embedded in the applet base library. The applet base is a running environment of the applet code, all WebRTC code runs in the environment (applet base), and based on the running environment, two APIs (interfaces) of the rtcp eerconnection (point-to-point connection for instant messaging) and media devices (media devices) are implanted in the whole environment (applet base).
It should be noted that a RTCPeerConnection object allows the user to communicate directly between the two browsers.
Preferably, the WebRTC function related parameters include a server account password and whether to open the audio and video.
Preferably, the applet basic library logic layer comprises a JSBridge module, and information is transferred between the applet basic library logic layer and the applet mobile terminal SDK through the JSBridge module.
It should be understood that the JSBridge module is a communication module between the applet mobile terminal SDK and the applet base library.
Preferably, the streaming media data includes a video stream and an audio stream.
Specifically, the applet code layer: applet code representing a user; viewing layer of small program base library: the module for managing the view components is responsible for generating, updating and destroying the view components; the small program basic library logic layer: the method is used for maintaining the state, data and the like of the WebRTC instance and processing the calling and forwarding of an interface; the small program mobile terminal SDK: and the WebRTC server is responsible for generating a WebRTC instance, processing an event sent by the basic library and maintaining connection logic.
The system for realizing the WebRTC function based on the applet platform, which is provided by the invention, is based on the WebRTC API standard, provides an applet environment capable of directly running WebRTC codes, provides two standard interfaces of Media API and RTCPeerConnection in the WebRTC, and realizes webRTC communication at an APP end by using the applet mobile end SDK, thereby realizing that the applet platform directly runs the codes of the standard WebRTC, supporting point-to-point communication and realizing the audio and video communication function.
Although the present invention has been described with reference to a preferred embodiment, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (6)
1. A system for realizing WebRTC function based on applet platform, comprising: the system comprises an applet code layer, an applet base library and an applet mobile terminal SDK, wherein the applet base library comprises an applet base library logic layer and an applet base library view layer;
the applet code layer is used for storing WebRTC codes input by a user;
the applet basic library logic layer is used for calling the WebRTC code from the applet code layer when a WebRTC function calling request input by a user is received, packaging a WebRTC function related parameter, a server address and a WebRTC code calling method name input by the user into a WebRTC function calling data block, and sending the WebRTC function calling data block to the applet mobile terminal SDK;
the applet mobile terminal SDK is used for generating a WebRTC function connection when receiving the WebRTC function calling data block; executing corresponding interface logic according to the WebRTC code calling method name in the WebRTC function calling data block, transmitting related parameters of the WebRTC function and a server address, creating the WebRTC function, and then establishing a binding relationship with the WebRTC function; and returning streaming media data and a streaming media ID to the applet base library logic layer;
the applet basic library logic layer is used for returning the streaming media data and the streaming media ID to the applet code layer;
the applet code layer is used for acquiring the stream media ID and sending the stream media ID to the applet base library view layer;
the small program base library view layer is used for creating a video and audio small program component according to the streaming media ID and transmitting the video and audio small program component and the streaming media ID to the small program mobile terminal SDK;
and the applet mobile terminal SDK is used for rendering and displaying the video and audio applet components on the applet code layer according to the streaming media ID and playing corresponding streaming media data when receiving the component rendering request sent by the applet code layer, so that the applet code layer realizes audio and video display.
2. The applet platform-based WebRTC functionality system according to claim 1, characterized in that the WebRTC code comprises related methods of RTCPeerConnection and MediaDevices interface.
3. The applet platform-based WebRTC enabled system according to claim 1, characterized in that the applet base has embedded therein two API interfaces, RTCPeerConnection and MediaDevices.
4. The applet platform-based system for WebRTC functionality according to claim 1, characterized in that the WebRTC functionality related parameters comprise a server account password and whether to start audio video.
5. The applet platform-based system for implementing WebRTC functionality according to claim 1, wherein the applet base library logic layer comprises a JSBridge module through which information is passed between the applet base library logic layer and the applet mobile terminal SDK.
6. The applet platform-based WebRTC enabled system according to claim 1, characterized in that the streaming media data comprises a video stream and an audio stream.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210410462.5A CN114928595B (en) | 2022-04-19 | 2022-04-19 | System for realizing WebRTC function based on applet platform |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210410462.5A CN114928595B (en) | 2022-04-19 | 2022-04-19 | System for realizing WebRTC function based on applet platform |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114928595A true CN114928595A (en) | 2022-08-19 |
| CN114928595B CN114928595B (en) | 2024-04-02 |
Family
ID=82806194
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210410462.5A Active CN114928595B (en) | 2022-04-19 | 2022-04-19 | System for realizing WebRTC function based on applet platform |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114928595B (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108200482A (en) * | 2018-01-16 | 2018-06-22 | 威创集团股份有限公司 | A kind of cross-platform high resolution audio and video playback method, system and client |
| CN110535871A (en) * | 2019-09-09 | 2019-12-03 | 焦点教育科技有限公司 | A kind of classroom real-time video projecting method and system based on WebRTC |
| CN111356024A (en) * | 2020-03-11 | 2020-06-30 | 厦门亿合恒拓信息科技有限公司 | Online video communication method and storage medium for webpage end and wechat applet end |
-
2022
- 2022-04-19 CN CN202210410462.5A patent/CN114928595B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108200482A (en) * | 2018-01-16 | 2018-06-22 | 威创集团股份有限公司 | A kind of cross-platform high resolution audio and video playback method, system and client |
| CN110535871A (en) * | 2019-09-09 | 2019-12-03 | 焦点教育科技有限公司 | A kind of classroom real-time video projecting method and system based on WebRTC |
| CN111356024A (en) * | 2020-03-11 | 2020-06-30 | 厦门亿合恒拓信息科技有限公司 | Online video communication method and storage medium for webpage end and wechat applet end |
Non-Patent Citations (1)
| Title |
|---|
| 石芮;成洪豪;孙立民;: "基于WebRTC的视频会议系统开发", 智能计算机与应用, no. 06 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114928595B (en) | 2024-04-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111479121B (en) | Live broadcasting method and system based on streaming media server | |
| EP3396899B1 (en) | System and method of multi-media conferencing between universal plug and play (upnp) enabled telephony devices and wireless area network (wan) devices | |
| US11336702B2 (en) | Interaction information transmission method and apparatus | |
| US20130067559A1 (en) | INSTANT INTERNET BROWSER BASED VoIP SYSTEM | |
| KR102148046B1 (en) | Calling an unready terminal | |
| US20070133773A1 (en) | Composite services delivery | |
| US7818432B2 (en) | Seamless reflection of model updates in a visual page for a visual channel in a composite services delivery system | |
| CN105407369A (en) | Web application based terminal communication method and device | |
| CN105451071B (en) | Video stream processing method, device and system | |
| CN103533460A (en) | Method, device, terminal and system for sharing television service | |
| CN108696899B (en) | SIP message transmitting and receiving method and transmitting and receiving device | |
| CN107911483A (en) | A kind of information transferring method and device | |
| CN102123154B (en) | Session initiation protocol (SIP) terminal and session processing method | |
| CN107786415B (en) | Service processing method and related equipment and system | |
| CN112714131A (en) | Cross-platform microphone connecting method and device, storage medium and electronic equipment | |
| CN106911666B (en) | Wearable intelligent device and message processing method and system thereof | |
| US20070133769A1 (en) | Voice navigation of a visual view for a session in a composite services enablement environment | |
| CN105704001A (en) | WeChat server message distribution method and WeChat server message distribution system | |
| US20070136449A1 (en) | Update notification for peer views in a composite services delivery environment | |
| CN114928595B (en) | System for realizing WebRTC function based on applet platform | |
| US8005934B2 (en) | Channel presence in a composite services enablement environment | |
| CN106161431A (en) | Call method for building up and system | |
| US20070133511A1 (en) | Composite services delivery utilizing lightweight messaging | |
| US20140375746A1 (en) | Platform, device and method for enabling micro video communication | |
| CN102469136B (en) | A kind of chat sessions increases participant and obtains the method and system of participant list |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |