package defpackage;

import android.content.Intent;
import android.util.Log;
import android.widget.Toast;
import com.strmr.ps.ui.home.HomeFragment;
import com.strmr.ps.ui.player.VideoPlayerActivity;
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.home.HomeFragment$playDebridFileLegacy$1", f = "HomeFragment.kt", i = {}, l = {725}, m = "invokeSuspend", n = {}, s = {})
final class e84 extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public int a;
    public final /* synthetic */ HomeFragment b;
    public final /* synthetic */ String c;
    public final /* synthetic */ String d;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public e84(HomeFragment homeFragment, String str, String str2, Continuation continuation) {
        super(2, continuation);
        this.b = homeFragment;
        this.c = str;
        this.d = str2;
    }

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

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

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) throws Throwable {
        ck1 ck1Var = ck1.a;
        int i = this.a;
        HomeFragment homeFragment = this.b;
        try {
            if (i == 0) {
                s38.b(obj);
                String str = this.c;
                this.a = 1;
                int i2 = HomeFragment.aq;
                m12 m12Var = sc2.a;
                obj = wj0.f(m02.c, new m84(homeFragment, str, null), this);
                if (obj == ck1Var) {
                    return ck1Var;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
            }
            String str2 = (String) obj;
            if (str2 != null) {
                String str3 = this.d;
                int i3 = HomeFragment.aq;
                Intent intent = new Intent(homeFragment.requireContext(), (Class<?>) VideoPlayerActivity.class);
                intent.putExtra("title", str3);
                intent.putExtra("video_url", str2);
                homeFragment.startActivity(intent);
            } else {
                Toast.makeText(homeFragment.requireContext(), "Could not resolve stream", 0).show();
            }
        } catch (Exception e) {
            Log.e("HomeFragment", "Error playing debrid file: " + e.getMessage(), e);
            n41.aa(homeFragment.requireContext(), "Playback error: ", 0, e.getMessage());
        }
        return e6a.a;
    }
}
