6

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).

Ricardo
  • 11,609
  • 8
  • 27
  • 39

2 Answers2

2

PhoneGap does not recognise video tag.

VenomVendor
  • 15,064
  • 13
  • 65
  • 96
  • Thank you. Can you link any source of that info please? – Ricardo May 03 '12 at 11:28
  • 1
    http://simonmacdonald.blogspot.com/2012/02/android-issues-all-phonegap-developers.html?m=1 – VenomVendor May 03 '12 at 11:41
  • Thank you. So as you source explains video tag is no supported in a WebView (not PhoneGap itself). That would be a Google's/Apple's problem, I'll dig more into this and reply later. – Ricardo May 03 '12 at 11:46
  • Calmdown, I though you were just a troll. I'll be digging this, and come back later. Thanks – Ricardo May 03 '12 at 11:47
  • This is Android only, though. It should work just fine on iOS. I have done it many times before. Perhaps it is because the video is in localStorage? – rdougan May 04 '12 at 22:30
  • @rdougan ios and android both use the same webkit browser. – VenomVendor May 05 '12 at 19:10
1

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.

ahren
  • 16,803
  • 5
  • 50
  • 70
JJC2
  • 11
  • 1