can't find video files with media.playVideo in enterprise...

Hiya,

We’ve purchased corona enterprise to add our own ad API’s to our corona game, however, after building the game with the ad API’s we couldn’t get our video’s to show up. After checking LogCat we’re still at a loss because it states that medo.playVideo can’t find the specified files. We’ve checked if the video’s are compiled into the APK by unzipping it and indeed, they’re included.

Does anyone happen to know what could be wrong?

This is likely an issue with your “AndroidManifest.xml” file.  Inside that file, there is a <provider> tag which allows the video player to access your APK’s asset files.  Notice that we have an XML comment above it stating exactly this.  You’ll need to make sure that its “authorities” attribute is using your app’s package name as follows…

\<provider android:name="com.ansca.corona.FileContentProvider" android:authorities="\<YourPackageName\>.files" /\>

Have a look at all of our sample projects’ AndroidManifest.xml files and see how the above provider is set up.  That should get it working for you.

Thanks for your reply, Joshua!

Unfortunately we’ve already changed and double-checked the namespaces in the manifest, and it seems like the authorities option also has everything correctly set up. Still, when looking at logcat, the MediaPlayer gives the same error and returns the namespace from the manifest.

After grabbing the example project and playing a video in there it seems to work! Seems like I just need to reset the settings files and double-check everything…

I just tested this now with our “SimpleLuaExtensions” sample app by adding an *.m4v file and playing it via our media.playVideo() API.  It worked for me.

Are you sure you have Corona’s “com.ansca.corona.VideoActivity” tag in your AndroidManifest.xml file?

Also, is your video file located in your “Corona” project directory?

Because when you do an Android SDK build, Corona pre-build step will copy it to the app’s “assets” directory where Corona will access the file via Android’s AssetManager class.  That is, the video file should not be placed in your Android project’s “res” directory.

Other than that, I’m running out of ideas here.

This is likely an issue with your “AndroidManifest.xml” file.  Inside that file, there is a <provider> tag which allows the video player to access your APK’s asset files.  Notice that we have an XML comment above it stating exactly this.  You’ll need to make sure that its “authorities” attribute is using your app’s package name as follows…

\<provider android:name="com.ansca.corona.FileContentProvider" android:authorities="\<YourPackageName\>.files" /\>

Have a look at all of our sample projects’ AndroidManifest.xml files and see how the above provider is set up.  That should get it working for you.

Thanks for your reply, Joshua!

Unfortunately we’ve already changed and double-checked the namespaces in the manifest, and it seems like the authorities option also has everything correctly set up. Still, when looking at logcat, the MediaPlayer gives the same error and returns the namespace from the manifest.

After grabbing the example project and playing a video in there it seems to work! Seems like I just need to reset the settings files and double-check everything…

I just tested this now with our “SimpleLuaExtensions” sample app by adding an *.m4v file and playing it via our media.playVideo() API.  It worked for me.

Are you sure you have Corona’s “com.ansca.corona.VideoActivity” tag in your AndroidManifest.xml file?

Also, is your video file located in your “Corona” project directory?

Because when you do an Android SDK build, Corona pre-build step will copy it to the app’s “assets” directory where Corona will access the file via Android’s AssetManager class.  That is, the video file should not be placed in your Android project’s “res” directory.

Other than that, I’m running out of ideas here.