3import android.content.Context;
4import android.content.res.TypedArray;
5import android.os.Build;
6import android.util.AttributeSet;
7import android.view.View;
8import android.widget.FrameLayout;
10import us.zoom.internal.video.BaseSDKVideoView;
11import us.zoom.internal.video.SDKVideoRender;
12import us.zoom.internal.video.SDKVideoSurfaceView;
13import us.zoom.internal.video.SDKVideoTextureView;
14import us.zoom.internal.video.SDKVideoUnitMgr;
15import us.zoom.internal.video.ZPGLSurfaceView;
16import us.zoom.internal.video.ZPGLTextureView;
17import us.zoom.videomeetings.R;
53 this.renderTextureView = isRenderTextureView;
54 init(context, isRenderTextureView);
64 this.renderTextureView = isRenderTextureView;
66 init(context, isRenderTextureView);
70 super(context, attrs);
75 private void initAttr(Context context, AttributeSet attrs) {
76 TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.ZoomVideoSDKVideoView);
77 renderTextureView = typedArray.getBoolean(R.styleable.ZoomVideoSDKVideoView_render_textureView,
false);
78 translucent = typedArray.getBoolean(R.styleable.ZoomVideoSDKVideoView_render_translucent,
true);
83 super(context, attrs, defStyle);
89 private void init(Context context,
boolean isRenderTextureView) {
90 if (isRenderTextureView) {
104 SDKVideoSurfaceView videoSurfaceView = (SDKVideoSurfaceView)
mVideoView;
106 FrameLayout.LayoutParams lp =
new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
107 videoSurfaceView.setLayoutParams(lp);
108 }
else if (
mVideoView instanceof ZPGLTextureView) {
109 SDKVideoTextureView videoSurfaceView = (SDKVideoTextureView)
mVideoView;
110 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
111 videoSurfaceView.setPreserveEGLContextOnPause(
true);
113 FrameLayout.LayoutParams lp =
new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
114 videoSurfaceView.setLayoutParams(lp);
135 SDKVideoSurfaceView videoSurfaceView = (SDKVideoSurfaceView)
mVideoView;
136 videoSurfaceView.setZOrderMediaOverlay(isMediaOverlay);
159 SDKVideoSurfaceView videoSurfaceView = (SDKVideoSurfaceView)
mVideoView;
160 videoSurfaceView.setZOrderOnTop(onTop);
172 SDKVideoUnitMgr.getInstance().switchToLevel(level, x, y);
Zoom Video SDK video canvas view.
boolean translucent
use translucent for video rendering
void init(Context context, boolean isRenderTextureView)
void setZOrderMediaOverlay(boolean isMediaOverlay)
See https://developer.android.com/reference/android/view/SurfaceView
BaseSDKVideoView mVideoView
ZoomVideoSDKVideoView(Context context, boolean isRenderTextureView, boolean translucent)
void switchToLevel(float level, float x, float y)
Zoom In/out for share.
ZoomVideoSDKVideoView(Context context, AttributeSet attrs)
ZoomVideoSDKVideoView(Context context, AttributeSet attrs, int defStyle)
ZoomVideoSDKVideoView(Context context)
SDKVideoRender mVideoRender
void setZOrderOnTop(boolean onTop)
See https://developer.android.com/reference/android/view/SurfaceView
void initAttr(Context context, AttributeSet attrs)
ZoomVideoSDKVideoView(Context context, boolean isRenderTextureView)
boolean renderTextureView
use SurfaceView for performance ,use TextureView for ui animation.