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


Java RtcEngine.CreateRendererView方法代码示例

本文整理汇总了Java中io.agora.rtc.RtcEngine.CreateRendererView方法的典型用法代码示例。如果您正苦于以下问题:Java RtcEngine.CreateRendererView方法的具体用法?Java RtcEngine.CreateRendererView怎么用?Java RtcEngine.CreateRendererView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.agora.rtc.RtcEngine的用法示例。


在下文中一共展示了RtcEngine.CreateRendererView方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initUIandEvent

import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
@Override
protected void initUIandEvent() {
    event().addEventHandler(this);

    Intent i = getIntent();
    int cRole = i.getIntExtra(ConstantApp.ACTION_KEY_CROLE, 0);

    if (cRole == 0) {
        throw new RuntimeException("Should not reach here");
    }

    String roomName = i.getStringExtra(ConstantApp.ACTION_KEY_ROOM_NAME);

    doConfigEngine(cRole);

    mGridVideoViewContainer = (GridVideoViewContainer) findViewById(R.id.grid_video_view_container);
    mGridVideoViewContainer.setItemEventHandler(new VideoViewEventListener() {
        @Override
        public void onItemDoubleClick(View v, Object item) {
            log.debug("onItemDoubleClick " + v + " " + item);

            if (mUidsList.size() < 2) {
                return;
            }

            if (mViewType == VIEW_TYPE_DEFAULT)
                switchToSmallVideoView(((VideoStatusData) item).mUid);
            else
                switchToDefaultVideoView();
        }
    });

    ImageView button1 = (ImageView) findViewById(R.id.btn_1);
    ImageView button2 = (ImageView) findViewById(R.id.btn_2);
    ImageView button3 = (ImageView) findViewById(R.id.btn_3);

    if (isBroadcaster(cRole)) {
        SurfaceView surfaceV = RtcEngine.CreateRendererView(getApplicationContext());
        rtcEngine().setupLocalVideo(new VideoCanvas(surfaceV, VideoCanvas.RENDER_MODE_HIDDEN, 0));
        surfaceV.setZOrderOnTop(true);
        surfaceV.setZOrderMediaOverlay(true);

        mUidsList.put(0, surfaceV); // get first surface view

        mGridVideoViewContainer.initViewContainer(getApplicationContext(), 0, mUidsList); // first is now full view
        worker().preview(true, surfaceV, 0);
        broadcasterUI(button1, button2, button3);
    } else {
        audienceUI(button1, button2, button3);
    }

    worker().joinChannel(roomName, config().mUid);

    TextView textRoomName = (TextView) findViewById(R.id.room_name);
    textRoomName.setText(roomName);
}
 
开发者ID:AgoraIO,项目名称:OpenLive-Android,代码行数:57,代码来源:LiveRoomActivity.java

示例2: setupRemoteVideo

import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
private void setupRemoteVideo(int uid) {
    FrameLayout container = (FrameLayout) findViewById(R.id.remote_video_view_container);

    if (container.getChildCount() >= 1) {
        return;
    }

    SurfaceView surfaceView = RtcEngine.CreateRendererView(getBaseContext());
    container.addView(surfaceView);
    mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_ADAPTIVE, uid));
    surfaceView.setTag(uid); // for mark purpose
    View tipMsg = findViewById(R.id.quick_tips_when_use_agora_sdk); // optional UI
    tipMsg.setVisibility(View.GONE);
}
 
开发者ID:AgoraIO,项目名称:Agora-Video-Source-Android,代码行数:15,代码来源:VideoChatViewActivity.java

示例3: setupLocalVideo

import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
private void setupLocalVideo() {
    FrameLayout container = findViewById(R.id.local_video_view_container);
    SurfaceView surfaceView = RtcEngine.CreateRendererView(getBaseContext());
    surfaceView.setZOrderMediaOverlay(true);
    container.addView(surfaceView);
    mRtcEngine.setupLocalVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_ADAPTIVE, 0));
}
 
开发者ID:AgoraIO,项目名称:Agora-Picture-in-Picture-Android,代码行数:8,代码来源:VideoChatViewActivity.java

示例4: setupRemoteVideo

import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
private void setupRemoteVideo(int uid) {
    FrameLayout container = findViewById(R.id.remote_video_view_container);

    if (container.getChildCount() >= 1) {
        return;
    }

    SurfaceView surfaceView = RtcEngine.CreateRendererView(getBaseContext());
    container.addView(surfaceView);
    mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_ADAPTIVE, uid));

    surfaceView.setTag(uid); // for mark purpose
    View tipMsg = findViewById(R.id.quick_tips_when_use_agora_sdk); // optional UI
    tipMsg.setVisibility(View.GONE);
}
 
开发者ID:AgoraIO,项目名称:Agora-Picture-in-Picture-Android,代码行数:16,代码来源:VideoChatViewActivity.java

示例5: setupLocalVideo

import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
private void setupLocalVideo() {
    FrameLayout container = (FrameLayout) findViewById(R.id.local_video_view_container);
    SurfaceView surfaceView = RtcEngine.CreateRendererView(getBaseContext());
    surfaceView.setZOrderMediaOverlay(true);
    container.addView(surfaceView);
    mRtcEngine.setupLocalVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_ADAPTIVE, 0));
}
 
开发者ID:AgoraIO,项目名称:Agora-Android-Tutorial-1to1,代码行数:8,代码来源:VideoChatViewActivity.java

示例6: setupRemoteVideo

import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
private void setupRemoteVideo(int uid) {
    FrameLayout container = (FrameLayout) findViewById(R.id.remote_video_view_container);

    if (container.getChildCount() >= 1) {
        return;
    }

    SurfaceView surfaceView = RtcEngine.CreateRendererView(getBaseContext());
    container.addView(surfaceView);
    mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_ADAPTIVE, uid));

    surfaceView.setTag(uid); // for mark purpose
    View tipMsg = findViewById(R.id.quick_tips_when_use_agora_sdk); // optional UI
    tipMsg.setVisibility(View.GONE);
}
 
开发者ID:AgoraIO,项目名称:Agora-Android-Tutorial-1to1,代码行数:16,代码来源:VideoChatViewActivity.java

示例7: initUIandEvent

import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
@Override
protected void initUIandEvent() {
    event().addEventHandler(this);

    Intent i = getIntent();

    String channelName = i.getStringExtra(ConstantApp.ACTION_KEY_CHANNEL_NAME);

    final String encryptionKey = getIntent().getStringExtra(ConstantApp.ACTION_KEY_ENCRYPTION_KEY);
    final String encryptionMode = getIntent().getStringExtra(ConstantApp.ACTION_KEY_ENCRYPTION_MODE);

    doConfigEngine(encryptionKey, encryptionMode);

    mGridVideoViewContainer = (GridVideoViewContainer) findViewById(R.id.grid_video_view_container);
    mGridVideoViewContainer.setItemEventHandler(new VideoViewEventListener() {
        @Override
        public void onItemDoubleClick(View v, Object item) {
            log.debug("onItemDoubleClick " + v + " " + item + " " + mLayoutType);

            if (mUidsList.size() < 2) {
                return;
            }

            UserStatusData user = (UserStatusData) item;
            int uid = (user.mUid == 0) ? config().mUid : user.mUid;

            if (mLayoutType == LAYOUT_TYPE_DEFAULT && mUidsList.size() != 1) {
                switchToSmallVideoView(uid);
            } else {
                switchToDefaultVideoView();
            }
        }
    });

    SurfaceView surfaceV = RtcEngine.CreateRendererView(getApplicationContext());
    rtcEngine().setupLocalVideo(new VideoCanvas(surfaceV, VideoCanvas.RENDER_MODE_HIDDEN, 0));
    surfaceV.setZOrderOnTop(false);
    surfaceV.setZOrderMediaOverlay(false);

    mUidsList.put(0, surfaceV); // get first surface view

    mGridVideoViewContainer.initViewContainer(this, 0, mUidsList, mIsLandscape); // first is now full view
    worker().preview(true, surfaceV, 0);

    worker().joinChannel(channelName, config().mUid);

    TextView textChannelName = (TextView) findViewById(R.id.channel_name);
    textChannelName.setText(channelName);

    optional();

    LinearLayout bottomContainer = (LinearLayout) findViewById(R.id.bottom_container);
    FrameLayout.MarginLayoutParams fmp = (FrameLayout.MarginLayoutParams) bottomContainer.getLayoutParams();
    fmp.bottomMargin = virtualKeyHeight() + 16;

    initMessageList();
}
 
开发者ID:AgoraIO,项目名称:OpenVideoCall-Android,代码行数:58,代码来源:ChatActivity.java

示例8: initUIandEvent

import io.agora.rtc.RtcEngine; //导入方法依赖的package包/类
@Override
protected void initUIandEvent() {
    event().addEventHandler(this);

    Intent i = getIntent();

    String channelName = i.getStringExtra(ConstantApp.ACTION_KEY_CHANNEL_NAME);

    final String encryptionKey = getIntent().getStringExtra(ConstantApp.ACTION_KEY_ENCRYPTION_KEY);

    final String encryptionMode = getIntent().getStringExtra(ConstantApp.ACTION_KEY_ENCRYPTION_MODE);

    doConfigEngine(encryptionKey, encryptionMode);

    mGridVideoViewContainer = (GridVideoViewContainer) findViewById(R.id.grid_video_view_container);
    mGridVideoViewContainer.setItemEventHandler(new VideoViewEventListener() {
        @Override
        public void onItemDoubleClick(View v, Object item) {
            log.debug("onItemDoubleClick " + v + " " + item + " " + mLayoutType);

            if (mUidsList.size() < 2) {
                return;
            }

            UserStatusData user = (UserStatusData) item;
            int uid = (user.mUid == 0) ? config().mUid : user.mUid;

            if (mLayoutType == LAYOUT_TYPE_DEFAULT && mUidsList.size() != 1) {
                switchToSmallVideoView(uid);
            } else {
                switchToDefaultVideoView();
            }
        }
    });

    SurfaceView surfaceV = RtcEngine.CreateRendererView(getApplicationContext());
    rtcEngine().setupLocalVideo(new VideoCanvas(surfaceV, VideoCanvas.RENDER_MODE_HIDDEN, 0));
    surfaceV.setZOrderOnTop(false);
    surfaceV.setZOrderMediaOverlay(false);

    mUidsList.put(0, surfaceV); // get first surface view

    mGridVideoViewContainer.initViewContainer(getApplicationContext(), 0, mUidsList); // first is now full view
    worker().preview(true, surfaceV, 0);
    config().mUid = AGApplication.uid;
    String channelKey = AGApplication.channelKey;
    worker().joinChannel(channelName, config().mUid,channelKey);

    TextView textChannelName = (TextView) findViewById(R.id.channel_name);
    textChannelName.setText(channelName);

    optional();

    LinearLayout bottomContainer = (LinearLayout) findViewById(R.id.bottom_container);
    FrameLayout.MarginLayoutParams fmp = (FrameLayout.MarginLayoutParams) bottomContainer.getLayoutParams();
    fmp.bottomMargin = virtualKeyHeight() + 16;

    initMessageList();
}
 
开发者ID:huangjingqiang,项目名称:SWDemo,代码行数:60,代码来源:ChatActivity.java


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