0

I am using the ffmpeg library to play videos in Android. Video plays well from the SDCard but I would prefer it to play from the assets folder as it is more secure.

Could anyone point me in the right direction?

Clarice Bouwer
  • 3,631
  • 3
  • 32
  • 55
Nagaraju
  • 1
  • 2

2 Answers2

0

Assets are read-only parts of your APK, and there is no way another APK can access these assets. You can use the native Android classes to play the video(s) you embed in your APK (use mp4 format).

If you insist on ffmpeg-assisted playback, you can unpack the asset to private file, or you should write your io handlers for ffmpeg that will use AAsset_read().

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
  • see http://stackoverflow.com/questions/8877494/how-to-load-a-video-filelocated-in-assets-folder-in-ndk/15635160#15635160 or http://stackoverflow.com/questions/3028717/how-to-play-videos-in-android-from-assets-folder-or-raw-folder – Alex Cohn Aug 28 '13 at 11:10
0

As I feel that you want to keep your videos inside application, so to keep things simple, keep your videos in raw folder and play it from there.

Sushil
  • 8,250
  • 3
  • 39
  • 71