How to embed Youtube video in Android WebView?

前端 未结 3 1059
广开言路
广开言路 2021-02-02 04:34

I want to embed a youtube video in my Android app. It has a Navigation Drawer, and when this drawer is opened, the video must to keep playing. And I\'d like my app could be capa

3条回答
  •  没有蜡笔的小新
    2021-02-02 05:07

    I think that a similar question that has been asked might be of help to you and might be a good starting point. But the second link I am going to post might be of more help.

    Play Youtube HTML5 embedded Video in Android WebView

    Also, I found on a separate website this comment that might be your magic answer:

    "The custom player you are mentioning most likely uses a rather well-known trick; fooling youtube into providing an MP4-version of that video, download it progressively and serve it back via a local http-server to MPMoviePlayerController.

    The restriction is based on a reverse lookup of the IP address you are using when accessing the video in question. Use a proxy from within the US and you will see that it suddenly plays without any problem." http://w3facility.org/question/embed-youtube-videos-with-contains-content-from-it-is-restricted-from-playback-on-certain-site/

    I hope this helps!!

提交回复
热议问题