The invention discloses an audio and
video transmission method and
system, and relates to the technical field of audio and
video transmission, and the method comprises the following steps: 1, building a
communication link, specifically, initializing connection; adding a local media track; the sending end creates a session invitation and sends the session invitation to the receiving end, and after receiving the session invitation, the receiving end sets remote description, creates a session response and returns the session response to the sending end; the sending end sets far-end description; the two parties start to exchange interactive connection to establish candidate addresses; and after the channel connection is successful,
monitoring data or media streams. And step 2,
data transmission in an actual channel is carried out: when point-to-point connection is successfully established (the connection supports remote peer-to-peer connection, maintenance and monitoring, and the connection is closed when no connection is needed),
data transmission is carried out through a data construction transmission mode model. And step 3, confirming the basic flow of audio and
video transmission. According to the method, the content is packaged into the pull
stream interface and the push
stream interface, aiming at the asynchronous execution characteristic of webpage real-time communication, all the content is packaged into success and failure
callback with an asynchronous result object, and each step has state return.