I need to make video player on Android that is able to play in slow motion and with different playback speeds. I still cannot find a native API or some code to do this. Does Android 2.2 - 2.3 support to video slow-motion and can we control the video playback speed?
Yes, from API 23 android has PlaybackParams class .It supports adjustment of playback speed of video briefly given here .
You can try exploring libVLC for this. VLC player for Android is almost due. Check their website.
Check this thread that discusses how you do it.. http://forum.videolan.org/viewtopic.php?f=14&t=89296
libVLC developer documentation here with normal playback sample. You need to modify this sample to play the video frame by frame or slow down the frame rate.
Related
I have been trying to record audio/video on Android device and play it back using Open MAX AL APIs.
So far, audio playback part works smoothly. I referred native-media example to play mp4 file from the SD card using Media Player object. Before trying video playback, I started exploring audio recording.
While trying recording, I realized that Engine::CreateMediaRecorder returns SL_RESULT_FEATURE_UNSUPPORTED.
Does that mean, Android does not support recording through OpenMAXAL APIs?
This link partially talks about some of the features except Media Recorder. Where are the Android supported features of OpenMAXAL documented?
Yes, it is not supported. Please refer this reply from Glenn Kasten.
I am currently using android media player and switching different bandwidth URLs manually named on button click but video streaming is not smooth. App minimum sdk version is 15. I already looked up for Exoplayer but it is very large library. My expectation is for smooth streaming player which should be small in size and customizable also.
Sorry for too late answer but there is no other customizable video player available which is able to stream video based upon network bandwidth (except than ExoPlayer Android-best one ) but the only issue is that it supports from min Api level 16 My need was min SDK 15. So i customized standard media player for Api level 15 and using ExoPlayer for further Api level.
There are so many libraries available some of them are listed below.
you can clone repository and customize as per your requirement.
https://github.com/afollestad/easy-video-player
https://github.com/lipangit/jiecaovideoplayer
I have one issue while using android ExoPlayer for streaming url.
Here I have attached sample URL:
http://epicmediaservice.streaming.mediaservices.windows.net/0bd4f655-00f9-4e36-a638-f8e90d9432c9/Nursery%20Rhymes%20Sample%20Clip.ism
It is working in some device, but not not working for Android version 4.2.1 (Micromax canvas 116)
It shows buffering video, but not playing.
If I select video option as OFF then it plays, but only audio comes no pictures visible.
new Sample("Super speed (PlayReady)",
"http://epicmediaservice.streaming.mediaservices.windows.net/0bd4f655-00f9-4e36-a638-f8e90d9432c9/Nursery%20Rhymes%20Sample%20Clip.ism",
DemoUtil.TYPE_SS),
Looks like you are trying to play DRM-protected content (PlayReady) which probably won't work since Exoplayer doesn't support DRM until Android 4.3 and upwards, also check on your device's documentation that it really supports PlayReady.
Check section Digital Rights Management on ExoPlayer's developer guide.
I am working with html5 video tag, i am using .m3u8 file for source. I can not able to seek video by using currentTime property in android 4+ whereas if i using .mp4 file i can able to seek.
In ipad its working properly but not working in android. Please guide me to rectify this issue.
Thanks,
Thavaprakash. S.
HLS and Android are not the best of friends.
Some problems I know of are:
No adaptive bitrate switching: the first quality is picked, no switching will occur.
When pausing, the video restarts from the beginning (for example with VOD).
When going fullscreen, the video restarts from the beginning.
When offering a livestream with DVR, the stream starts at the beginning of the DVR instead of at the "live" moment.
You cannot seek. <-- this is the one for you
Aspect ratio's are not detected properly. (tho this should be fixed in 4.1)
On top of these problems, there is no support for HLS in pre 2.3 Android and in 3.0 it actually makes your tablet crash.
Basically: only use HLS on Android for live video without DVR and set the correct aspect ratio. Oh, and try to pick a "suitable" quality, cause it won't switch.
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