Cross-Channel Host in¶
In an ordinary live broadcast scenario, hosts in the same channel can host in for interaction, while hosts from different channels can not. This document provides solutions for users to host in from different channels:
|Host-in at the Server Side||Hosts from different App channels can host in for interaction||Need to call additional API methods and ensure that the API calling sequence is correct|
|Host-in at the Client Side||Hosts from different App channels can host in for interaction||Need to add signaling mechanism with complicated logic, and when the hosts from different channels cancel the host-in, they must return to the previous states respectively.|
Host-in at the Server Side¶
Take A、B、C hosts for example: in this solution, the 3 hosts join the same Agora channel, but different audiences of different hosts pull different RTMP streams.
Here, we call the channel of host A and A audiences as one App live channel, the logic and function of which is implemented by yourselves. When we say cross-channel host in, it means host-in from different App live channels, not different Agora channels.
The audiences of host A pull the RTMP stream of this App live channel and view the layouts according to the settings of host A, for example, the following diagram shows the audiences of Channel A view that the image of host A is bigger than that of host B and C:
- Be sure that you have enabled the function of checking the RTMP stream according to Push Stream .
- Be sure that you have set up a web server.
- Be sure that you have created a HTML file with players built-in.
- A、B、C hosts call configPublisher() methods respectively to configure push-stream for bypass live:
Android Windows iOS Mac
Host A:PublisherConfiguration: owner: true size: 360,640 framerate: 15 bitrate: 500 defaultLayout: 1 lifecycle: STREAM_LIFE_CYCLE_BIND2OWNER publisherUrl: rtmpPushUrlA
Host B:PublisherConfiguration: owner: true size: 360,640 framerate: 15 bitrate: 500 defaultLayout: 1 lifecycle: STREAM_LIFE_CYCLE_BIND2OWNER publisherUrl: rtmpPushUrlB
Host C:PublisherConfiguration: owner: true size: 360,640 framerate: 15 bitrate: 500 defaultLayout: 1 lifecycle: STREAM_LIFE_CYCLE_BIND2OWNER publisherUrl: rtmpPushUrlC
- A、B、C hosts call the joinChannel() method to join the same Agora channel:
The audiences do not need to call the joinChannel() method to join the host created App channel, and they only need to access the App channel URL for bypass Live, and can share the link on different social media platforms.
After the hosts joining the same Agora channel, the audiences view different layouts due to different RTMP streams being pulled:
- The audiences view the layouts by default set in defaultLayout defined by the hosts above when calling the configPublisher() method
- If the users have set the picture-in-picture layouts according to Adjust Picture-in-Picture , then the audiences will view the corresponding layouts
Host-in at the Client Side¶
This solution relies on the signaling mechanism, and the workflow is listed as follows:
- Host A sends a host-in request to host B via signaling;
- Host B accepts the host-in request via signaling;
- Host B informs all audiences in Channel B of the request;
- All audiences in Channel B exit Channel B, then join Channel A;
- Host B exits the Channel B, and joins Channel B;
Now, Host A and B can host in for interaction. The process of Multiple users host-in will be the same as above. Once the host-in activity is finished, the host and audiences in Channel B must return to the original state before the host-in.