Commit decbb334 by tonihei Committed by Oliver Woodman

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
parent a89645d0
......@@ -22,6 +22,7 @@ import com.google.android.exoplayer2.analytics.AnalyticsCollector;
import com.google.android.exoplayer2.audio.AudioAttributes;
import com.google.android.exoplayer2.drm.DrmSessionManager;
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.upstream.BandwidthMeter;
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
......@@ -135,6 +136,15 @@ public final class ExoPlayerFactory {
* 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.
*
* @param context A {@link Context}.
* @param trackSelector The {@link TrackSelector} that will be used by the instance.
*/
public static SimpleExoPlayer newSimpleInstance(Context context, TrackSelector trackSelector) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment