exoplayer

Quality selector for ExoPlayer 2

前提是你 提交于 2019-11-27 05:13:17
I am currently developing a live and movie player application. I chose ExoPlayer version 2 to play the movie and I do not know much about it. I want to let the user choose the quality of a movie on the player screen, for example, 720p or 1080p or etc. But I do not know how to get a list of existing qualities and show them to the user. and the below code is my implementation of SimpleExoPlayer : private void initPlayer(String path){ Handler handler = new Handler(); // 1. Create a default TrackSelector BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter(); TrackSelection.Factory

Using cache in ExoPlayer

眉间皱痕 提交于 2019-11-27 03:24:26
I'm looking for any example of implementing cache in ExoPlayer. ExoPlayer has in its library different classes concerning cache and Google explain in this video that we can implement it with the CacheDataSource class, but Google doesn't provide any demo on it. Unfortunately this seems pretty complicated to use, so I'm currently looking for examples (no success on Google). Does anyone succeed or has any info that would help ? Thanks. Here is the solution for ExoPlayer 2.+ Create a custom cache data source factory class CacheDataSourceFactory implements DataSource.Factory { private final Context

How to have similar mechanism of center-crop on ExoPlayer's PlayerView , but not on the center?

大兔子大兔子 提交于 2019-11-27 01:50:40
问题 Background We record a video of the user's face, and usually the face is located at the upper half of the video. Later we wish to view the video, but the aspect ratio of the PlayerView might be different than the one of the video, so there needs to be some scaling and cropping. The problem The only way I've found to scale the PlayerView so that it will be shown in the entire space it has but keeping the aspect ratio (which will result in cropping when needed, of course) , is by using app

How to play Youtube video in ExoPlayer in Android?

我是研究僧i 提交于 2019-11-27 00:22:42
问题 I am trying to play youtube video in exoplayer but here is some confusion I don't know what is DASH url, I have only real youtube url like "https://www.youtube.com/watch?v=v1uyQZNg2vE" , I have no idea how to generate dash url form real url. Dash Url: new Sample("Google Glass", "http://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube?" + "as=fmp4_audio_clear,fmp4_sd_hd_clear&sparams=ip,ipbits,expire,as&ip=0.0.0.0&" + "ipbits=0&expire=19000000000&signature

Using cache in ExoPlayer

可紊 提交于 2019-11-26 12:06:49
问题 I\'m looking for any example of implementing cache in ExoPlayer. ExoPlayer has in its library different classes concerning cache and Google explain in this video that we can implement it with the CacheDataSource class, but Google doesn\'t provide any demo on it. Unfortunately this seems pretty complicated to use, so I\'m currently looking for examples (no success on Google). Does anyone succeed or has any info that would help ? Thanks. 回答1: Here is the solution for ExoPlayer 2.+ Create a