Video SDK for Android API Reference
Loading...
Searching...
No Matches
ZoomVideoSDKCameraShareView.java
Go to the documentation of this file.
1package us.zoom.sdk;
2
3import androidx.annotation.AttrRes;
4import androidx.annotation.Nullable;
5import android.content.Context;
6import android.content.res.TypedArray;
7import android.util.AttributeSet;
8import android.widget.FrameLayout;
9import android.widget.ImageView;
10
11import androidx.annotation.NonNull;
12
13import us.zoom.videomeetings.R;
14
15public class ZoomVideoSDKCameraShareView extends FrameLayout {
16
20 protected boolean renderTextureView = false;
21
22 @NonNull
24
25 @NonNull
26 private ImageView mImageView;
27
28 public ZoomVideoSDKCameraShareView(@NonNull Context context) {
29 super(context);
30 initView(context);
31 }
32
33 public ZoomVideoSDKCameraShareView(@NonNull Context context, @Nullable AttributeSet attrs) {
34 super(context, attrs);
35 initAttr(context, attrs);
36 initView(context);
37 }
38
39 public ZoomVideoSDKCameraShareView(@NonNull Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr) {
40 super(context, attrs, defStyleAttr);
41 initAttr(context, attrs);
42 initView(context);
43 }
44
45 private void initView(@NonNull Context context) {
47 mImageView = new ImageView(context);
48 mVideoView.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
49 mImageView.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
50 this.addView(mVideoView);
51 this.addView(mImageView);
52 mVideoView.setVisibility(GONE);
53 mImageView.setVisibility(GONE);
54 }
55
56 private void initAttr(Context context, AttributeSet attrs) {
57 TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.ZoomVideoSDKVideoView);
58 renderTextureView = typedArray.getBoolean(R.styleable.ZoomVideoSDKVideoView_render_textureView, false);
59 typedArray.recycle();
60 }
61
62 @NonNull
64 return mVideoView;
65 }
66
67 @NonNull
68 public ImageView getImageView() {
69 return mImageView;
70 }
71
72 public void showVideoView() {
73 mVideoView.setVisibility(VISIBLE);
74 }
75
76 public void hideVideoView() {
77 mVideoView.setVisibility(GONE);
78 }
79
80 public void showImageView() {
81 mImageView.setVisibility(VISIBLE);
82 }
83
84 public void hideImageView() {
85 mImageView.setVisibility(GONE);
86 }
87}
ZoomVideoSDKCameraShareView(@NonNull Context context, @Nullable AttributeSet attrs)
void initAttr(Context context, AttributeSet attrs)
boolean renderTextureView
use SurfaceView for performance ,use TextureView for ui animation.
ZoomVideoSDKCameraShareView(@NonNull Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr)
Zoom Video SDK video canvas view.