Add super-simple SimpleExoPlayer factory method.

The DefaultTrackSelector can now be constructed without leaving out a
vital part of the initialization. This allows this new simple factory method.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213438163
This commit is contained in:
tonihei 2018-09-18 06:13:00 -07:00 committed by Oliver Woodman
parent a89645d092
commit decbb33490

View File

@ -22,6 +22,7 @@ import com.google.android.exoplayer2.analytics.AnalyticsCollector;
import com.google.android.exoplayer2.audio.AudioAttributes; import com.google.android.exoplayer2.audio.AudioAttributes;
import com.google.android.exoplayer2.drm.DrmSessionManager; import com.google.android.exoplayer2.drm.DrmSessionManager;
import com.google.android.exoplayer2.drm.FrameworkMediaCrypto; import com.google.android.exoplayer2.drm.FrameworkMediaCrypto;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import com.google.android.exoplayer2.trackselection.TrackSelector; import com.google.android.exoplayer2.trackselection.TrackSelector;
import com.google.android.exoplayer2.upstream.BandwidthMeter; import com.google.android.exoplayer2.upstream.BandwidthMeter;
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter; import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
@ -131,6 +132,15 @@ public final class ExoPlayerFactory {
context, renderersFactory, trackSelector, loadControl, drmSessionManager); context, renderersFactory, trackSelector, loadControl, drmSessionManager);
} }
/**
* Creates a {@link SimpleExoPlayer} instance.
*
* @param context A {@link Context}.
*/
public static SimpleExoPlayer newSimpleInstance(Context context) {
return newSimpleInstance(context, new DefaultTrackSelector());
}
/** /**
* Creates a {@link SimpleExoPlayer} instance. * Creates a {@link SimpleExoPlayer} instance.
* *