this is my code
mVideoView = (VideoView) findViewById(R.id.videoview);
VideoView videoView = findViewById(R.id.videoview);
// videoPath="https://drive.google.com/open?id=1dXndP-MjQL7USlP0EtaElx67mXujqCSX";
//
Uri uri = Uri.parse(videoPath);
videoView.setVideoURI(uri);
MediaController mediaController = new MediaController(this);
videoView.setMediaController(mediaController);
mediaController.setAnchorView(videoView);
You have to edit the link. Use String functions to edit the text.
so videoPath=
like below:
https://drive.google.com/open?id=1dXndP-MjQL7USlP0EtaElx67mXujqCSX
becomes:
https://drive.google.com/uc?authuser=0&id=1dXndP-MjQL7USlP0EtaElx67mXujqCSX&export=download
Example code:
//# fix path
videoPath = videoPath.replace("open?", "uc?authuser=0&");
videoPath = videoPath + "&export=download";
//# try to play
Uri uri = Uri.parse(videoPath);
videoView.setVideoURI(uri);
MediaController mediaController = new MediaController(this);
videoView.setMediaController(mediaController);
mediaController.setAnchorView(videoView);