本文整理汇总了Java中io.agora.rtc.RtcEngine.create方法的典型用法代码示例。如果您正苦于以下问题:Java RtcEngine.create方法的具体用法?Java RtcEngine.create怎么用?Java RtcEngine.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.agora.rtc.RtcEngine
的用法示例。
在下文中一共展示了RtcEngine.create方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ensureRtcEngineReadyLock
import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
private RtcEngine ensureRtcEngineReadyLock() {
if (mRtcEngine == null) {
String appId = mContext.getString(R.string.private_app_id);
if (TextUtils.isEmpty(appId)) {
throw new RuntimeException("NEED TO use your App ID, get your own ID at https://dashboard.agora.io/");
}
try {
mRtcEngine = RtcEngine.create(mContext, appId, mEngineEventHandler.mRtcEventHandler);
} catch (Exception e) {
log.error(Log.getStackTraceString(e));
throw new RuntimeException("NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e));
}
mRtcEngine.setChannelProfile(Constants.CHANNEL_PROFILE_COMMUNICATION);
mRtcEngine.enableAudioVolumeIndication(200, 3); // 200 ms
mRtcEngine.setLogFile(Environment.getExternalStorageDirectory()
+ File.separator + mContext.getPackageName() + "/log/agora-rtc.log");
}
return mRtcEngine;
}
示例2: ensureRtcEngineReadyLock
import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
private RtcEngine ensureRtcEngineReadyLock() {
if (mRtcEngine == null) {
String appId = mContext.getString(R.string.private_app_id);
if (TextUtils.isEmpty(appId)) {
throw new RuntimeException("NEED TO use your App ID, get your own ID at https://dashboard.agora.io/");
}
try {
mRtcEngine = RtcEngine.create(mContext, appId, mEngineEventHandler.mRtcEventHandler);
} catch (Exception e) {
log.error(Log.getStackTraceString(e));
throw new RuntimeException("NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e));
}
mRtcEngine.setChannelProfile(Constants.CHANNEL_PROFILE_COMMUNICATION);
mRtcEngine.enableVideo();
mRtcEngine.enableAudioVolumeIndication(200, 3); // 200 ms
mRtcEngine.setLogFile(Environment.getExternalStorageDirectory()
+ File.separator + mContext.getPackageName() + "/log/agora-rtc.log");
}
return mRtcEngine;
}
示例3: ensureRtcEngineReadyLock
import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
private RtcEngine ensureRtcEngineReadyLock() {
if (mRtcEngine == null) {
String appId = mContext.getString(R.string.private_app_id);
if (TextUtils.isEmpty(appId)) {
throw new RuntimeException("NEED TO use your App ID, get your own ID at https://dashboard.agora.io/");
}
try {
mRtcEngine = RtcEngine.create(mContext, appId, mEngineEventHandler.mRtcEventHandler);
} catch (Exception e) {
log.error(Log.getStackTraceString(e));
throw new RuntimeException("NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e));
}
mRtcEngine.setChannelProfile(Constants.CHANNEL_PROFILE_LIVE_BROADCASTING);
mRtcEngine.enableVideo();
mRtcEngine.setLogFile(Environment.getExternalStorageDirectory()
+ File.separator + mContext.getPackageName() + "/log/agora-rtc.log");
mRtcEngine.enableDualStreamMode(true);
}
return mRtcEngine;
}
示例4: ensureRtcEngineReadyLock
import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
private RtcEngine ensureRtcEngineReadyLock() {
if (mRtcEngine == null) {
String appId = mContext.getString(R.string.private_app_id);
if (TextUtils.isEmpty(appId)) {
throw new RuntimeException("NEED TO use your App ID, get your own ID at https://dashboard.agora.io/");
}
mRtcEngine = RtcEngine.create(mContext, appId, mEngineEventHandler.mRtcEventHandler);
if (isLive) {
mRtcEngine.setChannelProfile(Constants.CHANNEL_PROFILE_LIVE_BROADCASTING);
} else {
mRtcEngine.setChannelProfile(Constants.CHANNEL_PROFILE_COMMUNICATION);
}
mRtcEngine.enableVideo();
mRtcEngine.enableAudioVolumeIndication(200, 3); // 200 ms
mRtcEngine.setLogFile(Environment.getExternalStorageDirectory()
+ File.separator + mContext.getPackageName() + "/log/agora-rtc.log");
}
return mRtcEngine;
}
示例5: initializeAgoraEngine
import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
private void initializeAgoraEngine() {
try {
mRtcEngine = RtcEngine.create(getBaseContext(), getString(R.string.agora_app_id), mRtcEventHandler);
} catch (Exception e) {
Log.e(LOG_TAG, Log.getStackTraceString(e));
throw new RuntimeException("NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e));
}
mRtcEngine.setChannelProfile(Constants.CHANNEL_PROFILE_LIVE_BROADCASTING);
}
示例6: ensureRtcEngineReadyLock
import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
private RtcEngine ensureRtcEngineReadyLock() {
if (mRtcEngine == null) {
String appId = mContext.getString(R.string.private_app_id);
if (TextUtils.isEmpty(appId)) {
throw new RuntimeException("NEED TO use your App ID, get your own ID at https://dashboard.agora.io/");
}
mRtcEngine = RtcEngine.create(mContext, appId, mEngineEventHandler.mRtcEventHandler);
mRtcEngine.setChannelProfile(Constants.CHANNEL_PROFILE_COMMUNICATION);
mRtcEngine.enableAudioVolumeIndication(200, 3); // 200 ms
mRtcEngine.setLogFile(Environment.getExternalStorageDirectory()
+ File.separator + mContext.getPackageName() + "/log/agora-rtc.log");
}
return mRtcEngine;
}
示例7: initializeAgoraEngine
import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
private void initializeAgoraEngine() {
try {
mRtcEngine = RtcEngine.create(getBaseContext(), getString(R.string.agora_app_id), mRtcEventHandler);
} catch (Exception e) {
Log.e(LOG_TAG, Log.getStackTraceString(e));
throw new RuntimeException("NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e));
}
}
示例8: init
import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
private void init() {
String appId = context.getString(R.string.app_id);
if (TextUtils.isEmpty(appId)) {
Log.e(TAG, "Please set your app_id to strings.app_id");
return;
}
Log.d(TAG, "init " + appId + ", sdk version:" + RtcEngine.getSdkVersion());
rtcEngine = RtcEngine.create(context, appId, this);
videoSource = new AgoraVideoSource(); // define main class for customize video source
videoSource.Attach();
rtcEngine.enableVideo();
}