本文整理匯總了Java中com.twilio.video.LocalVideoTrack.create方法的典型用法代碼示例。如果您正苦於以下問題:Java LocalVideoTrack.create方法的具體用法?Java LocalVideoTrack.create怎麽用?Java LocalVideoTrack.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.twilio.video.LocalVideoTrack
的用法示例。
在下文中一共展示了LocalVideoTrack.create方法的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);
}
}
}
示例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);
}
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
示例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;
}
示例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;
}
示例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();
}
});
}
示例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);
}
示例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);
}
示例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);
}
}