Other Languages: 中文
The Agora PK Hosting solution is designed for CDN Live push-and-pull stream scenarios that involve switching between the following scenarios:
The hosts can use third-party applications such as ijkplayer to push streams to CDN Live. The push stream address for the hosts are independent and the audience can only see the corresponding host.
The hosts need to quit the CDN Live push stream process, join the same Agora channel, and set the co-hosting composite mode on the Agora server using the setLiveTranscoding API method; then push the composite stream to the original CDN address using the push stream addPublishStreamUrl API method.
The CDN Live audience can then participate in the PK between the hosts. The CDN Live audience does not need to change the CDN Live URL address as the hosts will still use the previous CDN Live push stream URL address. When either one of the hosts quit the Agora channel, the other host will switch to the Standard mode.
You can find the Agora implementation code for Android on Github. You can also download the APK file.
The API methods related to the Agora Online PK:
The Agora PK Hosting solution uses the Agora Video SDK in the communication mode.
When switching to the PK mode from the Standard mode, each host needs to quit the original CDN Live stream and join the same Agora channel through the application logic.
Under the PK mode:
Android:
IOS:
Call the removePublishStreamUrl API method to remove the stream URL address.
Ijkplayer Realization (Optional)
Android: See 'Integration of ijkplayer framework for Android development'.