disabling video controls in ACTION_VIEW

2019-08-29 01:40发布

问题:

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

below is the code for reference

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(appnamesArray[arg2]));

Any Sample links or code helps me a lot

Thanks in Advance

EDIT:

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);

please update me if any one can able to succeed this by doing the ACTION_VIEW itself

回答1:

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.