tineskumar
- Forum posts: 1
Feb 21, 2017, 7:48:23 AM via Website
Feb 21, 2017 7:48:23 AM via Website
Hi i am new here and new for android.. i like to make a video player take video from my php saver and listing all come out from php saver.. i do my code rdy all work fine but i not sure my way is
correct or not
my Code is Here... Plz Help Me
package crazysing.crazyweb.my.fragment;
public void videoView(String filename,String imageName){
String videopath = "video link";
videopath = videopath + filename;
if(imageName == " ") {
videothumbNail.setDefaultImageResId(R.drawable.sing);
videothumbNail.setErrorImageResId(R.drawable.sing);
videothumbNail.setVisibility(View.VISIBLE);
videov.setVisibility(View.INVISIBLE);
Log.d(TAG,"empty vedeio");
}else{
videothumbNail.setImageUrl(imageName, imageLoader);
videothumbNail.setVisibility(View.VISIBLE);
videov.setVisibility(View.INVISIBLE);
try {
Uri uri = Uri.parse(videopath);
videov.setVideoURI(uri);
videov.setMediaController(mediaC);
mediaC.setAnchorView(videov);
videov.start();
videov.setVisibility(View.VISIBLE);
videov.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
videothumbNail.setVisibility(View.GONE);
}
});
} catch (Exception e) {
Log.e("Error", e.getMessage());
e.printStackTrace();
}
}
}
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.