How to embed Youtube video in Android WebView?

前端 未结 3 1058
广开言路
广开言路 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 04:58

    I recently met the same problem and solved it, hope to be helpful.

    It's because this video is not playable on all websites, so if you load a local html, the "Referer" http header is empty, then youtube can't determine if your website is on the banned list. The solution is just put your html on your own web server, then load it through url, then the "Referer" header will be your web server address, problem solved.

提交回复
热议问题