我希望视频播放时像停止视频时间线一样显示MediaController,但不显示这样的显示 如果我尝试了MediaController上下文的问题 getcontext和getActivity但没有用 [![在其他地方显示] [1]] [1]
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == Activity.RESULT_OK && data != null && data.getData() != null) {
try {
String Path = data.getData().toString();
//Video.setVideoPath(Path);
Uri uri = Uri.parse(Path);
Video.setVideoURI(uri);
MediaController mediaController = new
MediaController(getActivity());
Video.setMediaController(mediaController);
mediaController.setAnchorView(Video);
Video.start();
} catch (Exception ex) {
ex.printStackTrace();
}
}
}```
[1]: https://i.stack.imgur.com/FRrr8.png