55 lines
2.2 KiB
Java
55 lines
2.2 KiB
Java
package c.a.q;
|
|
|
|
import android.content.Context;
|
|
import android.content.pm.PackageManager;
|
|
import android.os.Build;
|
|
import c.i.a.c.h2.p;
|
|
import c.i.a.c.i2.f0;
|
|
import c.i.a.c.l0;
|
|
import c.i.a.c.p1;
|
|
import com.airbnb.lottie.parser.AnimatableValueParser;
|
|
import com.discord.app.AppLog;
|
|
import com.discord.player.AppMediaPlayer;
|
|
import d0.z.d.m;
|
|
import j0.p.a;
|
|
import rx.Scheduler;
|
|
/* compiled from: AppMediaPlayerFactory.kt */
|
|
public final class i {
|
|
public static final AppMediaPlayer a(Context context) {
|
|
String str;
|
|
m.checkNotNullParameter(context, "context");
|
|
AppLog appLog = AppLog.g;
|
|
m.checkNotNullParameter(context, "context");
|
|
m.checkNotNullParameter("com.discord", "applicationId");
|
|
m.checkNotNullParameter(appLog, "logger");
|
|
int i = f0.a;
|
|
try {
|
|
str = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
|
|
} catch (PackageManager.NameNotFoundException unused) {
|
|
str = "?";
|
|
}
|
|
j jVar = new j(new p(context, "com.discord/" + str + " (Linux;Android " + Build.VERSION.RELEASE + ") ExoPlayerLib/2.13.3"), 104857600);
|
|
k kVar = new k();
|
|
AnimatableValueParser.D(true);
|
|
l0.j(2500, 0, "bufferForPlaybackMs", "0");
|
|
l0.j(5000, 0, "bufferForPlaybackAfterRebufferMs", "0");
|
|
l0.j(10000, 2500, "minBufferMs", "bufferForPlaybackMs");
|
|
l0.j(10000, 5000, "minBufferMs", "bufferForPlaybackAfterRebufferMs");
|
|
l0.j(30000, 10000, "maxBufferMs", "minBufferMs");
|
|
AnimatableValueParser.D(true);
|
|
l0 l0Var = new l0(new c.i.a.c.h2.m(true, 65536), 10000, 30000, 2500, 5000, -1, false, 0, false);
|
|
m.checkNotNullExpressionValue(l0Var, "DefaultLoadControl.Build…reateDefaultLoadControl()");
|
|
p1.b bVar = new p1.b(context);
|
|
AnimatableValueParser.D(!bVar.q);
|
|
bVar.f = l0Var;
|
|
AnimatableValueParser.D(!bVar.q);
|
|
bVar.q = true;
|
|
p1 p1Var = new p1(bVar);
|
|
m.checkNotNullExpressionValue(p1Var, "SimpleExoPlayer\n …ntrol)\n .build()");
|
|
p1Var.l(kVar);
|
|
Scheduler a = a.a();
|
|
m.checkNotNullExpressionValue(a, "Schedulers.computation()");
|
|
return new AppMediaPlayer(p1Var, kVar, jVar, a, appLog);
|
|
}
|
|
}
|