Reza
Reza

Reputation: 63

VideoView vs WebView for playing youtube videos

I'm developing an application in which I need to play YouTube videos, I tried using webView and videoView, and I searched around a lot, I actually found some solutions, but they seem not to fit into my application needs:

So I want to know in the first place, the best way (approach) to the issue of playing a YouTube video inside an app. Should I use WebView and try to make the video fit the view and extra, or should I try VideoView (which is a little bit more complicated I guess, cause to be able to play videos I have to get the actual .3gp from Youtube).

Well thanks for helping me find the best approach.

MeanWhile I have got another question: is there a way to make the webView take the whole screen (full screen) on landscape mode (when the phone becomes landscape)?

Upvotes: 4

Views: 1676

Answers (1)

HandlerExploit
HandlerExploit

Reputation: 8251

Using the WebView approach can cause problems on some devices. The VideoView approach will work well as long as you have a solid way to parse the correct url. In one of my applications we do this using regex and parsing through the html, so far it works fast and efficiently.

Upvotes: 2

Related Questions