禁用视频控件ACTION_VIEW [英] disabling video controls in ACTION_VIEW
问题描述
喜我的问题是要禁用或不显示视频控件如果我使用ACTION_VIEW任何视频。我是否需要为意向指定任何额外还是有实现这一目标的任何适当的方式
Hi My Question is want to disable or not to show the video controls if i use ACTION_VIEW for any videos. Do i need to specify any extras for Intent or is there any proper way to achieve this
下面是code,以供参考。
below is the code for reference
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(appnamesArray[arg2]));
任何样品链接或code可以帮助我很多
Any Sample links or code helps me a lot
由于提前
编辑:
我的理解是这样ACTION_VIEW控件进入播放器启动后的默认播放器或用户选择的球员和意图无法控制的隐藏它,我用videoview显示从URL中的视频
As i understood that action_view starts the default player or user selected player so the controls goes to player and intent has no control to hide it for that i used videoview to show the video from url
VideoView videoView = (VideoView) new VideoView(getApplicationContext());
MediaController mediaController = new MediaController(MainActivity.this);
mediaController.setAnchorView(videoView);
Uri video = Uri.parse(appnamesArray[arg2]);
videoView.setMediaController(null);
videoView.setVideoURI(video);
videoView.start();
setContentView(videoView);
请更新我,如果任何一个可以能够通过执行ACTION_VIEW本身成功这个
please update me if any one can able to succeed this by doing the ACTION_VIEW itself
推荐答案
如果您使用的视图意图
将有选项可以打开视频
在所有支持它的玩家。所以,即使一些球员支持隐藏控件等可能不会。
If you use the view intent
it will have option to open video
in all the players that support it. So even if some of the players support hiding controls other might not.
最好的解决办法是让自己的视频查看
Best solution is to have your own video view.
这篇关于禁用视频控件ACTION_VIEW的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!