Livecast

Default Settings

Proceed with project setting for each platform before broadcasting.

Development

The RemonCast class provides functions for creating and viewing broadcasts. The broadcast function can be used with the create () and join () functions of the RemonCast class.

Please refer to the following for the overall configuration and flow.

pageFlowpageStructure

View Registration

The caster must see himself/herself with the local view. To view the broadcast, the viewer must connect the view in which the actual video is drawn. Register the Local View to let the caster to see himself/herself, and register the Remote View to make the caster visible to the viewer.

<!-- Caster : local view -->
<video id="localVideo" autoplay muted></video>
<!-- Viewer : remote view -->
<video id="remoteVideo" autoplay></video>

Please refer to the following for the details.

pageWeb - ViewpageAndroid - ViewpageiOS - View

Broadcast Creation

You can create a broadcast using RemonCast's create() function. When the create() function is called, a broadcast channel that allows other users to connect to Remon's media server is created. At this point, a channel is created and returns its channelId, which allows viewers to access it.

// <video id="localVideo" autoplay muted></video>
let myChannelId

const config = {
  credential: {
    serviceId: 'MY_SERVICE_ID',
    key: 'MY_SERVICE_KEY'
  },
  view: {
    local: '#localVideo'
  },
  media: {
    sendonly: true
  }
}

const listener = {
  onCreate(channelId) {
    myChannelId = channelId
  }
}

const caster = new Remon({ listener, config })
caster.createCast()

Broadcast Viewing

RemonCast\'s joinRoom (channelId) function allows you to participate in the broadcast. At this time, it is necessary to inform the channelId of the desired channel. Usually, the user selects through the entire list by referring to the Channel below.

// <video id="remoteVideo" autoplay></video>
let myChannelId

const config = {
  credential: {
    serviceId: 'MY_SERVICE_ID',
    key: 'MY_SERVICE_KEY'
  },
  view: {
    local: '#remoteVideo'
  },
  media: {
    recvonly: true
  }
}

const listener = {
  onJoin() {
    // Do something
  }
}

const viewer = new Remon({ listener, config })
viewer.joinCast('MY_CHANNEL_ID')                  // myChnnelId from caster

Observer

Callbacks are provided to assist in tracking various states during development.

const listener = {
  onInit() {
    // Things to do when remon is initialized, such as UI processing, etc.
  },

  onCreate(channelId) {
    // Broadcast creation and watching preparation is complete
  },

  onJoin() {
    // Start watching
  },

  onClose() {
    // End watching
  }
}

Please refer to the following for more information.

pageCallbacks

Channel

When you create a broadcast, a channel is created with a unique channelId. This channelId allows viewers to access the created broadcast. At this time, the list of all channels being broadcasted can be viewed as follows.

const remonCast = new Remon()
const casts = await remonCast.fetchCasts()

Please refer to the following for more information.

pageChannel

Termination

When all communication is finished, it is necessary to close the RemonCast object with close(). All communication resources and media stream resources are released by close().

const remonCast = new Remon()
remonCast.close()

Settings

If you need more detailed settings when creating or watching a broadcast, please refer to the following.

pageConfig

Last updated