exoplayer

Detect pause/resume in ExoPlayer

╄→尐↘猪︶ㄣ 提交于 2019-12-05 09:47:15
问题 I searched two days for this question in github but i can't find true answer . I want example for detecting pause / resume in ExoPlayer > 2.x . Any one can give me an example ? I checked onPlayerStateChanged and problem not solved . onPlayerStateChanged : STATE_BUFFERING onPlayerStateChanged : STATE_READY I just got this log from onPlayerStateChanged and this is not called in all times ! 回答1: You need to check playWhenReady with a Player.EventListener. The Playback states of ExoPlayer are

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

不羁的心 提交于 2019-12-05 07:41:46
问题 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)? 回答1: 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

Get everything in from ExoPlayer Cache

泪湿孤枕 提交于 2019-12-05 04:09:28
问题 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? 回答1: 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

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

三世轮回 提交于 2019-12-05 02:38:00
问题 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? 回答1: 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,

How to play a particular video from ExoPlayer playlist android?

一个人想着一个人 提交于 2019-12-05 01:24:25
问题 I'm using ExoPlayer to play a list of videos as playlist: MediaSource[] mediaSources = new MediaSource[mList.size()]; for (int i = 0; i < mList.size(); i++) { mediaSources[i] = buildMediaSource(Uri.parse(mList.get(i)); } MediaSource mediaSource = mediaSources.length == 1 ? mediaSources[0] : new ConcatenatingMediaSource(mediaSources); mExoPlayer.prepare(mediaSource); Its working fine. But as per requirement I have to play a video in a particular position from the list when click. How can I

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

对着背影说爱祢 提交于 2019-12-04 17:12:40
问题 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.

Streaming a YouTube live video (DASH) to Android app with ExoPlayer

不羁的心 提交于 2019-12-04 16:53:57
I am making an app that can stream a live YouTube video to my app. I want to use ExoPlayer. I went through the demo app of ExoPlayer, and the URL they use in DASH streaming is something like this : "uri":"http://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube?as=fmp4_audio_clear,fmp4_sd_hd_clear&sparams=ip,ipbits,expire,source,id,as&ip=0.0.0.0&ipbits=0&expire=19000000000&signature=51AF5F39AB0CEC3E5497CD9C900EBFEAECCCB5C7.8506521BFC350652163895D4C26DEE124209AA9E&key=ik0" This is working. I don't know how to get such a URL and I end up here . Does that mean that I can't

Fullscreen the Exoplayer

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 11:02:48
问题 I try to show the show video (.mp4) with exoplayer in RecyclerView and ViewPager . I show the video controller with custom layout. so far so good. Now try to fullscreen the video like other video player how use before but can't find a good way in the exoplayer doc. can anyone help me? 回答1: The ExoPlayer library currently does not provide a built-in way to enable/disable fullscreen mode. You need to implement this yourself or find some third party code for this I'm afraid. Essentially two

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

Detect pause/resume in ExoPlayer

左心房为你撑大大i 提交于 2019-12-03 22:32:59
I searched two days for this question in github but i can't find true answer . I want example for detecting pause / resume in ExoPlayer > 2.x . Any one can give me an example ? I checked onPlayerStateChanged and problem not solved . onPlayerStateChanged : STATE_BUFFERING onPlayerStateChanged : STATE_READY I just got this log from onPlayerStateChanged and this is not called in all times ! You need to check playWhenReady with a Player.EventListener . The Playback states of ExoPlayer are independent from the player being paused or not: player.addListener(new Player.DefaultEventListener() {