Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In a first aspect, an embodiment of the present invention provides a live broadcast method, which is applied to a live broadcast client and can improve the real-time property of live broadcast content viewing.
Fig. 1 is a flowchart of a live broadcasting method provided in an embodiment of the present invention, which is applied to a live broadcasting client, and as shown in fig. 1, the method in this embodiment may include:
step 101, receiving a live broadcast room entering request.
In this embodiment, when a user opens a live broadcast client, information prompting entry into a live broadcast room appears on an interface of the client, and if "enter the live broadcast room", the user clicks the prompting information to request entry into the live broadcast room, and then step 102 is executed.
As an alternative embodiment, when the user opens the client, a request to enter the live broadcast is also initiated to the client.
And step 102, opening the live broadcast room according to the live broadcast room entering request.
In this embodiment, the live broadcast client opens the live broadcast room after receiving a request to enter the live broadcast room.
Step 103, starting the streaming media engine to establish a communication connection between the streaming media engine and the streaming media server.
In this embodiment, the streaming server is a core system of the streaming application, and is a key platform for an operator to provide video services to users. The main functions of the streaming media server are to collect, cache, schedule, transmit and play streaming media contents.
The stream media engine is a multi-protocol, multimedia format business service engine which integrates a plurality of service functions, and can support a plurality of services including WMV, REAL, MPEG, FTP, HTTP and the like. The different multimedia engines are used on different terminal devices to ensure that video contents in different formats can be played smoothly.
The live broadcast client starts the stream media engine to establish communication connection with the stream media server, namely, the communication connection between the client and the server is realized.
And step 104, pulling the live broadcast content from the streaming media server through the streaming media engine, and playing the live broadcast content locally.
In this embodiment, playing is performed locally, which means playing in a display interface of a client. The live broadcast content pulling means that the existing live broadcast content of the server is subjected to communication connection between the streaming media engine and the streaming media server according to the protocol type and receives audio and video data.
In this embodiment, the streaming media engine may pull the live content from the streaming media server according to a UDP protocol.
In this embodiment, the streaming media engine is started through the live client, so that the streaming media engine and the streaming media server establish communication connection, and the live client can directly pull live content from the streaming media server and play the live content locally, so that the real-time property of watching the live content can be improved, and the problem of video live broadcast delay is solved.
In an embodiment of the present invention, the pulling, by the streaming engine, the live content from the streaming server and playing the live content locally (step 104), may include:
and pulling the live broadcast content of the anchor and/or the guest from the streaming media server through the streaming media engine, and playing the live broadcast content locally.
In this embodiment, a main broadcast content display window and a guest broadcast content display window are displayed on a live broadcast room display interface of the live broadcast client, and the main broadcast content display window and the guest broadcast content display window can be dragged to any position of the live broadcast room display interface, or any window can be enlarged or reduced, or any window can be closed or hidden.
According to the embodiment, the live content of the anchor and/or the guest is pulled from the streaming media server through the streaming media engine, and the pulled live content of the anchor and/or the guest can operate any live content display window according to the will of a live client user, so that the operability of a live display interface is improved, and the user experience is improved.
In an embodiment of the present invention, when the live content is pulled from the streaming server and locally played (step 104) through the streaming engine, the method may further include:
and pulling the attribute information of the anchor and/or the guest from the streaming media server through the streaming media engine, and displaying the attribute information on a live client.
In this embodiment, the attribute information of the anchor and/or guest includes information such as a head portrait, registration time, occupation, speciality, a city where the anchor and/or guest is located, and the online time of the login. The attribute information of the anchor and/or the guest can be displayed on a display interface of the live broadcast room while the live broadcast content is watched.
According to the embodiment, when the live broadcast content is watched, the attribute information of the anchor and/or the guests is displayed on the display interface of the live broadcast room, so that the convenience for the audience to select whether to connect the anchor and/or the guests with the wheat or select which guests to connect the microphone can be provided, and the user experience is improved.
In an embodiment of the present invention, after the live content is pulled from the streaming server through the streaming engine and played locally (step 104), the method further includes:
step 1041a, initiating a wheat connecting request with the anchor;
in this embodiment, connecting to a wheat means that two or more people are not in the same place, and video call or voice call can be performed through a network, and connecting to a wheat becomes a means for enriching application scenes and activating users in specific application scenes such as live show, multi-anchor connection, killing of wolfs and tourists, online education and the like. The live client can initiate a microphone connecting request with the main broadcast to the streaming media server.
Step 1042a, receiving a returned message of successful connection with the main broadcasting station;
in this embodiment, the streaming media server sends a direct broadcast client-initiated wheat connection request to the anchor, and when the anchor receives the direct broadcast client-initiated wheat connection request, the streaming media server sends a message that the direct broadcast client successfully connects to the anchor.
In this embodiment, the anchor may accept some or all of the live client's requests to connect to the wheat from the live client's requests to connect to the wheat.
Step 1043a, pushing the local audio and/or video data to the streaming media server through the streaming media engine, so that the anchor pulls the local audio and/or video data from the streaming media server.
In this embodiment, the local audio and/or video data is obtained by collecting audio and video data through a microphone or a camera, and then encoding the obtained audio and video data, and pushing the encoded audio and video data to the streaming media server according to a UDP protocol, and the anchor can pull the local audio and/or video data from the streaming media server.
In this embodiment, the live broadcast client pushes local audio and/or video data of the live broadcast client to the streaming media server through the streaming media engine, after the live broadcast client successfully connects with the anchor broadcast, the anchor broadcast can pull the local audio and/or video data from the streaming media server, and the seamless connection between the anchor broadcast and the local audio and/or video data push is realized, so that the user experience is improved.
In an embodiment of the present invention, as an optional embodiment, before receiving a returned successful message of connecting to the anchor after initiating a request of connecting to the anchor, the method further includes:
displaying the position of the wheat connecting request in a wheat connecting waiting queue according to the priority of initiating the wheat connecting request with a main broadcast, wherein the priority is determined according to the attribute information of a current user watching the live broadcast content
In this embodiment, the attribute information of the user may be information such as a registration duration, an online duration of the current video watching, and a location of the current video watching. If the priority can be judged according to the online time, the user with longer online time can be put into the position of the waiting microphone queue at the front position with higher priority. Or the priority judgment is carried out according to the located geographic position, and the priority is higher when the geographic position of the anchor is closer, the priority can be put into the position of the waiting microphone connecting queue, which is farther.
In the embodiment, the priority of the user and the main broadcasting microphone connecting request is determined according to the attribute information of the current user, the position of the microphone connecting request in the microphone connecting waiting queue is displayed, the user can know the position of the user in the waiting queue and estimate the waiting time, the time can be freely controlled during the waiting period, for example, the user can select to answer the phone of other people during the waiting period, discuss problems with other people and the like, the effect of effectively utilizing the time by the user is achieved, and the user experience is improved.
In an embodiment of the present invention, after the live content is pulled from the streaming server through the streaming engine and is locally played (step 1043a), the method further includes:
step 1044a, judging whether the duration of continuous wheat connection with the main broadcast reaches a preset duration threshold value;
in this embodiment, the predetermined time threshold may be 10 minutes, 30 minutes, 1 hour, and the like.
And 1045a, if the time of continuously connecting the main broadcasting station with the main broadcasting station reaches a preset time threshold, performing a wheat connecting interruption prompt.
In this embodiment, when the duration of the continuous microphone connection with the anchor reaches a predetermined duration threshold, a microphone connection interruption prompt is performed. The interruption prompt message can be about to interrupt the microphone or about to interrupt the microphone within several seconds or tens of seconds, and can prompt the user in a mode of popping up a prompt bar or voice prompt and the like.
In the embodiment, when the time of continuously connecting the microphone with the main broadcast reaches the preset time threshold, the interruption information is prompted, so that the user who is connecting the microphone knows that the microphone is about to be interrupted, and meanwhile, other users who request to connect the microphone can successfully connect the microphone, thereby avoiding the problem that part of the users occupy network resources all the time, and other users cannot enjoy the network resources, and improving the user experience.
In an embodiment of the present invention, as an optional embodiment, the live broadcast client may also initiate a wheat connection request with the anchor to the signaling server, the signaling server sends the wheat connection request of the live broadcast client to the anchor, the anchor receives the wheat connection request of the live broadcast client, the signaling server sends a message that the wheat connection with the anchor is successful to the live broadcast client, and then the live broadcast client pushes local audio and/or video data to the streaming media server through the streaming media engine, so that the anchor pulls the local audio and/or video data from the streaming media server.
In an embodiment of the present invention, after the live content is pulled from the streaming server through the streaming engine and played locally (step 104), the method further includes:
step 1041b, initiating a wheat connection request with a guest;
in this embodiment, the process of initiating the wheat connection request is the same as that in step 1041a, and is not described here again.
Step 1042b, receiving a returned successful message of connecting with the guest;
in this embodiment, the process of receiving the wheat connecting request is the same as that in step 1042a, and is not described herein again.
Step 1043b, pushing, by the streaming media engine, the local audio and/or video data to the streaming media server, so that the guest pulls the local audio and/or video data from the streaming media server.
In this embodiment, the pushing process is the same as that in step 1043a, and is not described here again.
In this embodiment, the live client pushes the local audio and/or video data of the live client to the streaming media server through the streaming media engine, after the guest successfully connects with the guest, the guest can pull the local audio and/or video data from the streaming media server, and the guest can connect with the local audio and/or video data to realize seamless connection, so that the user experience is improved.
In an embodiment of the present invention, after the streaming engine pushes the local audio and/or video data to the streaming server, so that the guest pulls the local audio and/or video data from the streaming server (step 1043b), the method further includes:
step 1044b, judging whether the duration of continuous wheat connection with the guest reaches a preset duration threshold value;
in this embodiment, the predetermined time threshold may be 10 minutes, 30 minutes, 1 hour, and the like.
And in the step 1045b, if the time for continuously connecting the microphone with the guest reaches a preset time threshold, performing microphone connecting interruption prompt.
In this embodiment, when the time for continuously connecting to the guest reaches a predetermined time threshold, a disconnection prompt is performed. The interruption prompt message can be about to interrupt the microphone or about to interrupt the microphone within several seconds or tens of seconds, and can prompt the user in a mode of popping up a prompt bar or voice prompt and the like.
In the embodiment, when the time of continuously connecting the microphone with the guest reaches the preset time threshold, the interruption information is prompted, so that the user who is connecting the microphone knows that the microphone is about to be interrupted, and meanwhile, other users who request to connect the microphone can successfully connect the microphone, thereby avoiding the problem that part of the users occupy network resources all the time, and other users cannot enjoy the network resources, and improving the user experience.
In an embodiment of the present invention, as an optional embodiment, the live broadcast client may also initiate a microphone connection request with the guest to the signaling server, the signaling server sends the microphone connection request of the live broadcast client to the guest, the guest receives the microphone connection request of the live broadcast client, the signaling server sends a message that microphone connection with the guest is successful to the live broadcast client, and then, the local audio and/or video data is pushed to the streaming media server through the streaming media engine, so that the guest pulls the local audio and/or video data from the streaming media server.
The live broadcast method shown in fig. 1 will be described in detail below using a specific embodiment.
Fig. 2 is a schematic diagram of a video live broadcasting scheme, in which a main broadcasting client a, a guest client B, C, and viewer clients D and E are provided, and different multimedia engines are used at the clients to ensure smooth playing of video contents in multiple different formats.
The viewer client D, E views live content as follows:
the viewer client D, E receives the live broadcast room entering request, opens the live broadcast room, and the live broadcast room displays the prompt information for entering the live broadcast room;
clicking to enter a live broadcast room;
the viewer client D, E starts the streaming media engine to make the streaming media engine and the streaming media server establish communication connection;
the spectator client D, E uses a UDP protocol to pull the live broadcast content of the anchor client a, the guest client B, and the guest client C from the streaming server, the spectator client D, E watches the live broadcast content of the anchor client a, the guest client B, and the guest client C locally, and can see that the city where the anchor client a is located is wuhan and the occupation is a tour guide, and the city where the guest client B is located is a dune, and the city where the doctor and the guest client C are located is business information and the occupation is a secretary in a large connection.
When watching the live broadcast content, the viewer client may place three display windows displaying the live broadcast contents of the anchor client a, the guest client B, and the guest client C at any position of the live broadcast display interface of the viewer client, for example, place the live broadcast content display window of the anchor client a at the upper left corner of the live broadcast display interface of the viewer client and perform an amplification operation thereon, and place the live broadcast content display window of the guest client B, C at the lower left corner and lower right corner of the live broadcast display interface of the viewer client, respectively, and perform a reduction operation thereon.
When the viewer client D, E watches several minutes of live content, it needs to join the microphone and push data, as follows:
the spectator client D, E all want to know about the information on the travel, so the spectator client D, E initiates a request to the streaming server for a microphone connection with the anchor client a;
the streaming media server sends the wheat connection request to a main broadcasting client A;
the anchor client A agrees with the wheat connecting request of the audience client D and rejects the wheat connecting request of the audience client E;
returning the information of the microphone connecting request of the client end D agreeing to the audience and the information of the microphone connecting request of the client end E refusing to the streaming media server;
the streaming media server sends successful information of microphone connection to the audience client D, and at the moment, the audience client D can push real-time audio data and video data acquired by using a camera to the streaming media server through a streaming media engine;
and when the duration time of the client end D of the audience reaches 30 minutes, the live broadcast display interface displays a prompt message of 'interrupting the microphone after 10 seconds' and finishes the microphone after 10 seconds.
The anchor client a uses UDP protocol to pull the live content pushed by the client D from the streaming server.
In a second aspect, an embodiment of the present invention provides a live broadcasting device, which is applied to a live broadcasting client and can improve the real-time property of live broadcasting content viewing.
Fig. 3 is a schematic structural diagram of a live broadcast device according to an embodiment of the present invention, which is applied to a live broadcast client, and as shown in fig. 3, the live broadcast device according to this embodiment may include: the system comprises a first request receiving module 11, a live broadcast room opening module 12, a first communication module 13 and a playing module 14; wherein,
a first request receiving module 11, configured to receive a live broadcast room entry request;
a live broadcast room opening module 12, configured to open a live broadcast room according to the live broadcast room entry request;
the first communication module 13 is configured to start the streaming media engine, so that the streaming media engine establishes a communication connection with the streaming media server;
and the playing module 14 is configured to pull the live content from the streaming media server through the streaming media engine, and play the live content locally.
The apparatus of this embodiment may be used to implement the technical solution of the method embodiment shown in fig. 1, and the implementation principle and the technical effect are similar, which are not described herein again.
In an embodiment of the present invention, the playing module 14 is specifically configured to: and pulling the live broadcast content of the anchor and/or the guest from the streaming media server through the streaming media engine, and playing the live broadcast content locally.
In an embodiment of the present invention, the playing module 14 is further specifically configured to: and pulling the attribute information of the anchor and/or the guest from the streaming media server through the streaming media engine, and displaying the attribute information on a live client.
In an embodiment of the present invention, the apparatus further includes: a first microphone connecting request initiating module 141a, a first microphone connecting message receiving module 142a, a first stream pushing module 143a, wherein,
a first connecting request initiating module 141a, configured to initiate a connecting request with a main broadcast;
a first connecting message receiving module 142a, configured to receive a returned successful connecting message with the anchor;
the first stream pushing module 143a is configured to push the local audio and/or video data to the streaming server through the streaming engine, so that the anchor pulls the local audio and/or video data from the streaming server.
In an embodiment of the present invention, the apparatus further includes: the device further comprises: a first duration determination module 144a, a first interrupt presentation module 145a, wherein,
a first duration determining module 144a, configured to determine whether a duration of continuous wheat connection with the anchor reaches a predetermined duration threshold;
the first interruption prompting module 145a is configured to perform a continuous microphone connection interruption prompt if the continuous microphone connection time with the anchor reaches a predetermined time threshold.
In an embodiment of the present invention, the apparatus further includes: a second microphone connecting request initiating module 141b, a second microphone connecting message receiving module 142b, and a second stream pushing module 143b, wherein,
the second microphone connecting request initiating module 141b is configured to initiate a microphone connecting request with a guest;
the second microphone connecting message receiving module 142b is configured to receive a returned successful message of microphone connecting with the guest;
the second stream pushing module 143b is configured to push, by the streaming media engine, the local audio and/or video data to the streaming media server, so that the guest pulls the local audio and/or video data from the streaming media server.
In an embodiment of the present invention, the apparatus further includes: a second duration determination module 144b, a second interrupt presentation module 145b, wherein,
the second duration judging module 144b is configured to judge whether a duration of continuous wheat connection with the guest reaches a predetermined duration threshold;
and the second interruption prompting module 145b is configured to perform wheat connection interruption prompting if the time for continuously connecting wheat with the guest reaches a preset time threshold.
In a third aspect, an embodiment of the present invention provides another live broadcasting method, which is applied to a streaming media server and can improve the real-time property of live content viewing.
Fig. 4 is a flowchart of a live broadcasting method provided in an embodiment of the present invention, which is applied to a streaming media server, and as shown in fig. 4, the live broadcasting method in this embodiment may include:
step 201, receiving a live broadcast room entering request initiated by a first live broadcast client; the first direct broadcast client is a spectator client.
In this embodiment, when the user opens the viewer client, a live broadcast room entry request is sent to the streaming media server, and the streaming media server receives the live broadcast room entry request initiated by the viewer client.
Step 202, pushing the information of the live broadcast room to the first live broadcast client according to the live broadcast room entering request so as to display the live broadcast room on the first live broadcast client.
In this embodiment, the live room information may include: anchor name, audience size, etc. And the streaming media server searches corresponding live broadcast room information according to the live broadcast room entering request, and pushes the information of the live broadcast room to the first live broadcast client.
Step 203, establishing communication connection with the streaming media engine of the first direct broadcast client.
In this embodiment, the streaming server is a core system of the streaming application, and is a key platform for an operator to provide video services to users. The main functions of the streaming media server are to collect, cache, schedule, transmit and play streaming media contents.
The stream media engine is a multi-protocol, multimedia format business service engine which integrates a plurality of service functions, and can support a plurality of services including WMV, REAL, MPEG, FTP, HTTP and the like. The different multimedia engines are used on different terminal devices to ensure that video contents in different formats can be played smoothly.
The stream media server establishes communication connection with a stream media engine of the first direct broadcast client, namely, the communication connection between the client and the server is realized, and the client sends the information requesting to enter the live broadcast room to the stream media server.
And step 204, providing the live broadcast content, so that a streaming media engine of the first live broadcast client can pull the live broadcast content and play the live broadcast content locally at the first live broadcast client.
In this embodiment, playing locally on the first direct broadcast client means playing in the display interface of the first direct broadcast client.
The stream media server searches the corresponding live broadcast room content according to the information of the request entering the live broadcast room, and the stream media engine of the first live broadcast client end pulls the live broadcast content provided by the stream media server and plays the live broadcast content locally at the first live broadcast client end.
In this embodiment, the streaming media engine may pull the live content from the streaming media server according to a UDP protocol.
In this embodiment, the streaming media server receives a request of the viewer client to enter the live broadcast room, and establishes a communication connection with the streaming media engine of the first live broadcast client, and the streaming media server provides live broadcast content for the streaming media engine of the first live broadcast client to pull and play locally at the first live broadcast client, so that the real-time of watching the live broadcast content can be improved, and the problem of delay in watching the live video is solved.
In an embodiment of the present invention, the providing the live content for a streaming media engine of the first live client to pull the live content and play the live content locally on the first live client (step 204), includes:
and providing live content of a main broadcast and/or guests for a streaming media engine of the first live client to pull the live content and play the live content locally at the first live client.
In this embodiment, the pulled anchor live content display window and/or guest live content display window are displayed on the live broadcast room display interface of the first live broadcast client, and the anchor live content display window and the guest live content display window may be dragged to any position of the live broadcast room display interface, or any window may be enlarged or reduced, or any window may be closed or hidden.
According to the embodiment, the live content of the anchor and/or the guest is pulled from the streaming media server through the streaming media engine, and the pulled live content of the anchor and/or the guest can operate any live content display window according to the will of a live client user, so that the operability of a live display interface is improved, and the user experience is improved.
In an embodiment of the present invention, while providing live content for a streaming media engine of a first live client to pull the live content and play the live content locally on the first live client, the method further includes:
and providing the attribute information of the anchor and/or the guest for a streaming media engine of the first direct-playing client to pull the attribute information of the anchor and/or the guest and display the attribute information on the first direct-playing client.
In this embodiment, the attribute information of the anchor and/or guest includes information such as a head portrait, registration time, occupation, speciality, a city where the anchor and/or guest is located, and the online time of the login. The attribute information of the anchor and/or the guest can be displayed on a display interface of the live broadcast room while the live broadcast content is watched.
According to the embodiment, when the live broadcast content is watched, the attribute information of the anchor and/or the guests is displayed on the display interface of the live broadcast room, so that the convenience for the audience to select whether to connect the anchor and/or the guests with the wheat or select which guests to connect the microphone can be provided, and the user experience is improved.
In an embodiment of the present invention, before providing the live content for a streaming media engine of the first live client to pull the live content and play the live content locally on the first live client (step 204), the method further includes:
2041a, establishing communication connection with a streaming media engine of a second live broadcast client; the second anchor client is an anchor client;
in this embodiment, the streaming media server establishes a communication connection with the streaming media engine of the anchor client, that is, the anchor client and the streaming media server are in communication connection.
And 2042a, receiving live broadcast content pushed by a second live broadcast client.
In this embodiment, the second live broadcast client collects audio and video data through a microphone or a camera, encodes the collected audio and video data, and pushes the encoded audio and video data to the streaming media server according to a UDP protocol.
In this embodiment, the streaming media server establishes communication with the first live client and the second live client, respectively, and can receive live content pushed by the second live client and push the live content to the first live client. Therefore, the first live client side can synchronously watch the live content of the second live client side, the real-time property of watching the live content can be improved, and the problem of video live broadcast delay is solved.
In an embodiment of the present invention, before providing the live content for a streaming media engine of the first live client to pull the live content and play the live content locally on the first live client (step 204), the method further includes:
2041b, establishing communication connection with a streaming media engine of a third live broadcast client; the third anchor client is a guest client;
in this embodiment, the streaming media server establishes a communication connection with the streaming media engine of the guest client, that is, the communication connection between the guest client and the streaming media server is realized.
And 2042b, receiving live broadcast content pushed by a third live broadcast client.
In this embodiment, the third live broadcast client collects audio and video data through a microphone or a camera, encodes the collected audio and video data, and pushes the encoded audio and video data to the streaming media server according to a UDP protocol.
In this embodiment, the streaming media server establishes communication with the first live client and the third live client, respectively, and can receive live content pushed by the third live client and push the live content to the first live client. Therefore, the first live client side can synchronously watch the live content of the third live client side, the real-time property of watching the live content can be improved, and the problem of video live broadcast delay is solved.
In an embodiment of the present invention, as an optional embodiment, after providing the live content for a streaming media engine of the first live client to pull the live content and play the live content locally on the first live client (step 204), the method further includes:
step 205a, receiving a wheat connecting request with a main broadcast or a guest initiated by a first live broadcast client;
in this embodiment, the streaming media server receives a microphone connection request with a main broadcast or a guest initiated by a first direct broadcast client.
As an alternative embodiment, the first direct broadcast client may also initiate a microphone connection request with the host or guest to the signaling server.
Step 206a, determining a priority of connecting to the microphone according to the attribute information of the user of the first live broadcast client;
in this embodiment, the attribute information of the user may be information such as a registration duration, an online duration of the current video watching, and a location of the current video watching. The continuous wheat priority is determined according to the attribute information of the user of the first direct broadcasting client, and if the priority can be judged according to the online time of the user of the first direct broadcasting client, the user of the first direct broadcasting client with longer online time has higher priority. Or the priority is judged according to the geographical position of the user of the first direct broadcasting client, and the closer the geographical position of the first direct broadcasting client is, the higher the priority is.
Step 207a, determining a continuous wheat waiting position according to the continuous wheat priority;
in this embodiment, the higher the priority of the user of the first live broadcast client, the higher the position of the user waiting for the online queue.
And 208a, putting the wheat connecting request into a corresponding position in a waiting wheat connecting queue according to the wheat connecting waiting position.
In this embodiment, the user of the first direct broadcast client with the higher priority is placed at a position closer to the front in the waiting continuous broadcast queue.
In the embodiment, the priority of the user and the anchor or guest microphone connecting request is determined according to the attribute information of the current user, the position of the microphone connecting request in the microphone connecting waiting queue is displayed, the user can know the position of the user in the waiting queue and estimate the waiting time, the time can be freely controlled during the waiting period, for example, the user can select to answer the phone of other people during the waiting period, discuss problems with other people and the like, the effect of effectively utilizing the time by the user is achieved, and the user experience is improved.
In an embodiment of the present invention, after providing the live content for a streaming media engine of the first live client to pull the live content and play the live content locally on the first live client (step 204), the method further includes:
and step 205, receiving the live broadcast content pushed by the first live broadcast client after the first live broadcast client successfully connects with the main broadcast or the guest.
In this embodiment, the first direct broadcast client initiates a wheat connection request with a main broadcast or a guest, the streaming media server receives the wheat connection request and sends the request to the main broadcast live broadcast or the guest live broadcast, when the main broadcast live broadcast or the guest live broadcast agrees with the wheat connection request and sends the wheat connection agreement request to the streaming media server, the streaming media server sends a message of wheat connection agreement to the first direct broadcast client, and at this time, the first direct broadcast client can push live broadcast content to the streaming media server.
In an embodiment of the present invention, as an optional embodiment, the first direct broadcast client may also initiate a wheat connection request with the anchor or the guest to the signaling server, the signaling server sends the wheat connection request of the live broadcast client to the anchor or the guest, the anchor or the guest accepts the wheat connection request of the live broadcast client, the signaling server sends a message that the wheat connection with the anchor or the guest is successful to the live broadcast client, and then, the local audio and/or video data is pushed to the streaming media server through the streaming media engine, so that the anchor or the guest pulls the local audio and/or video data from the streaming media server.
In this embodiment, a communication connection is established between the streaming media server and the streaming media engine, the streaming media engine of the first direct broadcast client pulls the live content and plays the live content locally at the first direct broadcast client, and when the first direct broadcast client successfully connects with the main broadcast or the guest, the streaming media server receives the live content pushed by the first direct broadcast client. Therefore, seamless connection between the microphone and the local audio and/or video data is realized, and user experience is improved.
In an embodiment of the present invention, after the first live broadcast client successfully connects with the main broadcast or the guest, and receives live broadcast content pushed by the first live broadcast client, the method further includes:
step 206, judging whether the duration of the continuous wheat connection between the first direct broadcast client and the main broadcast or the guest reaches a preset duration threshold value;
in this embodiment, the predetermined time threshold may be 10 minutes, 30 minutes, 1 hour, and the like.
And step 207, if the time for the first live broadcast client to continuously connect the microphone with the main broadcast or the guest reaches a preset time threshold, sending a microphone connecting interruption prompting message to the first live broadcast client.
In this embodiment, when the time for continuously connecting the main broadcasting or the guest to the microphone reaches a predetermined time threshold, the microphone connecting interruption prompt is performed. The interruption prompt message can be about to interrupt the microphone or about to interrupt the microphone within several seconds or tens of seconds, and can prompt the user in a mode of popping up a prompt bar or voice prompt and the like.
In the embodiment, when the time of continuously connecting the microphone with the main broadcasting or the guest reaches the preset time threshold, the interruption information is prompted, so that the user who is connecting the microphone knows that the microphone is about to be interrupted, and meanwhile, other users who request to connect the microphone can successfully connect the microphone, thereby avoiding the problem that part of the users occupy network resources all the time, and other users cannot enjoy the network resources, and improving the user experience.
The live broadcast method shown in fig. 4 will be described in detail below using a specific embodiment.
The video live frame diagram shown in fig. 2 is used as an example to describe the live method in detail.
The viewer client D watches live content as follows:
and the streaming media server receives a live broadcast room entering request initiated by the audience client end D and pushes the information of the live broadcast room to the audience client end, wherein the information of the live broadcast room comprises the name of the anchor and the number of people watching the anchor.
The streaming media server establishes communication connection with the streaming media engine;
the method comprises the following steps that a streaming media server respectively establishes communication connection with streaming media engines of a main broadcasting client A and a guest client B, and the main broadcasting client A and the guest client B respectively push respective live broadcast contents to the streaming media server by using a UDP (user Datagram protocol);
the stream media server searches for corresponding stream names according to a live broadcast room entering request, the audience client D uses a UDP protocol to pull live broadcast contents of a main broadcast A, a guest B and a guest C corresponding to the stream names from the stream media server and plays the live broadcast contents at the audience client, and meanwhile, the city where the main broadcast client A is located is Wuhan and the occupation is a guide, the city where the guest client B is located is a dune, the position of the post is also provided, and the city where the doctor and the guest client C are located is the career information of the world, the occupation is the secretary and other attribute information;
when the audience client D watches several minutes of live content, the streaming media server needs to join in the live broadcasting and push data, and the specific working process of the streaming media server is as follows:
the audience client end D is interested in the tourism and initiates a wheat connecting request with the anchor client end A to the streaming media server;
the streaming media server sends the wheat connecting request to the anchor client A, and when the anchor client A agrees to the wheat connecting request of the audience client D, the information agreeing to wheat connecting is returned to the streaming media server;
and the streaming media server sends the successful message of connecting the microphone to the audience client D, and at the moment, the streaming media server receives the real-time audio data and the video data pushed by the audience client D.
When the duration of the audience client D connecting the microphone reaches 30 minutes, the streaming media server sends a prompt message of 'interrupting the microphone after 10 seconds' to the audience client D.
In a fourth aspect, an embodiment of the present invention provides another live broadcasting apparatus, which is applied to a streaming media server and can improve the real-time property of live content viewing.
Fig. 5 is a schematic structural diagram of a live device according to an embodiment of the present invention, which is applied to a streaming media server, and as shown in fig. 5, the live device according to this embodiment may include: a second request receiving module 21, a live broadcast room information pushing module 22, a second communication module 23 and a live broadcast content providing module 24; wherein,
a second request receiving module 21, configured to receive a live broadcast room entry request initiated by a first live broadcast client; the first anchor client is a spectator client;
the live broadcast room information pushing module 22 is configured to push the live broadcast room information to the first live broadcast client according to the live broadcast room entry request, so that the live broadcast room is displayed at the first live broadcast client;
the second communication module 23 is configured to establish a communication connection with a streaming media engine of the first direct broadcast client;
and the live content providing module 24 is configured to provide live content, so that the streaming media engine of the first live client pulls the live content and plays the live content locally on the first live client.
The apparatus of this embodiment may be used to implement the technical solution of the method embodiment shown in fig. 4, and the implementation principle and the technical effect are similar, which are not described herein again.
In an embodiment of the present invention, the live content providing module 24 is specifically configured to:
and providing live content of a main broadcast and/or guests for a streaming media engine of the first live client to pull the live content and play the live content locally at the first live client.
In an embodiment of the present invention, the live content providing module 24 is further specifically configured to: and providing the attribute information of the anchor and/or the guest for a streaming media engine of the first direct-playing client to pull the attribute information of the anchor and/or the guest and display the attribute information on the first direct-playing client.
In an embodiment of the present invention, the apparatus further includes: a third communication module 241a, a first live content receiving module 242a, wherein,
the third communication module 241a is configured to establish a communication connection with a streaming media engine of the second live broadcast client; the second anchor client is an anchor client;
the first live content receiving module 242a is configured to receive live content pushed by a second live client.
In an embodiment of the present invention, the apparatus further includes:
the fourth communication module 241b is configured to establish a communication connection with a streaming media engine of a third live broadcast client; the third anchor client is a guest client;
and a second live content receiving module 242b, configured to receive live content pushed by a third live client.
In an embodiment of the present invention, the apparatus further includes:
the third live content receiving module 241c is configured to receive the live content pushed by the first live client after the first live client successfully connects with the anchor or guest.
In an embodiment of the present invention, the apparatus further includes: a third duration determining module 242c, a third interrupt presenting module 243c, wherein,
a third duration determining module 242c, configured to determine whether a duration for the first direct broadcast client to continuously connect to the anchor or guest wheat reaches a predetermined duration threshold;
the third interruption prompting module 243c is configured to send a microphone connection interruption prompting message to the first live broadcast client if the time for the first live broadcast client to continuously connect with the anchor or guest microphone reaches the predetermined time threshold.
In a fifth aspect, an embodiment of the present invention further provides an electronic device, fig. 6 is a schematic structural diagram of an embodiment of the electronic device of the present invention, and a flow of the embodiments shown in fig. 1 and 4 of the present invention may be implemented, as shown in fig. 6, where the electronic device may include: the device comprises a shell 41, a processor 42, a memory 43, a circuit board 44 and a power circuit 45, wherein the circuit board 44 is arranged inside a space enclosed by the shell 41, and the processor 42 and the memory 43 are arranged on the circuit board 44; a power supply circuit 45 for supplying power to each circuit or device of the electronic apparatus; the memory 43 is used to store a computer program; the processor 42 is adapted to perform the method according to any of the preceding embodiments by reading a computer program stored in the memory 43.
The specific execution process of the above steps by the processor 42 and the steps further executed by the processor 42 by running the computer program may refer to the description of the embodiment shown in fig. 1 of the present invention, and are not described herein again.
The electronic device exists in a variety of forms, including but not limited to:
(1) a mobile communication device: such devices are characterized by mobile communications capabilities and are primarily targeted at providing voice, data communications. Such terminals include: smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) Ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include: PDA, MID, and UMPC devices, etc., such as ipads.
(3) A server: the device for providing the computing service comprises a processor, a hard disk, a memory, a system bus and the like, and the server is similar to a general computer architecture, but has higher requirements on processing capacity, stability, reliability, safety, expandability, manageability and the like because of the need of providing high-reliability service.
(4) And other electronic equipment with data interaction function.
In a sixth aspect, embodiments of the present invention also provide a computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement a method as described in any of the preceding implementations.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or device that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or device. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or device that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments.
In particular, as for the device embodiment, since it is substantially similar to the device embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the device embodiment.
For convenience of description, the above devices are described separately in terms of functional division into various units/modules. Of course, the functionality of the units/modules may be implemented in one or more software and/or hardware implementations of the invention.
It will be understood by those skilled in the art that all or part of the processes of the apparatuses implementing the embodiments described above can be implemented by using a computer program to instruct related hardware, where the program can be stored in a computer-readable storage medium, and when executed, the program can include the processes of the embodiments of the apparatuses described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.