Forum Xamarin.Android

Why is Intent.ActionView throwing an error with an MP4 file.

AlexRutherfordAlexRutherford GBUniversity ✭✭
edited April 2016 in Xamarin.Android

Hi all,

I have been trying to get my local videos (raw folder) to run using Intent.ActionView. When I create the Intent and set a data and type then start the activity I get a error. Please look at the following code & error.

I have tried a load of different ways to get to the file thinking maybe it is not being found but I don't think that is the problem. I have tried different video formats but also I do not think that is the problem.

If I use a URL to a MP4 inside SetDataAndType that will run without an error. Maybe this is a permissions error? At this point I really have no idea. I hope someone will be able to explain the problem I an running into here.

I will attach a basic project (cannot seem to upload a zip with the project, any idea why?) with the code inside that you can run to view the error yourself.

Code:

// Create the intent and push the mp4 to it, lets run a video!
Intent videoIntent = new Intent (Intent.ActionView);

// Video is MP4 format
videoIntent.SetDataAndType (Uri.Parse ("android.resource://" + PackageName + "/raw/bunny"), "video/*");

// Crash here, Error: Android.Content.ActivityNotFoundExeception
StartActivity (videoIntent);

Little bit of the error: Android.Content.ActivityNotFoundException: No Activity found to handle Intent

Note: I cannot post the full error in the post, any idea why that is? (comes up with the whole post blank)

Answers

  • 2coolor2coolor AZMember

    Sorry sir, but this seems to the only related thread about video playback issues. I also met a video playback issue and would you guys mind my asking here and I really need an answer now? Recently I download a software as you can see "videoconverterfactory.com/tips/repair-mp4-file.html" (I hope some experts can help me check it when it's at your convenience) to repair one of my failed MP4 file. The file did not contain audio output so I tried fixing it by converting it to an AVI file. The conversion was successful and there was audio output again. But I did not figure why after conversion, the video size got much bigger, did you ever meet such a kind of issue?

Sign In or Register to comment.