package xyz.netfly.mobile.player;

import android.view.View;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import xyz.stream.api.entity.AudioEntity;
import xyz.stream.api.entity.VideoEntity;
import xyz.stream.view.OnItemListener;

/* JADX INFO: loaded from: classes3.dex */
public final class s implements OnItemListener, xyz.stream.utils.y {

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

    public /* synthetic */ s(t tVar) {
        this.f35006a = tVar;
    }

    public final void a(int i10) {
        t tVar = this.f35006a;
        if (tVar.f35014h.i(i10)) {
            xyz.netfly.mobile.plugin.e eVarC = xyz.netfly.mobile.plugin.e.c();
            String title = ((AudioEntity) tVar.f35014h.f().get(i10)).getTitle();
            eVarC.getClass();
            HashMap map = new HashMap();
            map.put("audioLanguage", title);
            map.put("subtitleLanguage", null);
            eVarC.f35064i.invokeMethod("saveLanguage", map);
        }
    }

    @Override // xyz.stream.utils.y
    public final void n(String str) {
        if (str == null || str.isEmpty()) {
            return;
        }
        try {
            this.f35006a.f35007a.runOnUiThread(new com.tekartik.sqflite.g(this, kotlinx.coroutines.y.l(Long.parseLong(str)), 6));
        } catch (Exception unused) {
        }
    }

    @Override // xyz.stream.view.OnItemListener
    public final void onItemClick(View view, int i10) {
        super.onItemClick(view, i10);
        t tVar = this.f35006a;
        w wVar = tVar.W;
        if (wVar != null) {
            ArrayList arrayList = tVar.O;
            int videoId = ((VideoEntity) arrayList.get(i10)).getVideoId();
            int sourceType = ((VideoEntity) arrayList.get(i10)).getSourceType();
            WeakReference weakReference = VideoDetailActivity.f34914n0;
            wVar.f35037a.U(videoId, sourceType);
        }
    }

    @Override // xyz.stream.utils.y
    public final void r(Exception exc) {
    }
}
