Coder Social home page Coder Social logo

online-pk's Introduction

Online PK

Other Languages: 中文

Agora PK Hosting

The Agora PK Hosting solution is designed for CDN Live push-and-pull stream scenarios that involve switching between the following scenarios:

  • Co-hosting in Standard mode
  • Co-hosting in PK mode

Co-hosting in Standard Mode

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.

Co-hosting in PK Mode

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.

Architectural Design

ArchitectureDesign.png

You can find the Agora implementation code for Android on Github. You can also download the APK file.

API methods

PK 连麦架构设计

The API methods related to the Agora Online PK:

iOS Android
sharedEngineWithAppId:delegate: create
setChannelProfile setChannelProfile
setClientRole setClientRole
enableVideo enableVideo
joinChannel joinChannel
setLiveTranscoding setLiveTranscoding
addPublishStreamUrl addPublishStreamUrl
removePublishStreamUrl removePublishStreamUrl
leaveChannel leaveChannel

Implementation

  • 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:

  1. Each host needs to set the composite configuration using the _setLiveTranscoding API method a_nd add the CDN Live push stream URL address, using the addPublishStreamUrl API method, in the Agora channel.
  2. The hosts need to ensure that the CDN Live push stream URL address will not change after switching from the Standard mode.
  3. When either one of the hosts quit the Agora channel, the other host will quit the channel and switch to the Standard mode through the application.
  • Before switching to the Standard mode from the PK mode:
  1. Each host needs to remove the previous CDN Live push stream URL address using the removePublishStreamUrl API method.
  2. Each host needs to push the stream to the original CDN URL address.

Integration Guide

Integration SDK

Switching Between the Co-hosting Standard Mode and Co-hosting PK Mode

Android:

  1. Video broadcasting realization
  2. Stream pushing to CDN Live
  3. Call the removePublishStreamUrl API method to remove the stream URL address.

IOS:

  1. Video broadcasting realization

  2. Stream pushing to CDN Live

  3. Call the removePublishStreamUrl API method to remove the stream URL address.

Ijkplayer Realization (Optional)

Android: See 'Integration of ijkplayer framework for Android development'.

online-pk's People

Contributors

guohai avatar plutoless avatar prwrl avatar tongjiangyong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

online-pk's Issues

您好

文中实现的apk文件的Demo有吗

What is RTMP URL from where i can get i

from where i can get these URL i didn't see any thing this my Agora Dashboard.
and please if there any proper documentation or Implementation guide how to implement PK-Host the URL you defined in Guide it's working 404 error.

public final static String PUBLISH_URL = <##YOUR PUBLISH RTMP URL##>;
public final static String PUBLISH_PULL_URL = <##YOUR PLAY RTMP URL##>;

demo 黑屏

进入demo 填写channelName 进入直播页面 不显示图像
IRtcEngineEventHandler 回调方法也没有触发

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.