Insert changes to exoplayer newer API

This commit is contained in:
Suhan Paradkar 2021-12-21 12:01:48 +05:30 committed by Wisest_wizard
parent 05939da221
commit 2e7524b46e
2 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,8 @@ import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
import com.google.android.exoplayer2.upstream.cache.CacheDataSourceFactory;
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
import com.google.android.exoplayer2.upstream.cache.CacheDataSource.Factory;
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
import java.util.List;
@ -42,7 +43,7 @@ public class FeedVideoViewHolder extends FeedItemViewHolder {
private final DefaultDataSourceFactory dataSourceFactory;
private final LayoutPostViewBottomBinding bottom;
private CacheDataSourceFactory cacheDataSourceFactory;
private CacheDataSource.Factory cacheDataSourceFactory;
private Media media;
// private final Runnable loadRunnable = new Runnable() {
@ -64,7 +65,7 @@ public class FeedVideoViewHolder extends FeedItemViewHolder {
dataSourceFactory = new DefaultDataSourceFactory(context, "instagram");
final SimpleCache simpleCache = Utils.getSimpleCacheInstance(context);
if (simpleCache != null) {
cacheDataSourceFactory = new CacheDataSourceFactory(simpleCache, dataSourceFactory);
cacheDataSourceFactory = new CacheDataSource.Factory(simpleCache, dataSourceFactory);
}
}

View File

@ -25,7 +25,6 @@ import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.audio.AudioListener;
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
@ -57,7 +56,7 @@ public class VideoPlayerViewHelper implements Player.EventListener {
private SimpleExoPlayer player;
private AppCompatImageButton mute;
private final AudioListener audioListener = new AudioListener() {
private final Player.Listener audioListener = new Player.Listener() {
@Override
public void onVolumeChanged(final float volume) {
updateMuteIcon(volume);