How to stream .mp4 video in android, video is from backed server. By implementing all the solution showing a message can't play this video
My suggestion is to use Exoplayer which is google's video default player.
here is a very basic, working example of exoplayer 2.8.4 to play livestream or .mp4 files.
https://github.com/ayalus/ExoPlayer-2-Example
Related
I am working on Android TV app and have to stream some videos. I am facing problem in playing m3u8 videos in videoview. Videoview is not working fine in all the devices. So I tried GoogleExo player and Vitamio - it seems like both does not suppport m3u8 videos.
Does anyone know how to play m3u8 videos on android?
By m3u8 if you mean HLS videos, Google's ExoPlayer supports that. Also if you don't want to use ExoPlayer, android mediaplayer api has limited support for HLS stream from android 4.0.
I would suggest if you can spend some money on purchasing some thirdparty players, they'll give the best playabck experience and features. Refer the following players
NexStreaming
Akamai
Brightcove
JW Player - Its built on top of exoplayer
I am working on an android application and my application is having a functionality to upload multiple type of videos in app. The videos can be from any sources like Youtube, Vimeo or can be uploaded from device. So, I want to play each type of videos in my application whether they are uploaded from any type of resources.
If I use VideoView, it supports only some of the extensions and it can't play youtube and viemo uploaded videos as well. I have to use Webview to play youtube and vimeo videos.
Is there any view which can play all type of videos or can someone help me in creating a video player view which can play each type of video.
I don't have much idea about videoview, please help me if anyone know about this so that I can create a view which can play all type if video formats.
Thanks a lot in advanced.
There seems no universal video player for all video sources/types.
The Android built-in VideoView can play rtsp and HLS streams, take a look at Android: How to play RTSP or HLS video streams
To play rtmp video streams in Android, you can use a number of libraries such as Vitamio: refer to Android: How to play RTMP video streams
The VideoView used to be able to play youtube videos, but now you cannot. You need to use YouTube Android Player API now. Refer to Android development: Play Youtube video in your app, “Can’t play this video” and troubleshooting instead.
I'm able to play HLS Live Video Streaming on my Android Device. I am able to play the Video if the Device is Installed with the Vitamio Plugin.
Could anyone tell me how to Embed the Vitamio Plugin into our Android App without intstalling it externally?
Is there any way to Stream HLS Videos?
Note: I refer to this link stream live video to Android
I mean I have a link like this: http://15....../a.stream
I write this code to see the video on android :
VideoView wv = (VideoView)findViewById(R.id.videoView1);
wv.setVideoURI(Uri.parse("rtsp://15........./a.stream"));
MediaController controller = new MediaController(izle.this);
wv.setMediaController(controller);
wv.start();
This code works first.But one day the same code say :
Cannot play video
Sorry,this video cannot played.
My first question is why that alert me like that?
second question is maybe i play video in another way maybe it is work.Like if I play video in webview maybe it is work? How I play the rtsp video stream on webview?
Thanks...
You can't play rtsp in webview. Only Flash(rtmp) stream play in browser with flash player.If streams is rtsp, then browser will open it in the external video player.
HTTPS progressive streams are only supported under 3.0+.
WebView plays rtmp as well as rtsp if your device has somehow flash working on it. It won't play without that so API version is important because flash player used to work on earlier APIs.
The best way to stream live in Android is to use Vitamio. It's the best solution out there. It can play numerous stream formats including rtmp and rtsp.
We are trying to develop an app for Android where you can play a live streaming URL. I tried several approaches using the MediaPlayer and StreamPlayer... but no luck with the URL playing.
I can of cause play a static MP4 or MP3 file using the URL (hosted on a server) but when I try to play a stream URL it doesn't play or give an error.
Any thoughts?
Mp3 stream works well on Mediaplayer from Android 2.2 and above. If you want to play the Content below 2.2 then its better to use local proxy server implementation. check Npr . Which uses the same approach.
If you want to play wma audio you should convert that into PCM and play it. check aacplayer. In aacplayer project he gets wma content from mms:// stream and plays it . You can edit that to play only wma content. But i haven't tried playing any wmv videos.