How to embed a YouTube clip in a WebView on Android

后端 未结 3 849
庸人自扰
庸人自扰 2020-11-30 10:19

Can anyone shed any light on why I\'m unable to click and play a youtube clip on an Android handset when placed inside a webview?

I\'ve put a very simple app togethe

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-30 10:52

    Unless the user has Froyo this is going to be impossible. However as long as the user has the YouTube app installed (which is standard for most phones I believe) then you can include a link to the YouTube video, and Android will recognize it as such and open it using the YouTube app. It's not as elegant as embedding, but it's much more reliable.

提交回复
热议问题