Frage

Found similar but no one seems to respond on this

I have been referring this blog for my development. I was able to play mp4 videos without any trouble when they were in R.raw. When I moved them to the expansion files Im getting issues with the playing.

Can any one tell me what Im I missing here?

Logcat :

05-08 18:45:23.602: E/MediaPlayer(11452): prepareAsync called in state 1
05-08 18:45:23.602: W/dalvikvm(11452): threadid=1: thread exiting with uncaught exception (group=0×41172390)
05-08 18:45:23.622: E/AndroidRuntime(11452): FATAL EXCEPTION: main
05-08 18:45:23.622: E/AndroidRuntime(11452): java.lang.IllegalStateException
05-08 18:45:23.622: E/AndroidRuntime(11452): at android.media.MediaPlayer._prepareAsync(Native Method)
05-08 18:45:23.622: E/AndroidRuntime(11452): at android.media.MediaPlayer.prepareAsync(MediaPlayer.java:1283)
05-08 18:45:23.622: E/AndroidRuntime(11452): at android.widget.VideoView.openVideo(VideoView.java:239)
05-08 18:45:23.622: E/AndroidRuntime(11452): at android.widget.VideoView.setVideoURI(VideoView.java:197)
05-08 18:45:23.622: E/AndroidRuntime(11452): at android.widget.VideoView.setVideoURI(VideoView.java:187)
05-08 18:45:23.622: E/AndroidRuntime(11452): at rmm.android.app.VideoPlayerActivity.playVideo(VideoPlayerActivity.java:307)
05-08 18:45:23.622: E/AndroidRuntime(11452): at rmm.android.app.VideoPlayerActivity.onClick(VideoPlayerActivity.java:475)
05-08 18:45:23.622: E/AndroidRuntime(11452): at android.view.View.performClick(View.java:4102)
05-08 18:45:23.622: E/AndroidRuntime(11452): at android.view.View$PerformClick.run(View.java:17085)
05-08 18:45:23.622: E/AndroidRuntime(11452): at android.os.Handler.handleCallback(Handler.java:615)

Thanks in advance

Happy coding!

War es hilfreich?

Lösung

The problem was with the .obb file. After a lot of browsing and trials I found that actual reason for this Exception.

What I was doing:

  1. Create a zip file by clicking the folder with videos (Via Compress option when you right click on the folder in Ubuntu)
  2. Rename the .zip file to .obb
  3. Push this obb file to mnt/sdcard/Android/obb/package_name_folder

What I was supposed be do:

  1. Create the .obb file using the Jobb tool from Android tool (Android/tools/jobb)
  2. Repeat the step 3
  3. Done !

Creating .obb file : $ jobb -d /temp/assets/ -o my-app-assets.obb -k secret-key -pn com.my.app.package -pv 11

And finally, use ObbExpansionsManager to access the files

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top