当前位置: 首页>>代码示例>>Java>>正文


Java RtcEngine.create方法代码示例

本文整理汇总了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;
}
 
开发者ID:AgoraIO,项目名称:OpenVoiceCall-Android,代码行数:20,代码来源:WorkerThread.java

示例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;
}
 
开发者ID:AgoraIO,项目名称:OpenVideoCall-Android,代码行数:21,代码来源:WorkerThread.java

示例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;
}
 
开发者ID:AgoraIO,项目名称:OpenLive-Android,代码行数:21,代码来源:WorkerThread.java

示例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;
}
 
开发者ID:huangjingqiang,项目名称:SWDemo,代码行数:20,代码来源:WorkerThread.java

示例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);
}
 
开发者ID:AgoraIO,项目名称:Agora-Video-Source-Android,代码行数:11,代码来源:VideoChatViewActivity.java

示例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;
}
 
开发者ID:wzc25151,项目名称:lrs_android,代码行数:15,代码来源:WorkerThread.java

示例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));
    }
}
 
开发者ID:AgoraIO,项目名称:Agora-Android-Voice-Tutorial-1to1,代码行数:10,代码来源:VoiceChatViewActivity.java

示例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();
}
 
开发者ID:umdk,项目名称:UCDLive_Android,代码行数:15,代码来源:MediaManager.java


注:本文中的io.agora.rtc.RtcEngine.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。