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.
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 --><videoid="localVideo"autoplaymuted></video>
With Interface Builder, set your view. If you have set up your preferences according to iOS - Getting Started, you have already registered your View. If you have not done yet, please refer to the following.
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.
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.
viewer =RemonCast.builder().serviceId("MY_SERVICE_ID").key("MY_SERVICE_KEY").context(ViewerActivity.this).remoteView(surfRendererRemote) // remote video renderer.build();viewer.onJoin(() -> {});viewer.join("MY_CHANNEL_ID"); // myChid from caster
remonCast.join(myChannelId)// myChannelId from caster
Or you can create it without Interface Builder as follows.
let viewer =RemonCast()viewer.serviceId ="MY_SERVICE_ID"viewer.key ="MY_SERVICE_KEY"viewer.remoteView = remoteViewviewer.onJoin {// Do something}viewer.join("MY_CHANNEL_ID")// myChannelId from caster
// myChannelId from caster[remonCast joinWithChId:myChannelId AndConfig:nil];
Or you can create it without Interface Builder as follows.
Callbacks are provided to assist in tracking various states during development.
constlistener= {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 }}
remonCast =RemonCast.builder().build();remonCast.onInit(() -> {// Things to do when remon is initialized, such as UI processing, etc.});remonCast.onCreate((channelId) -> {// Broadcast creation and watching preparation is complete});remonCast.onJoin(() -> {// Start watching});remonCast.onClose(() -> {// End watching});
let remonCast =RemonCast()remonCast.onInit {// Things to do when remon is initialized, such as UI processing, etc.}remonCast.onCreate { (channelId) in// Broadcast creation and watching preparation is complete}remonCast.onJoin {// Start watching}remonCast.onClose {// End watching}
RemonCast *caster = [[RemonCast alloc]init];
[caster onInitWithBlock:^{
// Things to do when remon is initialized, such as UI processing, etc.
}];
[caster onCreateWithBlock:^(NSString * _Nullable chId) {
// Broadcast creation and watching preparation is complete
}];
[caster onJoinWithBlock:^(NSString * _Nullable chId) {
// Start watching
}];
[caster onCloseWithBlock:^{
// End watching
}];
Please refer to the following for more information.
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.
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().