Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sencha Touch 2 + PhoneGap + iPad: Video with base64 encoded data: "The Operation could not be completed"

My application (wrapped in PhoneGap) runs both online and offline mode. I store images and videos encoded in base64 in localstorage. When I debug this on browser it runs just fine, but on iPad it shouts out "The operation could not be completed" in a javascript promt.

I've tried placing the video with pure html tag and tru Ext.Video.

I'm missing anything here? Thanks

newhtml += "<video width='320' height='240' controls='controls'> <source src='data:video/mp4;base64,"+tmpStore.getAt(i).data.myPages[j].myProducts[k].myItens[0].fileData+"'  /></video>";

Update:

Tested in iPad and Android 3.0 native browsers and the result is the same "The operation...". Tested with and without autoplay and controllers (in the video/source tags).

like image 365
Ricardo Avatar asked Apr 27 '12 15:04

Ricardo


2 Answers

PhoneGap does not recognise video tag.

like image 121
VenomVendor Avatar answered Oct 14 '22 15:10

VenomVendor


You forgot the TYPE attribute: type="video/mp4" on the source element.

And for some reason on Android it starts working when you make it: src='data:video/mp4;base64,AAAA' [Do not ask why AAAA, I don't know. Found it somewhere and it helped me]

Hope this helps someone.

like image 25
JJC2 Avatar answered Oct 14 '22 15:10

JJC2