package com.strmr.ps.ui.player;

import androidx.media3.exoplayer.ExoPlayer;
import com.strmr.ps.data.model.ContentItem;
import defpackage.ak1;
import defpackage.bk1;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.h32;
import defpackage.s38;
import defpackage.wj0;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lak1;", "Le6a;", "<anonymous>", "(Lak1;)V"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.ui.player.VideoPlayerActivity$startScrobbleUpdates$1", f = "VideoPlayerActivity.kt", i = {0}, l = {4700}, m = "invokeSuspend", n = {"$this$launch"}, s = {"L$0"})
final class ar extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public int a;
    public /* synthetic */ Object b;
    public final /* synthetic */ VideoPlayerActivity c;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public ar(VideoPlayerActivity videoPlayerActivity, Continuation continuation) {
        super(2, continuation);
        this.c = videoPlayerActivity;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        ar arVar = new ar(this.c, continuation);
        arVar.b = obj;
        return arVar;
    }

    @Override // defpackage.gr3
    public final Object invoke(Object obj, Object obj2) {
        return ((ar) create((ak1) obj, (Continuation) obj2)).invokeSuspend(e6a.a);
    }

    /* JADX WARN: Removed duplicated region for block: B:11:0x0029  */
    /* JADX WARN: Removed duplicated region for block: B:27:0x0062  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:12:0x0033 -> B:14:0x0036). Please report as a decompilation issue!!! */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        ak1 ak1Var;
        ContentItem contentItem;
        ExoPlayer exoPlayer;
        ck1 ck1Var = ck1.a;
        int i = this.a;
        VideoPlayerActivity videoPlayerActivity = this.c;
        if (i == 0) {
            s38.b(obj);
            ak1Var = (ak1) this.b;
            if (bk1.d(ak1Var)) {
            }
        } else {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            ak1Var = (ak1) this.b;
            s38.b(obj);
            if (!videoPlayerActivity.ck && videoPlayerActivity.Q && (contentItem = videoPlayerActivity.bw) != null && (exoPlayer = videoPlayerActivity.bm) != null) {
                wj0.c(androidx.lifecycle.s.a(videoPlayerActivity), null, null, new ae(videoPlayerActivity, contentItem, exoPlayer.getCurrentPosition(), exoPlayer.getDuration(), null), 3);
            }
            if (bk1.d(ak1Var)) {
                long j = videoPlayerActivity.R;
                this.b = ak1Var;
                this.a = 1;
                if (h32.a(j, this) == ck1Var) {
                    return ck1Var;
                }
                if (!videoPlayerActivity.ck) {
                    wj0.c(androidx.lifecycle.s.a(videoPlayerActivity), null, null, new ae(videoPlayerActivity, contentItem, exoPlayer.getCurrentPosition(), exoPlayer.getDuration(), null), 3);
                }
                if (bk1.d(ak1Var)) {
                    return e6a.a;
                }
            }
        }
    }
}
