Add Below Code into your MainActivity.java file.
@Override
protected void onCreate(Bundle savedInstanceState)
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
try {
setContentView(R.layout.videodisplay);
String link="http://s1133.photobucket.com/albums/m590/Anniebabycupcakez/?action=view& current=1376992942447_242.mp4";
VideoView videoView = (VideoView) findViewById(R.id.VideoView);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
Uri video = Uri.parse(link);
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
} catch (Exception e) {
// TODO: handle exception
Toast.makeText(this, "Error connecting", Toast.LENGTH_SHORT).show();
}
}
Enjoy :-)
Don’t forget to provide feedback or follow this blog, if you find this blog is useful.
@Override
protected void onCreate(Bundle savedInstanceState)
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
try {
setContentView(R.layout.videodisplay);
String link="http://s1133.photobucket.com/albums/m590/Anniebabycupcakez/?action=view& current=1376992942447_242.mp4";
VideoView videoView = (VideoView) findViewById(R.id.VideoView);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
Uri video = Uri.parse(link);
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
} catch (Exception e) {
// TODO: handle exception
Toast.makeText(this, "Error connecting", Toast.LENGTH_SHORT).show();
}
}
Enjoy :-)
Don’t forget to provide feedback or follow this blog, if you find this blog is useful.
could u plz post main.xml file
ReplyDeletehi, how to play a youtube url(video) in a webview..?
ReplyDelete07-23 16:05:16.765: E/On item click url(23046):
ReplyDelete07-23 16:05:16.820: I/VideoView(23046): start()
07-23 16:05:16.828: D/VideoView(23046): onMeasure()
07-23 16:05:16.828: I/VideoView(23046): Setting size: 240x282
07-23 16:05:16.828: D/VideoView(23046): onMeasure()
07-23 16:05:16.828: I/VideoView(23046): Setting size: 240x282
07-23 16:05:16.890: I/MediaPlayer(23046): path is null
07-23 16:05:16.890: D/MediaPlayer(23046): Couldn't open file on client side, trying server side
07-23 16:05:16.906: E/MediaPlayer(23046): error (1, -2147483648)
07-23 16:05:16.953: E/MediaPlayer(23046): Error (1,-2147483648)
07-23 16:05:16.953: D/VideoView(23046): Error: 1,-2147483648
07-23 16:05:16.953: D/VideoView(23046): onMeasure()
07-23 16:05:16.953: I/VideoView(23046): Setting size: 240x282
07-23 16:05:16.953: D/VideoView(23046): onMeasure()
07-23 16:05:16.953: I/VideoView(23046): Setting size: 240x282
This showing what can i do ?
video not playing, Error- can't play this video
ReplyDeleteThe video is removed in the link!!! Try a different link and it'll work
ReplyDeletehow to start this video from specific point
ReplyDeleteyou need API Key for play video in youtube link.use this http://www.itcuties.com/android/play-youtube-video/ for more information..
ReplyDeleteGetting Error as : MediaPlayer﹕ Couldn't open file on client side, trying server side
ReplyDeletevideo not playing, Error- can't play this video
ReplyDeleteI find a professional yet easy to play mp4 on android
ReplyDeleteathttp://www.avdshare.com/play-mp4-on-android
I am beginner for android... my code is working good when i placed video in raw folder... then i have tried to play a video from Mobile phone sdcard so how can i set my sdcard path ??? please help me guys..
ReplyDeleteif you need answer please email me
Deletetabbasam.malik25@gmail.com
tnx man! how can i record this streaming video in my sd card?
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteI find a article that introduces how to solve can't play MP4 on Android
ReplyDeletehttps://www.idealshare.net/video-converter/play-mp4-on-android.html
After have a test, it also helps to play MKV, FLV, MOV, WMV, AVI, AVCHD, MXF, WTV, RMVB, TS, etc on Andriod.
We are the best online Academic Writing Assistance around, and you will not have to worry about submitting an assignment that has been written in the wrong context.
ReplyDeleteboom beach diamond hack
ReplyDeleteBoom Beach Hack 2018 Unlimited Gold, Wood, Stones, Iron and Diamonds Online Resources Generator
The system is cost effective in the way it utilizes hardware facilities. assignment expert
ReplyDelete