Question

I have an Android app that plays MP4 files using the VideoView. The videos are pulled from a remote server and provided to the VideoView object using the .setVideoURI() method. They are Baseline encoded and play fine when I provide the setVideoURI method with a direct link to the mp4 file. However, I need to find a way to make it work using the ColdFusion cfcontent tag. At the moment, I have the cfcontent tag set up as follows

<cfcontent type="video/mp4" file="full path to my mp4 file" deleteFile="no">

This works fine in a browser, however when I try to provide a link to my CFM page as the URI for the setVideoURI method, it comes back with the MediaPlayer Error (1, -2147483648) and also shows the same error for the VideoView. I'ved tried adding cfheader tags prior to the cfcontent to force the type as video/mp4, but with no success.

11-14 15:05:18.162: E/MediaPlayer(373): error (1, -2147483648)
11-14 15:05:18.162: E/MediaPlayer(373): Error (1,-2147483648)
11-14 15:05:18.162: D/VideoView(373): Error: 1,-2147483648

Has anyone had success playing MP4 files in a Android VideoView using a ColdFusion page and the cfcontent tag? Any suggestions are GREATLY appreciated!!!

Thank you!

Was it helpful?

Solution

As it turns out, Android has very specific encoding requirements for MP4, one being that the video must be baseline profile encoded. Refer to http://developer.android.com/guide/appendix/media-formats.html for more information. I re-encoded the video using baseline profile and it worked correctly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top