To view the communication, the viewer must connect the view in which the actual video is drawn. Register the Local View to see himself/herself, and register the Remote View to make the other.
<!-- local view --><videoid="localVideo"autoplaymuted></video><!-- remote view --><videoid="remoteVideo"autoplay></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 communication using RemonCast's connectChannel() function. When the connectChannel() function is called, a 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 the other to access it.
caller =RemonCall.builder().serviceId("MY_SERVICE_ID").key("MY_SERVICE_KEY").context(CallActivity.this).localView(surfRendererLocal).remoteView(surfRendererRemote).build();caller.onConnect((channelId) -> { myChannelId = channelId // Callee need chid from Caller for connect});caller.onComplete(() -> {// Caller-Callee connect each other. Do something});caller.connect();
let caller = RemonCall()
caller.onConnect { (channelId) in
let myChannelId = channelId // Callee need channelId from Caller for connect
}
caller.onComplete {
// Caller-Callee connect each other. Do something
}
caller.connect()
RemonCall *caller = [[RemonCall alloc] init];[caller onConnectWithBlock:^(NSString * _Nullable channelId) {// Callee need channelId from Caller for connect [self setMyChannelId:channelId];}];[caller onCompleteWithBlock:^{// Caller-Callee connect each other. Do something}];[caller connect:chId :nil];
Get a call
RemonCall's connectChannel(channelId) function allows you to participate in the communication. At this time, it is necessary to inform the channelId of the desired channel.
callee =RemonCall.builder().serviceId("MY_SERVICE_ID").key("MY_SERVICE_KEY").context(CallActivity.this).localView(surfRendererLocal).remoteView(surfRendererRemote).build();callee.onComplete(() -> {// Caller-Callee connect each other. Do something});callee.connect("MY_CHANNEL_ID");
let callee =RemonCall()callee.onComplete {// Caller-Callee connect each other. Do something}callee.connect("MY_CHANNEL_ID")
RemonCall *callee = [[RemonCall alloc] init];[callee onCompleteWithBlock:^{// Caller-Callee connect each other. Do something}];[callee connect:chId :nil];
Callbacks
Callbacks are provided to assist in tracking various states during development.
constlistener= {onInit(token) {// Things to do when remon is initialized, such as UI processing, etc. }, onConnect(channelId) {// Make a call then wait the callee },onComplete() {// Start between Caller and Callee }, onClose() {// End calling }}
remonCall =RemonCall.builder().build();remonCall.onInit((token) -> {// Things to do when remon is initialized, such as UI processing, etc.});remonCall.onConnect((channelId) -> {// Make a call then wait the callee});remonCall.onComplete(() -> {// Start between Caller and Callee});remonCall.onClose(() -> {// End calling});
let remonCall =RemonCall()remonCall.onInit { (token) in// Things to do when remon is initialized, such as UI processing, etc.}remonCall.onConnect { (channelId) in// Make a call then wait the callee}remonCall.onComplete {// Start between Caller and Callee}remonCast.onClose {// End calling}
RemonCall *remonCall = [[RemonCall alloc] init];
[remonCall onInitWithBlock:^{
// Things to do when remon is initialized, such as UI processing, etc.
}];
[remonCallter onConnectWithBlock:^(NSString * _Nullable chId) {
// Make a call then wait the callee
}];
[remonCall onCompleteWithBlock:^{
// Start between Caller and Callee
}];
[remonCall onCloseWithBlock:^{
// End calling
}];
Please refer to the following for more information.
When you create a communication, a channel is created with a unique channelId. This channelId allows the other to access the created communication. At this time, the list of all channels being communication can be viewed as follows.
When all communication is finished, it is necessary to close the RemonCall object with close(). All communication resources and media stream resources are released by close().