package xyz.netfly.mobile.player;

import androidx.appcompat.app.AppCompatActivity;
import okhttp3.Request;
import org.drive_hunter.R;
import tv.danmaku.ijk.media.player.ui.IjkVideoView;
import xyz.stream.utils.entity.CheckResultEntity;

/* JADX INFO: loaded from: classes3.dex */
public final /* synthetic */ class h implements Runnable {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f34976a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ t f34977b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ String f34978c;

    public /* synthetic */ h(t tVar, String str, int i10) {
        this.f34976a = i10;
        this.f34977b = tVar;
        this.f34978c = str;
    }

    @Override // java.lang.Runnable
    public final void run() {
        String strConcat = this.f34978c;
        int i10 = this.f34976a;
        t tVar = this.f34977b;
        switch (i10) {
            case 0:
                tVar.getClass();
                s sVar = new s(tVar);
                xyz.stream.utils.z zVarE = xyz.stream.utils.z.e();
                zVarE.getClass();
                Request requestBuild = new Request.Builder().url(strConcat).head().build();
                xyz.stream.utils.z.f36195b.newCall(requestBuild).enqueue(new xyz.stream.utils.u(zVarE, requestBuild, sVar, strConcat));
                break;
            default:
                AppCompatActivity appCompatActivity = tVar.f35007a;
                if (appCompatActivity != null && !appCompatActivity.isDestroyed() && !tVar.f35007a.isFinishing()) {
                    CheckResultEntity checkResultEntityC = xyz.stream.utils.e.d().c();
                    if (checkResultEntityC != null && checkResultEntityC.getIsPremium() != null && checkResultEntityC.getIsPremium().intValue() != 1) {
                        tVar.h();
                        break;
                    } else {
                        IjkVideoView ijkVideoView = tVar.f35008b;
                        if (ijkVideoView != null && ijkVideoView.getPlaybackState() <= 1) {
                            if (strConcat != null && !strConcat.isEmpty()) {
                                if (!strConcat.startsWith("http://") && !strConcat.startsWith("https://")) {
                                    strConcat = "https://image.tmdb.org/t/p/w500".concat(strConcat);
                                }
                                if (!strConcat.equals(tVar.f35027u)) {
                                    tVar.h();
                                    int i11 = tVar.f35028v;
                                    if (i11 <= 0) {
                                        i11 = tVar.f35007a.getResources().getDisplayMetrics().widthPixels;
                                    }
                                    int i12 = tVar.f35029w;
                                    if (i12 <= 0) {
                                        i12 = tVar.f35007a.getResources().getDisplayMetrics().heightPixels;
                                    }
                                    q5.f fVar = (q5.f) ((q5.f) ((q5.f) ((q5.f) new q5.f().q(false)).e(com.bumptech.glide.load.engine.o.f5751a)).f()).i(i11, i12);
                                    tVar.f35027u = strConcat;
                                    tVar.f35026t = new q(tVar, i11, i12);
                                    com.bumptech.glide.c.f(tVar.f35007a).load(strConcat).a(fVar).into(tVar.f35026t, null, t5.g.f32964a);
                                    break;
                                }
                            } else {
                                tVar.f35027u = null;
                                tVar.h();
                                tVar.f35008b.setDrawableArtwork(f.a.getDrawable(tVar.f35007a, R.mipmap.bg_login));
                                break;
                            }
                        }
                    }
                }
                break;
        }
    }
}
