In my android app I have a WebView to display html data from our website. Sometimes the page will have youtube embed objects. This doesn't show up properly in the app. Is there any way to show/play youtube videos in WebView ? Thanks.
You cannot show them embedded except perhaps on devices that have Flash.
However, if you can parse out the YouTube video details, you may be able to construct an ACTION_VIEW
Intent
that will show them on the YouTube application...for those Android devices that have the YouTube application.
You might also experiment with HTML5's <video>
tag, which AFAIK is supported in the Browser application and may therefore work in WebView
.
I came accross this post: link
And indeed, I basically only needed to add to the application manifest xml:
android:hardwareAccelerated="true"
And voila, even the youtube video's started playing
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With