exoplayer

How to create youtube's double-tap gesture on Android?

我怕爱的太早我们不能终老 提交于 2019-12-03 21:37:05
I have application with exoplayer on Android. I have create youtube's double-tap gesture to jump 10 seconds forward or backward with animation! How create this semicircle with ripple effect on double tap? Like this How to do this? I've also wanted to implement such feature, so I wrote it myself to "copy" YouTube's behavior. It's almost the same. You can find the library here including a sample app: https://github.com/vkay94/DoubleTapPlayerView The instructions are written in the README, but due to Stackoverflow principals: 0) Requirements: Minimum SDK: 21 (could be lower, but I've not tested

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

How to show HLS embedded captions on Exoplayer

廉价感情. 提交于 2019-12-03 21:05:46
how do I enable and also select different subtitles that are embedded in a Vimeo video in HLS format using Exoplayer, ExoMedia or another player? In iOS this same video already presents the option of subtitles natively but in Android I cannot find means to implement it. This works well! TrackGroupArray trackGroups = mappedTrackInfo.getTrackGroups(rendererIndex); TrackSelectionArray currentTrackGroups = player.getCurrentTrackSelections(); TrackSelection currentTrackSelection = currentTrackGroups.get(rendererIndex); for (int groupIndex = 0; groupIndex < trackGroups.length; groupIndex++) {

Precise seek in MP3 files on Android

心已入冬 提交于 2019-12-03 18:09:52
问题 I'm building an app where it's important to have accurate seeking in MP3 files. Currently, I'm using ExoPlayer in the following manner: public void playPeriod(long startPositionMs, long endPositionMs) { MediaSource mediaSource = new ClippingMediaSource( new ExtractorMediaSource.Factory(mDataSourceFactory).createMediaSource(mFileUri), startPositionMs * 1000, endPositionMs * 1000 ); mExoPlayer.prepare(mediaSource); mExoPlayer.setPlayWhenReady(true); } In some cases, this approach results in

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() {

ExoPlayer - how to play local mp3 file

强颜欢笑 提交于 2019-12-03 16:53:52
问题 I'm trying to use ExoPlayer instead of MediaPlayer because it's a common bug that MediaPlayer returns wrong getCurrentPosition() and I need a substitute. But I can't find an info anywhere how to open a local file through the file path to the file same as MediaPlayer's .setDataSource(String filepath) Google doesn't have any example and the official documentation site strangely crash my FireFox browser on both computers 回答1: The ExoPlayer demo app in github can be modified to play local files.

Online encrypted streaming video files with AES in exoplayer android

让人想犯罪 __ 提交于 2019-12-03 13:40:49
问题 I have video files encrypted with AES stored on server. How to stream them online in exoplayer? I don't want to download the file and decrypt it: waiting for the download to complete and then play decrypted file. 回答1: I would suggest taking a look at the UriDataSource or the DataSource interface. You can derive from DataSource and provide an implementation very similar to UriDataSource and pass that into ExoPlayer. That class has access to the read() method which all the bytes pass through.

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 - play 10 files one after another

与世无争的帅哥 提交于 2019-12-03 09:47:51
问题 I have 10 video i need to play, once one is done, the next one starts to play. I'm using Google's ExoPlayer, I use the example in the DEMO @ GitHub. I can play 1 video but if i try to play the next one, it wont start. If i try to reInit the player, and the start playing again, it crashes. private void loadvideo() { Uri uri = Uri.parse(VIDEO_LIBRARY_URL + currentVideo + ".mp4"); sampleSource = new FrameworkSampleSource(this, uri, null, 2); // 1. Instantiate the player. // 2. Construct

Android: Dynamically Blur Surface with Video

有些话、适合烂在心里 提交于 2019-12-03 08:29:57
I am building an Android application where an ExoPlayer plays a video onto the surface of a SurfaceView, and I am investigating whether it is possible to dynamically blur the playing video. Blurring techniques that involve first generating a bitmap of the view to blur will not work, since the surface part of a SurfaceView does not appear in bitmaps. Surfaces and views used to have built-in blurring effects in older versions of Android (e.g. Surface.FX_SURFACE_BLUR), but seem to have been deprecated in newer APIs. Can anyone share some insight on how a surface can be dynamically blurred? Thank