Change quality of video streaming in ExoPlayer - android

i am creating IPTV app. In this use Exoplayer for video streaming and now requirement is change Quality of video at runtime (Auto, 720p, 1080p, HD) like Youtube.
i have found 2-3 solution but i don't understand how to implement that.

ExoPlayer will do this automatically if the requirement is simply to match the bitrate/quality to the device capabilities and current network conditions.
If you actually want to allow the user to select it manually, that is also supported using the track selector functionality in Exoplayer2:
https://stackoverflow.com/a/44068596/334402
The demo app available in GitHub includes TrackSelector functionality which you can look at and modify as you need - most apps just use the DefaultTrackSelector: https://github.com/google/ExoPlayer

Related

How to do video conferencing using WebRTC in android?

I wanted to do a demo application of video conferencing using webrtc in android.I found some link for video conference using webrtc but its just for one to one not one to many.
I had the same issue with my video consultation app, if you want to add multiple users to video calling using Webrtc, you have to modify the opensource Webrtc project according to your need, which is not quite easy.
So I have implemented Appear.in inside my Android Webview, which works very fine, I can add upto 8 users in a single room. Its absolutely free of cost until you buy an specific room.
Appear.in also uses Webrtc for their video calling, they have optimized it very well. Video & Audio quality is good.
The only thing, you have to do before rendering the webview, ask Camera & Microphone permission from user(Above 6.0).
Try this, I think it will help you.

Is it possible to change resolution of exoplayer manually?

I'm working on a project that use Exoplayer2 for HLS video streaming. Adaptive streaming is working well in my exoplayer, but i want to implement a feature that user can change the resolution (144p,240p,480p..)of the video manually from UI. I got the resolution of the playing video from TrackGroup API. But don't know how to set the resolution value into the playing video manually.
Thanks
You can do this using the track selector functionality in Exoplayer2 - it essentially limits the tracks that the adaptive bit rate selection functionality in the player can select from.
It can only select from the available tracks in the stream index file, the manifest file. Hence, your choice of resolutions/bit rates is limited to whatever bitrate, resolution etc the stream provider has made available - i.e. the user can't just choose an arbitrary bit rate or resolution that they would like, if it is not one of the available ones in the manifest file (the video track index file).
To have just one track you simply only allow that one.
This functionality is included in the demo - here is an example screen shot from one of their blogs about this:
More details specifically on track selection here (it is also linked from the Exoplyar GitHub page): https://medium.com/google-exoplayer/exoplayer-2-x-track-selection-2b62ff712cc9

Android - play adaptive bitrate video from Azure Media Services

I have uploaded some video files to my Azure Media Service with the multi-bitrate MP4 encoding. I have the Media Service set up with one streaming unit and a Premium subscription, so it supports adaptive bitrate streaming.
On my Android app, I use the default VideoView widget but it doesn't seem to actually be using adaptive bitrate streaming. How can I make sure it is using adaptive bitrate?
EDIT: we are using the HLSv4 link from Azure Media Service (format=m3u8-aapl)
What kind of streaming protocol are you using exactly? The standard media library in Android is somewhat limited in this regard, so you might wanna take a look at ExoPlayer, it supports a much wider range of streaming protocols (like DASH and SmoothStreaming for example)
There's also a wrapper for ExoPlayer, which allows you to more or less use it as a drop in replacement for your VideoView.

Adaptive streaming - smoothstreaming doesn't works

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

Android and video streaming - How can do it?

This is my problem. I have on my hosting an avi video file and I want that the user of my android application can display it in streaming on your smartphone.
There are two way.
1) Convert this file in mp4 format and visual it into my application with MediaPlayer
2) Control that on user's device there is Rockplayer and then to use it for display this avi file.
What the good way ?
Please look at this link. It is very good example for Android Media Streaming.
Media streaming on Android devices using the VideoView object available in the android.widget package. This widget allows audio or video playback local or global resources.
Choose option 1. You don't want to "sponsor" third-party applications such as RockPlayer when building your own app. What if the user doesn't have internet connection by the time he's trying to use your app? And he hasn't downloaded RockPlayer previously? As much as possible you want your app to be independent of other market apps, especially those you do not own.

Categories

Resources