package rf;

import java.util.List;
import tv.danmaku.ijk.media.player.IMediaPlayer;
import xyz.netfly.ui.vod_player.PlayerActivity;
import xyz.stream.api.entity.VideoInfoEntity;
import xyz.stream.view.DefaultTimeBar;
import xyz.stream.view.UiUtils;

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

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

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

    public /* synthetic */ a(PlayerActivity playerActivity, int i10) {
        this.f32538a = i10;
        this.f32539b = playerActivity;
    }

    /* JADX WARN: Code restructure failed: missing block: B:26:0x0046, code lost:
    
        r2 = r0.f32604g;
     */
    /* JADX WARN: Code restructure failed: missing block: B:27:0x0048, code lost:
    
        if (r2 == null) goto L33;
     */
    /* JADX WARN: Code restructure failed: missing block: B:28:0x004a, code lost:
    
        r3 = r0.f32605h;
     */
    /* JADX WARN: Code restructure failed: missing block: B:29:0x004c, code lost:
    
        if (r3 < 0) goto L33;
     */
    /* JADX WARN: Code restructure failed: missing block: B:31:0x0052, code lost:
    
        if (r3 >= r2.size()) goto L33;
     */
    /* JADX WARN: Code restructure failed: missing block: B:32:0x0054, code lost:
    
        r2 = ((xyz.stream.api.entity.SeriesEntity) r0.f32604g.get(r0.f32605h)).getVideoId();
     */
    /* JADX WARN: Code restructure failed: missing block: B:33:0x0063, code lost:
    
        r2 = r0.f32619v;
     */
    /* JADX WARN: Code restructure failed: missing block: B:34:0x0065, code lost:
    
        if (r2 > 0) goto L36;
     */
    /* JADX WARN: Code restructure failed: missing block: B:36:0x0068, code lost:
    
        r1 = xyz.stream.api.o.f().u(r0.f32610m.getId().intValue(), r2);
     */
    /* JADX WARN: Removed duplicated region for block: B:39:0x008b  */
    @Override // java.lang.Runnable
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void run() {
        VideoInfoEntity videoInfoEntity;
        VideoInfoEntity videoInfoEntityQ;
        int i10 = this.f32538a;
        int i11 = 1;
        PlayerActivity playerActivity = this.f32539b;
        switch (i10) {
            case 0:
                int i12 = PlayerActivity.f35698q0;
                if (!playerActivity.isFinishing() && !playerActivity.isDestroyed() && playerActivity.f35721l0 != 701) {
                    playerActivity.f35721l0 = IMediaPlayer.MEDIA_INFO_BUFFERING_START;
                    ((ie.s) playerActivity.binding).f27441f.setVisibility(0);
                    ((ie.s) playerActivity.binding).f27443h.setVisibility(8);
                    ((ie.s) playerActivity.binding).f27444i.setVisibility(8);
                    if (!playerActivity.U) {
                        xyz.netfly.api.c.b().q();
                    }
                    if (playerActivity.f35720l) {
                        playerActivity.f35719k0 = kotlinx.coroutines.flow.h.C();
                    }
                    xyz.netfly.player.q qVar = playerActivity.f35708f;
                    if (qVar != null) {
                        qVar.e();
                    }
                    break;
                }
                break;
            case 1:
                int i13 = PlayerActivity.f35698q0;
                ((ie.s) playerActivity.binding).f27440e.f27504a.setVisibility(8);
                playerActivity.f35725o0 = 0;
                break;
            case 2:
                int i14 = PlayerActivity.f35698q0;
                playerActivity.getClass();
                xyz.stream.utils.e.d().getClass();
                if (xyz.stream.utils.e.e().contains("ar")) {
                    ((ie.s) playerActivity.binding).f27439d.getIvBack().setScaleX(-1.0f);
                    DefaultTimeBar timeBar = ((ie.s) playerActivity.binding).f27439d.getTimeBar();
                    timeBar.setScaleX(-1.0f);
                    UiUtils.setViewRtl(((ie.s) playerActivity.binding).f27438c, timeBar);
                }
                break;
            case 3:
                int i15 = PlayerActivity.f35698q0;
                playerActivity.c0(true);
                break;
            case 4:
                int i16 = PlayerActivity.f35698q0;
                playerActivity.W();
                break;
            case 5:
                int i17 = PlayerActivity.f35698q0;
                playerActivity.c0(true);
                break;
            case 6:
                PlayerActivity.N(playerActivity);
                break;
            case 7:
                int i18 = PlayerActivity.f35698q0;
                playerActivity.c0(false);
                break;
            default:
                w wVar = playerActivity.f35718k;
                String strF = "";
                if (wVar != null && wVar.f32608k != null && (videoInfoEntity = wVar.f32610m) != null && videoInfoEntity.getId() != null) {
                    if ((r3 = wVar.f32610m) != null) {
                        videoInfoEntityQ = wVar.q(wVar.f32610m.getId().intValue(), 2);
                        if (videoInfoEntityQ != null) {
                            wVar.f32610m = videoInfoEntityQ;
                            wVar.f32611n = (videoInfoEntityQ.getWideBackdropPath() == null || videoInfoEntityQ.getWideBackdropPath().isEmpty()) ? videoInfoEntityQ.getBackdropPath() : videoInfoEntityQ.getWideBackdropPath();
                        }
                        List videoSources = wVar.f32610m.getVideoSources();
                        strF = wVar.f32608k.f(videoSources);
                        wVar.w(new o(wVar, 4));
                    } else {
                        videoInfoEntityQ = wVar.q(wVar.f32610m.getId().intValue(), 2);
                        if (videoInfoEntityQ != null) {
                        }
                        List videoSources2 = wVar.f32610m.getVideoSources();
                        strF = wVar.f32608k.f(videoSources2);
                        wVar.w(new o(wVar, 4));
                    }
                }
                playerActivity.runOnUiThread(new h(i11, strF, playerActivity));
                break;
        }
    }
}
