本文整理汇总了Java中com.twilio.video.RoomState类的典型用法代码示例。如果您正苦于以下问题:Java RoomState类的具体用法?Java RoomState怎么用?Java RoomState使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RoomState类属于com.twilio.video包,在下文中一共展示了RoomState类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDestroy
import com.twilio.video.RoomState; //导入依赖的package包/类
@Override
protected void onDestroy() {
/*
* Always disconnect from the room before leaving the Activity to
* ensure any memory allocated to the Room resource is freed.
*/
if (room != null && room.getState() != RoomState.DISCONNECTED) {
room.disconnect();
disconnectedFromOnDestroy = true;
}
/*
* Release the local audio and video tracks ensuring any memory allocated to audio
* or video is freed.
*/
if (localAudioTrack != null) {
localAudioTrack.release();
localAudioTrack = null;
}
if (localVideoTrack != null) {
localVideoTrack.release();
localVideoTrack = null;
}
super.onDestroy();
}
示例2: onBackPressed
import com.twilio.video.RoomState; //导入依赖的package包/类
@Override
public void onBackPressed() {
//Connected....ROOM
if (room != null && room.getState().equals(RoomState.CONNECTED)) {
alertDialog = Dialog.createCloseSessionDialog(new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Log.i(TAG, "onBackPressed cancel do nothing.. ");
}
}, closeSessionListener(), this);
alertDialog.show();
} else if (room != null && !room.getState().equals(RoomState.CONNECTED)) {
//DO nothing....
} else {
super.onBackPressed();
}
}
示例3: onHostDestroy
import com.twilio.video.RoomState; //导入依赖的package包/类
@Override
public void onHostDestroy() {
/*
* Always disconnect from the room before leaving the Activity to
* ensure any memory allocated to the Room resource is freed.
*/
if (room != null && room.getState() != RoomState.DISCONNECTED) {
room.disconnect();
disconnectedFromOnDestroy = true;
}
/*
* Release the local media ensuring any memory allocated to audio or video is freed.
*/
if (localVideoTrack != null) {
localVideoTrack.release();
localVideoTrack = null;
}
if (localAudioTrack != null) {
localAudioTrack.release();
localAudioTrack = null;
}
}
示例4: onDestroy
import com.twilio.video.RoomState; //导入依赖的package包/类
@Override
protected void onDestroy() {
/*
* Always disconnect from the room before leaving the Activity to
* ensure any memory allocated to the Room resource is freed.
*/
if (room != null && room.getState() != RoomState.DISCONNECTED) {
room.disconnect();
disconnectedFromOnDestroy = true;
}
/*
* Release the local audio and video tracks ensuring any memory allocated to audio
* or video is freed.
*/
if (localAudioTrack != null) {
localAudioTrack.release();
localAudioTrack = null;
}
if (localVideoTrack != null) {
localVideoTrack.release();
localVideoTrack = null;
}
if (mediaPlayer != null) {
mediaPlayer.stop();
mediaPlayer.release();
}
LocalBroadcastManager.getInstance(this).unregisterReceiver(applozicBroadCastReceiver);
super.onDestroy();
setOpenStatus(false);
}
示例5: registerForNotificationBroadcast
import com.twilio.video.RoomState; //导入依赖的package包/类
public void registerForNotificationBroadcast() {
applozicBroadCastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String incomingCallId = intent.getStringExtra(VideoCallNotificationHelper.CALL_ID);
boolean isNotificationForSameId = false;
Log.i(TAG, "incomingCallId: " + incomingCallId + ", intent.getAction(): " + intent.getAction());
if (CONNECTIVITY_CHANGE.equals(intent.getAction())) {
if (!Utils.isInternetAvailable(context)) {
Toast.makeText(context, R.string.no_network_connectivity, Toast.LENGTH_LONG);
if (room != null && room.getState().equals(RoomState.CONNECTED)) {
room.disconnect();
}
}
return;
}
if (!TextUtils.isEmpty(callId)) {
isNotificationForSameId = (callId.equals(incomingCallId));
}
// //
// if (MobiComKitConstants.APPLOZIC_VIDEO_CALL_ANSWER.equals(intent.getAction()) && isNotificationForSameId) {
// answered = true;
// sendInvite();
// } else
if ((MobiComKitConstants.APPLOZIC_VIDEO_CALL_REJECTED.equals(intent.getAction()) ||
VideoCallNotificationHelper.CALL_CANCELED.equals(intent.getAction()) ||
VideoCallNotificationHelper.CALL_MISSED.equals(intent.getAction()) ||
VideoCallNotificationHelper.CALL_END.equals(intent.getAction()))
&& isNotificationForSameId) {
Toast.makeText(context, R.string.participant_busy, Toast.LENGTH_LONG).show();
hideProgress();
if (room != null) {
inviteSent = false;
room.disconnect();
}
} else if (MobiComKitConstants.APPLOZIC_VIDEO_DIALED.equals(intent.getAction())) {
String contactId = intent.getStringExtra("CONTACT_ID");
if (!contactId.equals(contactToCall.getUserId()) || (room != null && room.getState().equals(RoomState.CONNECTED))) {
Contact contact = contactService.getContactById(contactId);
videoCallNotificationHelper.sendVideoCallReject(contact, incomingCallId);
return;
}
callId = incomingCallId;
connectToRoom(callId);
}
}
};
}