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


Java CameraCapturer.CameraSource方法代碼示例

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


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

示例1: switchCameraClickListener

import com.twilio.video.CameraCapturer; //導入方法依賴的package包/類
private View.OnClickListener switchCameraClickListener() {
    return new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            try {
                if (cameraCapturer != null) {
                    CameraCapturer.CameraSource cameraSource = cameraCapturer.getCameraSource();
                    cameraCapturer.switchCamera();
                    if (thumbnailVideoView.getVisibility() == View.VISIBLE) {
                        thumbnailVideoView.setMirror(cameraSource == CameraCapturer.CameraSource.BACK_CAMERA);
                    } else {
                        primaryVideoView.setMirror(cameraSource == CameraCapturer.CameraSource.BACK_CAMERA);
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    };
}
 
開發者ID:AppLozic,項目名稱:Applozic-Android-Chat-Sample,代碼行數:21,代碼來源:VideoActivity.java

示例2: CameraCapturerCompat

import com.twilio.video.CameraCapturer; //導入方法依賴的package包/類
public CameraCapturerCompat(Context context,
                            CameraCapturer.CameraSource cameraSource) {
    if (Camera2Capturer.isSupported(context)) {
        setCameraPairs(context);
        camera2Capturer = new Camera2Capturer(context,
                getCameraId(cameraSource),
                camera2Listener);
    } else {
        camera1Capturer = new CameraCapturer(context, cameraSource);
    }
}
 
開發者ID:twilio,項目名稱:video-quickstart-android,代碼行數:12,代碼來源:CameraCapturerCompat.java

示例3: getCameraSource

import com.twilio.video.CameraCapturer; //導入方法依賴的package包/類
public CameraCapturer.CameraSource getCameraSource() {
    if (usingCamera1()) {
        return camera1Capturer.getCameraSource();
    } else {
        return getCameraSource(camera2Capturer.getCameraId());
    }
}
 
開發者ID:twilio,項目名稱:video-quickstart-android,代碼行數:8,代碼來源:CameraCapturerCompat.java

示例4: switchCamera

import com.twilio.video.CameraCapturer; //導入方法依賴的package包/類
public void switchCamera() {
    if (usingCamera1()) {
        camera1Capturer.switchCamera();
    } else {
        CameraCapturer.CameraSource cameraSource = getCameraSource(camera2Capturer
                .getCameraId());

        if (cameraSource == CameraCapturer.CameraSource.FRONT_CAMERA) {
            camera2Capturer.switchCamera(backCameraPair.second);
        } else {
            camera2Capturer.switchCamera(frontCameraPair.second);
        }
    }
}
 
開發者ID:twilio,項目名稱:video-quickstart-android,代碼行數:15,代碼來源:CameraCapturerCompat.java

示例5: getCameraId

import com.twilio.video.CameraCapturer; //導入方法依賴的package包/類
private String getCameraId(CameraCapturer.CameraSource cameraSource) {
    if (frontCameraPair.first == cameraSource) {
        return frontCameraPair.second;
    } else {
        return backCameraPair.second;
    }
}
 
開發者ID:twilio,項目名稱:video-quickstart-android,代碼行數:8,代碼來源:CameraCapturerCompat.java

示例6: setThumbnailMirror

import com.twilio.video.CameraCapturer; //導入方法依賴的package包/類
private static void setThumbnailMirror() {
    if (cameraCapturer != null) {
        CameraCapturer.CameraSource cameraSource = cameraCapturer.getCameraSource();
        final boolean isBackCamera = (cameraSource == CameraCapturer.CameraSource.BACK_CAMERA);
        if (thumbnailVideoView != null && thumbnailVideoView.getVisibility() == View.VISIBLE) {
            thumbnailVideoView.setMirror(isBackCamera);
        }
    }
}
 
開發者ID:blackuy,項目名稱:react-native-twilio-video-webrtc,代碼行數:10,代碼來源:CustomTwilioVideoView.java

示例7: switchCamera

import com.twilio.video.CameraCapturer; //導入方法依賴的package包/類
public void switchCamera() {
    if (cameraCapturer != null) {
        cameraCapturer.switchCamera();
        setThumbnailMirror();
        CameraCapturer.CameraSource cameraSource = cameraCapturer.getCameraSource();
        final boolean isBackCamera = cameraSource == CameraCapturer.CameraSource.BACK_CAMERA;
        WritableMap event = new WritableNativeMap();
        event.putBoolean("isBackCamera", isBackCamera);
        pushEvent(CustomTwilioVideoView.this, ON_CAMERA_SWITCHED, event);
    }
}
 
開發者ID:blackuy,項目名稱:react-native-twilio-video-webrtc,代碼行數:12,代碼來源:CustomTwilioVideoView.java


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