package com.strmr.ps.ui.player;

import android.util.Log;
import androidx.media3.exoplayer.ExoPlayer;
import com.strmr.ps.data.model.ContentItem;
import defpackage.ak1;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.qo9;
import defpackage.s38;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.Boxing;
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\u0010\u0000\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lak1;", "", "<anonymous>", "(Lak1;)Ljava/lang/Object;"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.ui.player.VideoPlayerActivity$savePlaybackProgress$1", f = "VideoPlayerActivity.kt", i = {}, l = {6837}, m = "invokeSuspend", n = {}, s = {})
final class ah extends SuspendLambda implements gr3<ak1, Continuation<? super Object>, Object> {
    public int a;
    public final /* synthetic */ VideoPlayerActivity b;
    public final /* synthetic */ ContentItem c;
    public final /* synthetic */ long d;
    public final /* synthetic */ long e;
    public final /* synthetic */ String f;
    public final /* synthetic */ String i;
    public final /* synthetic */ String j;
    public final /* synthetic */ String k;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public ah(VideoPlayerActivity videoPlayerActivity, ContentItem contentItem, long j, long j2, String str, String str2, String str3, String str4, Continuation continuation) {
        super(2, continuation);
        this.b = videoPlayerActivity;
        this.c = contentItem;
        this.d = j;
        this.e = j2;
        this.f = str;
        this.i = str2;
        this.j = str3;
        this.k = str4;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        return new ah(this.b, this.c, this.d, this.e, this.f, this.i, this.j, this.k, continuation);
    }

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

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) {
        ck1 ck1Var = ck1.a;
        int i = this.a;
        try {
            if (i == 0) {
                s38.b(obj);
                ag agVar = new ag(this.b, this.c, this.d, this.e, this.f, this.i, this.j, this.k, null);
                this.a = 1;
                if (qo9.b(ExoPlayer.DEFAULT_DETACH_SURFACE_TIMEOUT_MS, agVar, this) == ck1Var) {
                    return ck1Var;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
            }
            return e6a.a;
        } catch (Exception e) {
            return Boxing.boxInt(Log.e("VideoPlayerActivity", "Failed to save progress on exit: " + e.getMessage()));
        }
    }
}
