【发布时间】:2015-05-04 17:30:01
【问题描述】:
我正在使用 AbsoluteLayout 定位 VideoView(我需要将它显示在屏幕中特定位置的多个位置)。
public void showVideo(RectF bounds, final String videoUrl) {
AbsoluteLayout.LayoutParams params = (AbsoluteLayout.LayoutParams) video.getLayoutParams();
params.width = (int) bounds.width();
params.height = (int) bounds.height();
params.x = (int) bounds.left;
params.y = (int) bounds.top;
video.requestLayout();
video.setVisibility(View.VISIBLE);
video.setFocusable(true);
video.setFocusableInTouchMode(true);
video.requestFocus();
File file = new File(videoUrl);
video.setVideoPath(file.getAbsolutePath());
video.start();
}
但视频没有调整到我指定的范围。
有什么建议吗?
另一个相关的问题是,如何让 MediaController 显示在 VideoView 上?
【问题讨论】:
-
您需要调整视频而不是视图的大小。尝试为此找到一些视频编辑器库
标签: android android-video-player