moust / phonegap-xapkreader

Cordova plugin to access files in APK Expansion Files
13 stars 17 forks source link

Videos from expansion file do not display using the video tag (source src='object URL returned from XAPKReader') #25

Open robertalibey opened 8 years ago

robertalibey commented 8 years ago

I am running the xapkreader plugin 2.0.0 on Android 4.4 with Cordova 3.6.

Code example: XAPKReader.get("main_expansion/vid/niceVideo.mp4", gotVideo, errorVideo);

function gotVideo(theObjectURL) { //theObjectURL is the objectURL returned by the xapkreaer plugin (something like blob:file%3A...) //just create a video tag that has it's source src set to theObjectURL.
... }

The theObjectURL parameter of gotVideo() is an objectURL like 'blob:file%3A.....". In this scenario, the video does not play.

I also tried modifying XAPKReader.java to return a base64 string to add to source src of the video tag. Something like 'data:video/mp4;base64,blablabla...' .The video does not play in this case either.

I can only get a video to play using the html video tag if source src='a relative path to a video in the Android APK' or an http URL.

Can the objectURL returned by this plugin be used as the source src attribute of the html video tag?