METHOD FOR IMPLEMENTING P2P VIDEO COMMUNICATION ON WEBPAGE
First Claim
1. A method for implementing p2p video communication on webpage, comprising the following steps:
- 1) a user accessing a webpage and calling a flash interface to connect to a socket server;
the flash connecting to a stratus server and acquiring a key, establishing a connection Netconnection and monitoring received messages, wherein Netconnection is a variable name;
the flash sending a user name and the key of the user to the socket server, and the socket server storing the user name and the key of the user;
a javascript code on the webpage of the source user calling the flash interface to send a message containing a user name of a target user to the socket server;
the socket server receiving the message from the source user, and returning a key corresponding to the user name of the target user to the flash on the webpage of the source user;
the flash on the webpage of the source user sending a video invitation message to the target user via the Netconnection and the key of the target user, and after the target user receives the message, the target user loading a flash, name of which is set as target_video_flash, for playing video on a webpage of the target user;
the target_video_flash connecting to the stratus server and acquiring a new key, connecting to the socket server and storing the new key and the user name of the target user on the socket server;
the target user sending the user name of the source user to the socket server, and the socket server returning a new key corresponding to the user name of the source user to the target_video_flash of the target user;
after the target_video_flash receives the new key corresponding to the user name of the source user returned by the socket server, the target_video_flash starting to play a video stream corresponding to the key via the Netconnection and the new key corresponding to the user name of the source user, and meanwhile, the target user sending a local camera video stream to the flash of the source user via the Netconnection;
2) the target user sending a video communication agreed message to the source user via the Netconnection;
3) after the source user receives the video communication agreed message from the target user, the source user loading a flash, name of which is set as source_video_flash, for playing video on the webpage of the source user;
the source_video_flash connecting to the stratus server and acquiring a new key, connecting to the socket server and storing the new key and the user name of the source user on the socket server;
the source user sending the user name of the target user to the socket server, and the socket server returning the new key corresponding to the user name of the target user to the source_video_flash of the source user;
after the source_video_flash receives the new key corresponding to the user name of the target user returned by the socket server, the source_video_flash starting to play a video stream corresponding to the key via the Netconnection and the new key corresponding to the user name of the target user, and meanwhile, the source user sending a local camera video stream to the flash of the target user via the Netconnection of the source user.
1 Assignment
0 Petitions
Accused Products
Abstract
A method for implementing p2p video communication on webpage includes the following steps: a user accessing a webpage, loading a flash, and a webpage script calling the flash interface to connect to a socket server; the flash connecting to a stratus server to acquire a key and monitoring received messages; the flash sending the user name and the key to the socket server to store; the flash of the source user and the flash of the target user establishing a direct connection by using the key; the source user and the target user acquiring a video source of a local camera respectively, sending the video source to the counterpart through the established connection, and meanwhile, acquiring and displaying the video stream from the counterpart. The not only largely saves the bandwidth cost of the operator, but also greatly improves the smoothness of the video communication between users.
-
Citations
4 Claims
-
1. A method for implementing p2p video communication on webpage, comprising the following steps:
-
1) a user accessing a webpage and calling a flash interface to connect to a socket server;
the flash connecting to a stratus server and acquiring a key, establishing a connection Netconnection and monitoring received messages, wherein Netconnection is a variable name;
the flash sending a user name and the key of the user to the socket server, and the socket server storing the user name and the key of the user;
a javascript code on the webpage of the source user calling the flash interface to send a message containing a user name of a target user to the socket server;
the socket server receiving the message from the source user, and returning a key corresponding to the user name of the target user to the flash on the webpage of the source user;
the flash on the webpage of the source user sending a video invitation message to the target user via the Netconnection and the key of the target user, and after the target user receives the message, the target user loading a flash, name of which is set as target_video_flash, for playing video on a webpage of the target user;
the target_video_flash connecting to the stratus server and acquiring a new key, connecting to the socket server and storing the new key and the user name of the target user on the socket server;
the target user sending the user name of the source user to the socket server, and the socket server returning a new key corresponding to the user name of the source user to the target_video_flash of the target user;
after the target_video_flash receives the new key corresponding to the user name of the source user returned by the socket server, the target_video_flash starting to play a video stream corresponding to the key via the Netconnection and the new key corresponding to the user name of the source user, and meanwhile, the target user sending a local camera video stream to the flash of the source user via the Netconnection;2) the target user sending a video communication agreed message to the source user via the Netconnection; 3) after the source user receives the video communication agreed message from the target user, the source user loading a flash, name of which is set as source_video_flash, for playing video on the webpage of the source user;
the source_video_flash connecting to the stratus server and acquiring a new key, connecting to the socket server and storing the new key and the user name of the source user on the socket server;
the source user sending the user name of the target user to the socket server, and the socket server returning the new key corresponding to the user name of the target user to the source_video_flash of the source user;
after the source_video_flash receives the new key corresponding to the user name of the target user returned by the socket server, the source_video_flash starting to play a video stream corresponding to the key via the Netconnection and the new key corresponding to the user name of the target user, and meanwhile, the source user sending a local camera video stream to the flash of the target user via the Netconnection of the source user. - View Dependent Claims (2, 3, 4)
-
Specification