Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

黑边的问题总结 #1204

Closed
lipangit opened this issue Sep 5, 2017 · 6 comments
Closed

黑边的问题总结 #1204

lipangit opened this issue Sep 5, 2017 · 6 comments

Comments

@lipangit
Copy link
Owner

lipangit commented Sep 5, 2017

如果视频的高宽比例和屏幕的高宽比例不一致,肯定会有黑边的。

如果非要去掉黑边,一种方法是指定视频的的比例和容器的比例一致,比如16:9 或 4:3。另一种方法复写onVideoSizeChanged函数,放大textureView的大小

@lipangit lipangit changed the title 黑屏的问题总结 黑边的问题总结 Sep 5, 2017
@keaitao0321
Copy link

@OverRide
public void onVideoSizeChanged() {
//super.onVideoSizeChanged();
if (JCMediaManager.textureView != null) {
JCMediaManager.textureView.setVideoSize(new Point(textureViewContainer.getWidth(),textureViewContainer.getHeight()));//视频大小与控件大小一致
}
}

我是这样解决的,好像没什么问题.

@lipangit
Copy link
Owner Author

上面的是通过修改容器的高宽
也可以修改容器内的视频的高宽,参考demo的ActivityApiRotationVideoSize,可以旋转和铺满

@fredsun
Copy link

fredsun commented Jul 21, 2018

但是如果设置了

JZVideoPlayer.setVideoImageDisplayType(JZVideoPlayer.VIDEO_IMAGE_DISPLAY_TYPE_FILL_SCROP);

或者 VIDEO_IMAGE_DISPLAY_TYPE_FILL_PARENT

在点击全屏后反而会充满整个屏幕,
所以是否有接口监听到全屏模式的开启?可以在全屏下设置为VIDEO_IMAGE_DISPLAY_TYPE_ORIGINAL

@lipangit
Copy link
Owner Author

JZVideoPlayer.setVideoImageDisplayType这个函数随时设置随时生效

你可以继承JZVideoPlayerStandard,复写onClick函数,监听全屏的点击。参考demo的MYJZVideoPlayerStandard。

@yixiu30
Copy link

yixiu30 commented Aug 2, 2019

@OverRide
public void onVideoSizeChanged() {
//super.onVideoSizeChanged();
if (JCMediaManager.textureView != null) {
JCMediaManager.textureView.setVideoSize(new Point(textureViewContainer.getWidth(),textureViewContainer.getHeight()));//视频大小与控件大小一致
}
}
我也是调用了这个没有用诶

@lipangit
Copy link
Owner Author

lipangit commented Aug 3, 2019

@yixiu30 demo中生效吗

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

No branches or pull requests

4 participants