Hi I'm developing an application that uses Android MediaPlayer to play a background video usually of 30 seconds length.
With some videos that are less than 5-7MB the Player starts immediately, but when the video size goes over 10-15MB the video takes over 30 seconds before playing.
My question is: is there a way to speed up Android native MediaPlayer Buffering in order to play the first frame of the video as soon as it is available like YouTube?
Thanks in advance
Don't know much about android native MediaPlayer but got similar problems using ExoPlayer and solve it by using LoadControl. If you don't find any solution with MediaPlayer maybe think about use ExoPlayer. Here is the link for discussion about DefaultLoadControl:
https://github.com/google/ExoPlayer/issues/2438
Related
I am working on Android App regarding video playing. I am facing 20 to 30 seconds delay in video playing. I have tried many players but issue was always same. should i use Android custom or third party player for video playing. or anyone can suggest me alternative approach. videos size is 5mb and in mp4 format. how can i minimize this time to 1 to 2 sec.
From the description of your issue it may simply be that the metadata is at the end of the container for the video, which is typical with mp4 videos.
For video you want to stream it is recommended to move this to the front of the video.
You can see some more info and examples here:
https://superuser.com/a/438471
https://multimedia.cx/eggs/improving-qt-faststart/
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?
My question is about media player live streaming from the url in my application?
I'm trying to play live stream mp3 audio by media player.
The problem is that when i am using default URL as given in this link , then it works fine. But i changed the following mp3 link ,
then after playing 1 seconds it taking buffering and after completion its play the song, but i need that it plays the song with the buffering as well.
please help.
Thanks in advance.
It is not easy task to accomplish.
You can use this link https://code.google.com/p/mp3tunes/source/browse/
as reference app to develop your own progressive mediaplayer app.
From the above link you will get the whole architecture for your app.Song downloading and playing is happens at the same time.The architecture developed in the reference app is more robust and reusable.
Specially look at following classes
NanoHTTD.java
HttpServer.java
PlaybackService.java
PlaybackQueue.java
TrackDownloader.java
Thank You.
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 am using VideoView to display a video in my app. The problem is that, once the layout gets created there is lag of almost 10-30 seconds before which the video starts to play. I can see in LogCat that the video is buffering during the lag.
Is there a way I can minimize this lag, or tell MediaPlayer to play the video sooner?
Thanks
Chris
if you are using RTSP Streaming, buffering is the reason of what you have more seamless playback.
if you are playing an Audio/Video file reduce the bit rate encoding of your files.