Play Video

I'm downloading a file from a FTP server to the External Storage Directory and I'm saving a video file on it. This part is running fine, but when I try to play the video, a message "cannot play video" is shown. The video formats I tried to play were ".wmv" and ".mp4".

Here is my code (is a testing code only):

try
{
string path = Path.Combine(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath, "cman");
string fileName = "VINHETA.mp4";

if (!Directory.Exists(path))
    Directory.CreateDirectory(path);

if (!File.Exists(Path.Combine(path, fileName)))
    FTPHandle.DonwloadFile(fileName, path);

Android.Net.Uri uri = Android.Net.Uri.Parse(Path.Combine(path, fileName));
videoView.SetVideoURI(uri);
videoView.Start();

}
catch (Exception)
{

}

Thank you.

Regards,

Igor Guerra

Posts

  • CheesebaronCheesebaron DKInsider, University mod

    Are you trying this in the Emulator?

  • IgorGuerraIgorGuerra BRMember

    Yes. May this be the problem?

  • CheesebaronCheesebaron DKInsider, University mod

    The Emulators Video Playback capabilities are very limited. If you get video to play back it will be very slow and choppy. Try it on a device instead.

  • IgorGuerraIgorGuerra BRMember

    Actually I saw this on the help files, but the problem is that the video file is not even being played. I'll try on the device and get back to you.

    Thanks a lot Cheesebaron.

  • IgorGuerraIgorGuerra BRMember

    Cheesebaron, on the device it worked fine! Thanks a lot.

Sign In or Register to comment.