video streaming and displaying simultaneously in android - android

Please provide some url related to some documentation about video streaming in android. I got many document on this site but all are getting total content of video from url and then playing the video but i want to stream and play video simultaneously so that i can play without consuming a lot of time. thank you

There are two techniques:
Using MediaPlayer: If you are using streaming server to fetch video then just provide your URL in MediaPlayer source. MediaPlayer will manage everything.
Manually: If you are not using streaming server for video then you need to download and play video. Use following link as example. In following link author explain audio streaming. You can use same technique for video.
http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/

Related

Android: Bitmovin I cant find the encoded video in the bitmovin console?

I have been searching all around the web to try to understand how to stream videos to my android app.
I learned:
That the videos must be in the HLS or MPEG-DASH format to be adaptive for streaming .
What I mean by adaptive streaming:
The kind of streaming that allows the user to change the quality while video is streaming.
What could help me do this:
The first thing should be to encode my videos into an HLS or MPEG-DASH, for that I found a service that could do this which is Bitmovin.
The second thing is to play the adaptive video, I found two ways exoplayer and Bitmovin-player.
The problem:
I made an account on bitmovin and tried to test an mp4 video to encode, but there are too many stuff there like input, output and manifest and I don't know what URL I should use to pass to the bitmovin player to play. I encoded the video but I don't know where the reference to the enocoded video is.
My question:
1) Is my approach of streaming videos correct?
2) Can someone explain which url I must pass to the player or where I can find the video that was encoded in Bitmovin cloud?
1) Is my approach of streaming videos correct?
Short answer: Yes :) Adaptive streaming is used by almost every major VoD platform out there, and a proper way to do that. Further it allows you and your viewers to either
let the player decide on its own to select the optimal quality for the given connection and device of the viewer to provide continuous playback
and the viewer can select a specific quality on their own as well, if they want to.
When creating adaptive streaming content using MPEG-DASH and/or HLS as streaming format, your output would typically consist of the following:
Video/Audio Segments
MPD Manifest, and/or HLS playlists
1) Your input file (e.g. an mp4 file) will be downloaded and splitted into segments, which are being processed by the Bitmovin encoding. Out of these, it creates the different qualities the player or your viewer can choose from later.
2) This segmented output is then transferred back to your own storage, e.g. a cloud storage like AWS Simple Storage, or Google Cloud Storage. Other output types like (S)FTP and many others can be used as well.
3) In order to play your created MPEG-DASH or HLS content, a MPD manifest and/or HLS playlist needs to be created. Those are basically an index for the player, which tells it which qualities are available and where to find them to start the playback.
2) Can someone explain which url I must pass to the player or where I can find the video that was encoded in Bitmovin cloud?
The URL you would have to provide to the player, has to point the MPD and/or HLS master playlist, that gets transferred to your storage. Bitmovin doesn't offer a hosting service for your encoded content, which is why you didn't find an URL to the manifest that is used. So you would need a storage first, where the encoding could be transferred to.
Give the getting started guide a try. Select your preferred API client. Then you will be guided step by step on how to integrate this encoding service. I hope this helps :)
To test the playback of the player you can also have a look at https://bitmovin.com/demos/stream-test and select "Use our defaults" which provide URL's to sample content for testing the player and playback.

load movie trailer in android application from imdb

Is it somehow possible, you can load the movie trailers from imdb to videoView or the native android player.
so far, what i've tried.
Iframe approach which let me load trailer in webview, which is exactly i don't want.
Here i found a link which is something a direct link to stream.
I want this to play in video view or native android control.
thanks in advance.
The link you have above is not a direct link to the video - it is actually a link to a web page which contains an embedded player, which in turn has a link to the actual trailer video itself.
You can see the link the to the video if you use the network timeline tab in a browser inspector to look at the network requests. For your example above the client (the browser running the HTML5 page you have downloaded) is requesting the video m3u8 file with the following request:
http://imdb-video.media-imdb.com/vi1225109529/1421100405014-mxwp62-1434643350557.m3u8
This is the 'index' file for a HLS format video file - it tells the client where to request the video streams. The client then downloads the video chunk by chunk which you can see as requests for TS segments - e.g. for you example above:
http://imdb-video.media-imdb.com/vi1225109529/1421100405014-mxwp62-143464335055700002.ts
If the IMDB site does not protect or restrict the video in some way (for example only allowing it play from their embedded web page) then in theory Android should be able to play a HLS file if you point the Media Player towards the m3u8 file. In practice however Android has well know issues with HLS playback so you may find it problematic - see this summary: http://www.jwplayer.com/blog/the-pain-of-live-streaming-on-android/

Play Vimeo video in Android VideoView

I am working on an Android application. In my app I have to play videos in VideoView. The videos from the Vimeo is not working. Whenever I tried to load Vimeo video I am getting the error message:
"sorry, this video cannot be played".
I saw some of the similar discussions in StackOverflow. So I tried Vittamio demo. There also Vimeo videos are not playing.
In the case of youtube url we have to convert to RTSP. for example
http://www.youtube.com/watch?v=Jx3pdWBlZ34
will convert to
rtsp://v4.cache8.c.youtube.com/CiILENy73wIaGQl-Z2VgdekdJxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp
I gave sample url is like this.
private String path = "http://player.vimeo.com/video/49462103 ";
and
private String path = "http://vimeo.com/49462103";
Is this the right way to enter Vimeo url in Android
Please help me to fix my issues friends.
Vimeo provides PRO members access to their own source files via the new API3.
They are available on every video response, under the files key. You can get video responses by requesting a specific video (single video: /videos/{video_id}) or by requesting a collection of videos (your videos: /me/videos).
You can learn more about the api here: https://developer.vimeo.com/api/start

Video link of unlisted youtube video

I am developing an android application that streams and shows a couple of videos. Instead of storing videos on my server, I thought uploading them to youtube as unlisted, and getting them from youtube is a great idea. After getting the video, I want to show them in default android video player, not in youtube app or web view.
I don't have any problem when I put videos in my server (for example www.mysite.com/video.mp4), but is there any way to get the url of a youtube video?
You can upload the videos using the YouTube Data API v3:
https://developers.google.com/youtube/v3/docs/videos/insert
And setting the status.privacyStatus as unlisted
Then you can use the YouTube Android Player API to include the Video Player on your own Android App
https://developers.google.com/youtube/android/player/
To play a video, you only need the video ID, not the full url..
eg:
player.loadVideo("wKJ9KzGQq0w");

Youtube video in VideoView

I want to play a remote video in a Videoview. Anybody knows a good free server to load my videos in it to later stream in a videoview? Is possible to see in a videoview Youtube videos? I have see another questions but I donĀ“t understand. Anybody can put a example to play a Youtube video or remote video for another server in a videoview?
Thank you
You can check android-youtube-player, a project to make YouTube videos play in a VideoView. The usage instructions and sample Activity code is available.
You can definitely stream video directly into a VideoView without a problem, and you set it up normally as well:
Uri pathtoVideo = Uri.parse(path);
videoView.setVideoURI(pathToVideo);
However, there are a lot of videos on Youtube that aren't mobile-friendly, and will end up throwing a "This Video Cannot Be Played" error.
The MediaPlayer on Android can only play "progressive streamable contents" which basically means: 1. the movie atom has to precede all the media data atoms. 2. The clip has to be reasonably interleaved. If it doesn't, you'll get the error I mentioned above.
Have you considered the YouTube API for android? I recently posted a tutorial on how to use the video and thumbnail views from the API here

Categories

Resources