Log in or register to post comments

Video Playback with split build

December 4, 2013 - 4:24am #1

Hi, I need to split android binary when video files are big, but the video playback doesn't work with video files from expansion pack (obb).

 

Any solution please?

Video Playback with split build

December 13, 2014 - 4:35am #8

Is there are any changes considering this topic? I have a problem similar to kayler one, my application uses a lot of videos, which I don't want to duplicate from obb-file to user storage.

Video Playback with split build

December 5, 2013 - 3:56am #7

I think, the solution is to use a "file descriptor" in android MediaPlayer to open files from obb file.

 

Android Mediaplayer documentation:

public void setDataSource (FileDescriptor fd)

Added in API level 1

Sets the data source (FileDescriptor) to use. It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns.

Parameters

fd

the FileDescriptor for the file you want to play

Throws

IllegalStateException

if it is called in an invalid state

IOException

 

IllegalArgumentException

 

Video Playback with split build

December 4, 2013 - 9:30am #6

we are not releasing the source code for the videop plugin part;  so, I don't see many easy  options other than following the workaround I described below, although this may consume some extra space on the external storage of the device.

But I also invite you to post this request (releasing Java source code for videoplayback) in out Forum wish list:

https://developer.vuforia.com/forum/general-discussion/wish-list

Video Playback with split build

December 4, 2013 - 5:04am #5

Sorry, yes i use unity plugin

Video Playback with split build

December 4, 2013 - 5:02am #4

Unfortunately, this native code of vuforia video playback is compiled (i don't have the source code.

Ok. So, are you using Unity ?

Video Playback with split build

December 4, 2013 - 5:00am #3

Thank you Alessandro but, my video size is 360MB and if i extract from obb file, my app size grows to more than 700MB!!

I know the android mediaplayer can read directly from obb, but with a filedescriptor. Unfortunately, this native code of vuforia video playback is compiled (i don't have the source code.

Video Playback with split build

December 4, 2013 - 4:51am #2

Hi, typically what you need to do to handle OBB content is to:

  • Read the expansion file (OBB file) from the external storage location, e.g. your SD card (where the .obb file is supposed to be placed when the app is downloaded and installed)
  • Extract the video files (or other files that you are interested in) that have been packaged inside the .obb expansion file
  • Save the extracted files onto another directory on your external storage (this directory must be different from the one where the obb expansion file is stored)

Once your video file is stored on your SD card as per step 3 above, then you can make your code to load the video from that path.

See also:

http://developer.android.com/google/play/expansion-files.html

 

Log in or register to post comments