Youtube embed videos not working in webview. What's wrong with this code?

后端 未结 5 1460
故里飘歌
故里飘歌 2021-02-03 11:47

I am new to android. I am facing two problems right now 1. I parsed xml file and showed it in webview which contains videos and text . When i click on videos

5条回答
  •  滥情空心
    2021-02-03 12:32

    have you tested your app in actual device? Because the videos which are embedded like this i.e. iFrame are taking more time to get loaded. In my case, same thing was happening then I changed the webview settings to,

    getSettings().setPluginsEnabled(true);
    

    but after that it was not working on emulator and in device it was loading so I thought its not working but just today I tried the same thing and it was working fine with my surprise. So you just need to add this line of code.

    Second thing is that only those videos which are embedded in iframe tag are supported by enabling plugins to true.

提交回复
热议问题