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;
48 this.renderTextureView = isRenderTextureView;
49 init(context, isRenderTextureView);
53 super(context, attrs);
58 private void initAttr(Context context, AttributeSet attrs) {
59 TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.ZoomVideoSDKVideoView);
60 renderTextureView = typedArray.getBoolean(R.styleable.ZoomVideoSDKVideoView_render_textureView,
false);
65 super(context, attrs, defStyle);
71 private void init(Context context,
boolean isRenderTextureView) {
72 if (isRenderTextureView) {
86 SDKVideoSurfaceView videoSurfaceView = (SDKVideoSurfaceView)
mVideoView;
88 FrameLayout.LayoutParams lp =
new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
89 videoSurfaceView.setLayoutParams(lp);
90 }
else if (
mVideoView instanceof ZPGLTextureView) {
91 SDKVideoTextureView videoSurfaceView = (SDKVideoTextureView)
mVideoView;
92 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
93 videoSurfaceView.setPreserveEGLContextOnPause(
true);
95 FrameLayout.LayoutParams lp =
new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
96 videoSurfaceView.setLayoutParams(lp);
117 SDKVideoSurfaceView videoSurfaceView = (SDKVideoSurfaceView)
mVideoView;
118 videoSurfaceView.setZOrderMediaOverlay(isMediaOverlay);
141 SDKVideoSurfaceView videoSurfaceView = (SDKVideoSurfaceView)
mVideoView;
142 videoSurfaceView.setZOrderOnTop(onTop);
154 SDKVideoUnitMgr.getInstance().switchToLevel(level, x, y);
Zoom Video SDK video canvas view.
void init(Context context, boolean isRenderTextureView)
void setZOrderMediaOverlay(boolean isMediaOverlay)
See https://developer.android.com/reference/android/view/SurfaceView
BaseSDKVideoView mVideoView
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.