VideoView takes longer to start playing videos compared to iOS AVPlayer and WP MediaElement. The last two are almost always instantenous in my case, but VideoView takes anywhere between 5 and 15 seconds to start streaming. Are there any tips and tricks to speed it up? I'm setting up video streaming in a way similar to this: Why is the videoview so slow?
I'm not an Android expert, but I remember reading VideoView internally calls prepare async, so I'm not sure how a separate background task helps. I also noticed YouTube videos on my S6 take longer to open than YouTube on iOS. However, YouTube on S6 is still faster than my naive implementation, so I don't know what I don't know.
Are there any 3rd-party implementations faster than VideoView?
Related
I can load a video from the web. All works fine.
However, when a network connection is slow the video is buffering. So I want to set the quality of video while, streaming it automatically or manually.
I am blank about this.
If I am not mistaken, VideoView only plays the video. Here is the documentation on it, doesn't seem to have that option at all.
I'd suggest you use the youtube API instead if you can.
I have an app which plays a lot of video files. It's been all good on every phone and tablet I've tested on. I just tested on an Acer Chromebook and the first few frames (maybe up to a 1/4 second) are being dropped on all video files, so the video appears to start just slightly beyond 0. Some of the videos have audio that starts immediately and so it's obvious to the user that the video is clipped at the start. I'm wondering if anyone else has seen this issue, maybe on a Chromebook or other device and if there is some simple way to deal with it?
There is absolutely nothing fancy about my code. I'm using VideoView, preload the video with setVideoURI(), then call videoView.start() on a button press.
Thanks!
This problem only appears if I make a call to seek(0). So rather than doing that to replay the video I have to load the video each time it's requested. That workaround resolves the problem.
From documentation: "Adaptive Streaming - Automatically adapts to either congestion or bandwidth availability". But this works only when player starts (I use VideoView). If the intrenet speed falls while playing video - nothing happens but it is preferable that player switch video quality base on curren internte speed. So, questions:
Does android video player supports switching video quality in real time while playing video?
If yes, how to implement this?
Thank you for your attention.
Update:
For example Youtube google tv app. If bandwidth changing while playing video, player automaticaly switches to appropriate video quality without any delays.
What I have to do to make it work? I am using VideoView and it is works only when I start player.
Thank you.
Typically you would implement your own subclass of the VideoView that utilizes some form of QoS to monitor network bandwidth. If you are working on a Google TV application you can use the GtvVideoView (which supports smoothstreaming). To understand more about this you can read up on it here: https://developers.google.com/tv/android/articles/hls?hl=en
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)?
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.
Guys
I am new to android and want to write a simple application that plays a video in android using video view. I have written the code it is working but the view is not clear. It is blurred. What should I do?? Please Help.
Is there any alternative to video view to achieve that...?? I want to play the recorded video from android phones
There are two possibilities. Either the quality of the video might be low or you would have tried it in a emulator. Sometimes it is possible for emulator to have some problems with playing video which I have personally faced. So you have to try it in a real device.
And regarding alternative for videoview, there is no such alternatives available I believe. But still videoview should be simple to play a video.