Discussion Forums  >  WebViews and HTML for Mobile

Replies: 7    Views: 98

Crown Solutions
Aspiring developer
Profile
Posts: 463
Reg: Nov 11, 2011
MN
13,480
12/07/12 10:28 PM (11 years ago)

Videos within HTML in Android

I have embedded several videos (via iframe url) within some HTML and it works perfectly in iOS, but Android, it does not load. I tried adding webchromeclient to the custom URL screen (where I am loading the HTML from) and now I get audio and the controls work, but no video? It looks like you should turn on hardware acceleration when you do this so I added it to the manifest at the application level. In order for it to work though, I had to raise my API level to 3.0 so it would see the resource. After all that, it did not help. Still no video??? Am I missing something simple, and hacking up code for no reason?
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
12/08/12 08:18 AM (11 years ago)
Hey Crown Solutions, Android can be a pain with loading and playing videos. I am working on a plugin for video playing with Android. LA
 
Crown Solutions
Aspiring developer
Profile
Posts: 463
Reg: Nov 11, 2011
MN
13,480
like
12/08/12 08:51 AM (11 years ago)
Nice! From everything I can find, there is no answer for every version of Android. There seems to be a variety of options, but they address different versions on different devices. I might have to settle for a href link to youtube... ugly but I am not sure of another way. Going to hack up WebView a little more to see what I can do, but when there are lots of questions on stackoverflow about something and no definitive answer I get a little worried.
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
12/08/12 09:05 AM (11 years ago)
Have you got a href link to work for youtube? I know there has been problems there too unless you go thru a third party. LA
 
Crown Solutions
Aspiring developer
Profile
Posts: 463
Reg: Nov 11, 2011
MN
13,480
like
12/08/12 12:08 PM (11 years ago)
Nope, cant even get that to work. Man this is really getting to me. Did a bunch more research and found that even Google says there is no good way to do this. There has to be a way to load the youtube app through Java, but now I am trying to load native code through an HTML interface. If video wasn't such a big part of this app I would just punt, but I guess the plus side is I am learning a lot more about Android and Java. Going to try and add a layer of a VideoView, but I may need SCUBA gear because this crap is way over my head.
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
12/08/12 12:51 PM (11 years ago)
Yes this can be frustrating so hopefully my plugin will get in after the new year. LA
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
12/10/12 06:44 PM (11 years ago)
@Crown Solutions: Totally feel your pain! I've not tried to load video in iFrame in Android. I'll look into this and report to this thread .....
 
Crown Solutions
Aspiring developer
Profile
Posts: 463
Reg: Nov 11, 2011
MN
13,480
like
12/10/12 06:51 PM (11 years ago)
Thanks David! BTW- you missed out, we had 13+ inches of snow yesterday.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.