How to play Video in Webview via a in Android? -



How to play Video in Webview via a <iframe> in Android? -

i need play youtube video in webview, link video nowadays in tag. when run application, pic(thumbnail) comes in place play icon on it, , after clicking on it, shows black screen seekbar on @ 00:00 time, , loading symbol on it, nil happens or shown. remains there day.

i using emulator 4.4 android.

my code follows:-

webview content = (webview)findviewbyid(r.id.webview1); string html="<html><body>some text goes here<br>" + "<iframe src=\"//www.youtube.com/embed/eu9kmies0wq?rel=0\" height=\"360\" width=\"640\" allowfullscreen=\"\" frameborder=\"0\"/></iframe></body></html>"; content.getsettings().setpluginstate(pluginstate.on_demand); content.getsettings().setjavascriptenabled(true); content.getsettings().setallowfileaccess(true); content.setwebchromeclient(new webchromeclient()); content.setwebviewclient(new webviewclient()); content.loaddatawithbaseurl("somestringforbaseurl", html, "text/html", "utf-8", "");

i had included

android:hardwareaccelerated="true"> in manifest.

do need add together api's youtube or other thing. or sort of error commencing? help appreciated. in advance.

well fine, , video running nice , fast. well, emulator requires flash player installed, whereas code makes videos playable on android devices. if needs source code, can utilize 1 above running videos in webview via tag on android.

android iframe webview android-youtube-api

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -