exoplayer2.x

How to show ads at specific points using ExoPlayer's IMA extension?

瘦欲@ 提交于 2019-12-03 23:05:48
I am using ExoPlayer 2.7.3 with IMA extension. I have to show ads at certain intervals. I have managed to integrate the AdsLoader and AdsMediaSource . I am receiving and displaying the ads. But the ads are only appearing at the beginning of the movie. How do I make the ads to be shown at the points when I want them to (for eg. at every 30 minutes)? I'm not sure whether you are using the IMA extension with the ImaAdsLoader or your custom implementation of AdsLoader which is part of the core library (no IMA extension required): Using IMA ad tags If you are using the IMA extension you need to

Get everything in from ExoPlayer Cache

十年热恋 提交于 2019-12-03 21:18:11
Using https://google.github.io/ExoPlayer/doc/reference/com/google/android/exoplayer2/upstream/cache/CacheDataSourceFactory.html is there a way to grab all the MediaSources that have been cached? The Cache offers no convenient API to get all completely cached URIs or similar. If you create your own CacheEvictor (for instance by wrapping a LeastRecentlyUsedCacheEvictor ) you can do your own book keeping when spans are added or removed and then delegate to the LRUCacheEvictor. This way you can maintain a list of cached URLs. You can check what portions for a given uri is cached: // create the

Binding PlayerView with SimpleExoPlayer from a service

瘦欲@ 提交于 2019-12-03 17:36:38
I have implemented a Service to run the audio in background which runs perfectly but I am unable to get the instance of the SimpleExoPlayer from the service to the activity to update the UI and also the Audio plays twice in the background if I exit and reopen the activity. AudioPlayerService public class AudioPlayerService extends Service { private final IBinder mBinder = new LocalBinder(); private SimpleExoPlayer player; private Item item; private PlayerNotificationManager playerNotificationManager; @Override public void onCreate() { super.onCreate(); } @Override public void onDestroy() {

ExoPlayer2 - How can I make a HTTP 301 redirect work?

我的未来我决定 提交于 2019-12-03 11:22:03
I started using ExoPlayer to stream some audio. All was well until I came across an URL that has a "301 Moved Permanently" redirect. ExoPlayer2 does not handle that by default. I've already seen this thread: https://github.com/google/ExoPlayer/issues/423 There they say to add the new "allowCrossDomainRedirects" flag to either a HttpDataSource or UriDataSource. The problem is that I don't use either of those classes: //I am NOT using SimpleExoPlayer because I need a different renderer. exoPlayer = ExoPlayerFactory.newInstance(renderers, trackSelector, loadControl); final DataSource.Factory

Exoplayer how to know which URL to be played with custom video view

核能气质少年 提交于 2019-12-02 10:14:34
问题 I am first time working on online Video player, I am using TextureVideoViewMute extends TextureView implements TextureView.SurfaceTextureListener custom class as custom video player. I am having two urls in my response source_url (main url) and dash_url .Now I wanted to use ExomediaPlayer for this but I have following questions. 1.How to categories which url to be played? 2.Or Whether this will be decided by player itself while playing? 3.Or We need to use single url player automatically do

Exoplayer how to know which URL to be played with custom video view

六眼飞鱼酱① 提交于 2019-12-02 04:37:37
I am first time working on online Video player, I am using TextureVideoViewMute extends TextureView implements TextureView.SurfaceTextureListener custom class as custom video player. I am having two urls in my response source_url (main url) and dash_url .Now I wanted to use ExomediaPlayer for this but I have following questions. 1.How to categories which url to be played? 2.Or Whether this will be decided by player itself while playing? 3.Or We need to use single url player automatically do his work? 4.Or is it possible combination of custom video surfaceview and SimpleExoPlayer ? The main

Google ExoPlayer guide

寵の児 提交于 2019-11-30 05:32:25
I am struggling to build basic app with ExoPlayer. First you need to add this in your build.gradle compile 'com.google.android.exoplayer:exoplayer:r2.1.1' 1. Your Layout File <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <com.google.android.exoplayer2.ui.SimpleExoPlayerView android:id="@+id/player_view" android:focusable="true" android:layout_width="match_parent" android:layout_height="match_parent"/> <

Is it possible to change resolution of exoplayer manually?

流过昼夜 提交于 2019-11-29 05:09:38
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

Is it possible to change resolution of exoplayer manually?

房东的猫 提交于 2019-11-27 18:54:33
问题 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 回答1: You can do this using the track selector functionality in Exoplayer2 - it essentially limits the

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