Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

播放器默认获取了焦点,在TV项目上不是很友好 #1268

Open
uni-cstar opened this issue Sep 28, 2021 · 0 comments
Open

播放器默认获取了焦点,在TV项目上不是很友好 #1268

uni-cstar opened this issue Sep 28, 2021 · 0 comments

Comments

@uni-cstar
Copy link

//其中PLBaseVideoView中初始化的时候默认获取了焦点
protected void initVideoView(Context context) {
        this.mRenderView = this.getRenderView();
        this.mRenderView.setRenderCallback(this.mRenderCallback);
        LayoutParams lp = new LayoutParams(-1, -1, 17);
        this.mRenderView.getView().setLayoutParams(lp);
        this.addView(this.mRenderView.getView());
        this.setFocusable(true);
        this.setFocusableInTouchMode(true);
        this.requestFocus();
        this.mTargetState = PlayerState.IDLE;
    }

上述代码在播放器初始化的时候,内部默认获取了焦点,导致在TV开发中出现焦点预期以外的事情,比如用户当前默认选中一个按钮,此时banner中使用了播放器,播放器初始化默认获取了焦点,这个焦点行为并没有经过用户操作,感觉不是很友好。

看得出这个行为的意图跟videoview的行为相似,也就是获取焦点之后响应遥控器按键行为,显示或隐藏控制栏。但这个设计总感觉有点先入为主,如果非全屏下的播放器使用,这个行为是很迷惑人的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant