當前位置: 首頁>>代碼示例>>Java>>正文


Java LocalVideoTrack類代碼示例

本文整理匯總了Java中com.twilio.video.LocalVideoTrack的典型用法代碼示例。如果您正苦於以下問題:Java LocalVideoTrack類的具體用法?Java LocalVideoTrack怎麽用?Java LocalVideoTrack使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


LocalVideoTrack類屬於com.twilio.video包,在下文中一共展示了LocalVideoTrack類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onResume

import com.twilio.video.LocalVideoTrack; //導入依賴的package包/類
@Override
protected  void onResume() {
    super.onResume();
    /*
     * If the local video track was released when the app was put in the background, recreate.
     */
    if (localVideoTrack == null && checkPermissionForCameraAndMicrophone()) {
        localVideoTrack = LocalVideoTrack.create(this, true, cameraCapturerCompat.getVideoCapturer());
        localVideoTrack.addRenderer(localVideoView);

        /*
         * If connected to a Room then share the local video track.
         */
        if (localParticipant != null) {
            localParticipant.addVideoTrack(localVideoTrack);
        }
    }
}
 
開發者ID:twilio,項目名稱:video-quickstart-android,代碼行數:19,代碼來源:VideoActivity.java

示例2: onResume

import com.twilio.video.LocalVideoTrack; //導入依賴的package包/類
@Override
protected  void onResume() {
    super.onResume();
    registerReceiver();
    /*
     * If the local video track was released when the app was put in the background, recreate.
     */
    if (localVideoTrack == null &&
            checkPermissionForCameraAndMicrophone() &&
            cameraCapturer != null) {
        localVideoTrack = LocalVideoTrack.create(this, true, cameraCapturer);
        localVideoTrack.addRenderer(localVideoView);

        /*
         * If connected to a Room then share the local video track.
         */
        if (localParticipant != null) {
            localParticipant.addVideoTrack(localVideoTrack);
        }
    }
}
 
開發者ID:twilio,項目名稱:video-quickstart-android,代碼行數:22,代碼來源:VideoInviteActivity.java

示例3: createAudioAndVideoTracks

import com.twilio.video.LocalVideoTrack; //導入依賴的package包/類
protected void createAudioAndVideoTracks() {
    try {
        // Share your microphone
        localAudioTrack = LocalAudioTrack.create(this, true);
        // Share your camera
        cameraCapturer = new CameraCapturer(this, CameraCapturer.CameraSource.FRONT_CAMERA);
        localVideoTrack = LocalVideoTrack.create(this, true, cameraCapturer);
        primaryVideoView.setMirror(true);
        if (videoCall) {
            localVideoTrack.addRenderer(primaryVideoView);
            localVideoView = primaryVideoView;
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
開發者ID:AppLozic,項目名稱:Applozic-Android-Chat-Sample,代碼行數:17,代碼來源:AudioCallActivityV2.java

示例4: onResume

import com.twilio.video.LocalVideoTrack; //導入依賴的package包/類
@Override
protected void onResume() {
    super.onResume();
    /*
     * If the local video track was released when the app was put in the background, recreate.
     */
    try {
        if (videoCall) {
            if (localVideoTrack == null && checkPermissionForCameraAndMicrophone()) {
                localVideoTrack = LocalVideoTrack.create(this, true, cameraCapturer);
                localVideoTrack.addRenderer(localVideoView);

        /*
         * If connected to a Room then share the local video track.
         */
                if (localParticipant != null && localVideoTrack != null) {
                    localParticipant.addVideoTrack(localVideoTrack);
                }
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
開發者ID:AppLozic,項目名稱:Applozic-Android-Chat-Sample,代碼行數:25,代碼來源:AudioCallActivityV2.java

示例5: startScreenCapture

import com.twilio.video.LocalVideoTrack; //導入依賴的package包/類
private void startScreenCapture() {
    screenVideoTrack = LocalVideoTrack.create(this, true, screenCapturer);
    screenCaptureMenuItem.setIcon(R.drawable.ic_stop_screen_share_white_24dp);
    screenCaptureMenuItem.setTitle(R.string.stop_screen_share);

    localVideoView.setVisibility(View.VISIBLE);
    screenVideoTrack.addRenderer(localVideoView);
}
 
開發者ID:twilio,項目名稱:video-quickstart-android,代碼行數:9,代碼來源:ScreenCapturerActivity.java

示例6: createAudioAndVideoTracks

import com.twilio.video.LocalVideoTrack; //導入依賴的package包/類
private void createAudioAndVideoTracks() {
    // Share your microphone
    localAudioTrack = LocalAudioTrack.create(this, true);

    // Share your camera
    cameraCapturerCompat = new CameraCapturerCompat(this, getAvailableCameraSource());
    localVideoTrack = LocalVideoTrack.create(this, true, cameraCapturerCompat.getVideoCapturer());
    primaryVideoView.setMirror(true);
    localVideoTrack.addRenderer(primaryVideoView);
    localVideoView = primaryVideoView;
}
 
開發者ID:twilio,項目名稱:video-quickstart-android,代碼行數:12,代碼來源:VideoActivity.java

示例7: createLocalTracks

import com.twilio.video.LocalVideoTrack; //導入依賴的package包/類
private void createLocalTracks() {
    // Share your microphone
    localAudioTrack = LocalAudioTrack.create(this, true);

    // Share your camera
    cameraCapturer = new CameraCapturer(this, getAvailableCameraSource());
    localVideoTrack = LocalVideoTrack.create(this, true, cameraCapturer);
    primaryVideoView.setMirror(true);
    localVideoTrack.addRenderer(primaryVideoView);
    localVideoView = primaryVideoView;
}
 
開發者ID:twilio,項目名稱:video-quickstart-android,代碼行數:12,代碼來源:VideoInviteActivity.java

示例8: addVideo

import com.twilio.video.LocalVideoTrack; //導入依賴的package包/類
private void addVideo() {
    localVideoTrack = LocalVideoTrack.create(this, true, new CameraCapturer(this,
            CameraCapturer.CameraSource.FRONT_CAMERA, null));
    snapshotVideoRenderer = new SnapshotVideoRenderer(snapshotImageView);
    localVideoTrack.addRenderer(localVideoView);
    localVideoTrack.addRenderer(snapshotVideoRenderer);
    localVideoView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            tapForSnapshotTextView.setVisibility(View.GONE);
            snapshotVideoRenderer.takeSnapshot();
        }
    });
}
 
開發者ID:twilio,項目名稱:video-quickstart-android,代碼行數:15,代碼來源:CustomRendererVideoActivity.java

示例9: onCreate

import com.twilio.video.LocalVideoTrack; //導入依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_custom_capturer);

    capturedView = (LinearLayout) findViewById(R.id.captured_view);
    videoView = (VideoView) findViewById(R.id.video_view);
    timerView = (Chronometer) findViewById(R.id.timer_view);
    timerView.start();

    // Once added we should see our linear layout rendered live below
    localVideoTrack = LocalVideoTrack.create(this, true, new ViewCapturer(capturedView));
    localVideoTrack.addRenderer(videoView);
}
 
開發者ID:twilio,項目名稱:video-quickstart-android,代碼行數:15,代碼來源:CustomCapturerVideoActivity.java

示例10: addCameraVideo

import com.twilio.video.LocalVideoTrack; //導入依賴的package包/類
private void addCameraVideo() {
    cameraCapturer = new CameraCapturer(this, CameraCapturer.CameraSource.BACK_CAMERA);
    localVideoTrack = LocalVideoTrack.create(this, true, cameraCapturer);
    localVideoTrack.addRenderer(videoView);
    toggleFlashButton.setOnClickListener(toggleFlashButtonClickListener);
    takePictureButton.setOnClickListener(takePictureButtonClickListener);
}
 
開發者ID:twilio,項目名稱:video-quickstart-android,代碼行數:8,代碼來源:AdvancedCameraCapturerActivity.java

示例11: onHostResume

import com.twilio.video.LocalVideoTrack; //導入依賴的package包/類
@Override
public void onHostResume() {
    /*
     * In case it wasn't set.
     */
    if (themedReactContext.getCurrentActivity() != null) {
        /*
        * If the local video track was released when the app was put in the background, recreate.
        */
        if (cameraCapturer != null && localVideoTrack == null) {
            localVideoTrack = LocalVideoTrack.create(getContext(), true, cameraCapturer, buildVideoConstraints());
        }

        if (localVideoTrack != null) {
            if (thumbnailVideoView != null) {
                localVideoTrack.addRenderer(thumbnailVideoView);
            }

            /*
            * If connected to a Room then share the local video track.
            */
            if (localParticipant != null) {
                localParticipant.addVideoTrack(localVideoTrack);
            }
        }

        themedReactContext.getCurrentActivity().setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);

    }
}
 
開發者ID:blackuy,項目名稱:react-native-twilio-video-webrtc,代碼行數:31,代碼來源:CustomTwilioVideoView.java


注:本文中的com.twilio.video.LocalVideoTrack類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。