导航菜单

页面标题

页面副标题

MedEd v5.3.6 - YoutubePlayerActivity.java 源代码

正在查看: MedEd v5.3.6 应用的 YoutubePlayerActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.penpencil.physicswallah.feature.player.ui.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.widget.Toast;
import androidx.lifecycle.I;
import androidx.lifecycle.n;
import androidx.navigation.e;
import androidx.navigation.l;
import com.google.android.exoplayer2.source.hls.Lzda.WdNHw;
import com.penpencil.network.response.VideoStatsData;
import com.penpencil.player_engagement.live_chat.feature.mqtt.MqttConfigData;
import defpackage.ve2;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import kotlin.Metadata;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.internal.Intrinsics;
import kotlin.time.wTiX.HgwdN;

@Metadata
public final class YoutubePlayerActivity extends OR0<d7> implements eC3, sm2 {
    public static final int e1 = 0;
    public Je2 W0;
    public boolean X0;
    public ve2 Y0;
    public boolean Z0;
    public final Xc1 a1;
    public final Xc1 b1;
    public final dY2 c1;
    public final K0 d1;

    public YoutubePlayerActivity() {
        a aVar = a.i;
        ((OR0) this).V0 = false;
        addOnContextAvailableListener(new NR0(this));
        this.X0 = true;
        this.a1 = le1.b(new DT0(this, 20));
        this.b1 = le1.b(new Z53(this, 12));
        this.c1 = new dY2(this, 5);
        this.d1 = new K0(this, 4);
    }

    public static final String a1(YoutubePlayerActivity youtubePlayerActivity, String str) {
        jV1 jv1 = youtubePlayerActivity.M0;
        if (jv1 != null) {
            return Z93.a("mqtt/liveclass/", str, "/", jv1.c().A());
        }
        Intrinsics.n("networkManager");
        throw null;
    }

    public final void F0() {
        X0().W0 = true;
        hi.k(this);
        getWindow().getDecorView().setSystemUiVisibility(5382);
        setRequestedOrientation(6);
        getWindow().getDecorView().setSystemUiVisibility(5382);
        wm2.a.getClass();
        wm2.C.setValue(Boolean.TRUE);
        wm2.a();
    }

    public final void W0(Ur3 ur3) {
        d7 d7Var = (d7) ur3;
        Intrinsics.checkNotNullParameter(d7Var, "<this>");
        d7Var.x(this);
        d7Var.A(X0());
    }

    public final void Y0(Ur3 ur3, Et3 et3) {
        Intrinsics.checkNotNullParameter((d7) ur3, "<this>");
        Intrinsics.checkNotNullParameter((bf2) et3, "vm");
        c1();
        getOnBackPressedDispatcher().a(this, new mC3(this));
        n nVar = ((rp) this).F0;
        Intrinsics.checkNotNullExpressionValue(nVar, "lifecycleScope");
        Lx.q(nVar, (CoroutineContext) null, (mV) null, new oC3(this, (iT) null), 3);
    }

    public final void b1() {
        wm2.a.getClass();
        wm2.H = false;
        n nVar = ((rp) this).F0;
        Intrinsics.checkNotNullExpressionValue(nVar, "lifecycleScope");
        Lx.q(nVar, (CoroutineContext) null, (mV) null, new b(this, (iT) null), 3);
    }

    public final void c(String str, String str2) {
        if (str2 == null || str2.length() == 0) {
            return;
        }
        n nVar = ((rp) this).F0;
        Intrinsics.checkNotNullExpressionValue(nVar, "lifecycleScope");
        Lx.q(nVar, (CoroutineContext) null, (mV) null, new g(str, this, str2, (iT) null), 3);
    }

    public final void c1() {
        d7 U0 = U0();
        Intrinsics.d(U0);
        d7 d7Var = U0;
        Intrinsics.checkNotNullParameter(this, "owner");
        Qt3 viewModelStore = getViewModelStore();
        I.c c = Pt3.c(this);
        SW b = Pt3.b(this);
        Intrinsics.checkNotNullParameter(viewModelStore, "store");
        Intrinsics.checkNotNullParameter(c, "factory");
        Ot3 b2 = Yd.b(b, "defaultCreationExtras", viewModelStore, c, b);
        EG b3 = Y0.b(Vs.class, "modelClass", Vs.class, "<this>", Vs.class);
        Intrinsics.checkNotNullParameter(b3, "modelClass");
        Ot3.b(b2, b3);
        n nVar = ((rp) this).F0;
        Intrinsics.checkNotNullExpressionValue(nVar, "lifecycleScope");
        Lx.q(nVar, (CoroutineContext) null, (mV) null, new c(d7Var, this, (iT) null), 3);
        if (!getIntent().getBooleanExtra("showPlayerActionOnly", false)) {
            b1();
            return;
        }
        d7Var.w.setVisibility(8);
        n nVar2 = ((rp) this).F0;
        Intrinsics.checkNotNullExpressionValue(nVar2, "lifecycleScope");
        Lx.q(nVar2, (CoroutineContext) null, (mV) null, new d(this, (iT) null), 3);
        n nVar3 = ((rp) this).F0;
        Intrinsics.checkNotNullExpressionValue(nVar3, "lifecycleScope");
        Lx.q(nVar3, (CoroutineContext) null, (mV) null, new e(this, (iT) null), 3);
        n nVar4 = ((rp) this).F0;
        Intrinsics.checkNotNullExpressionValue(nVar4, "lifecycleScope");
        Lx.q(nVar4, (CoroutineContext) null, (mV) null, new f(this, (iT) null), 3);
    }

    public final void d0() {
    }

    public final void e0() {
    }

    public final void onBackPressed() {
        Zt2 zt2;
        List list;
        wm2.a.getClass();
        if (wm2.g0) {
            wm2.e0.j(Boolean.FALSE);
            wm2.g0 = false;
            return;
        }
        if (X0().W0 && !getResources().getBoolean(2131034120)) {
            U0().w.a.e.b();
            wm2.b();
            return;
        }
        Xc1 xc1 = this.b1;
        e eVar = (e) xc1.getValue();
        if (eVar != null && (zt2 = eVar.i) != null && (list = (List) zt2.b.getValue()) != null && list.size() > 2) {
            e eVar2 = (e) xc1.getValue();
            if (eVar2 != null) {
                eVar2.x();
                return;
            }
            return;
        }
        if (this.O0) {
            Z0().i(this.Q0);
            this.O0 = false;
        }
        X0().n();
        X0().N1.j(Boolean.TRUE);
        finish();
    }

    public final void onCreate(Bundle bundle) {
        super/*rC3*/.onCreate(bundle);
        wm2.a.getClass();
        wm2.f();
    }

    public final void onDestroy() {
        ve2 ve2Var = this.Y0;
        if (ve2Var == null) {
            Intrinsics.n("playerMqttServiceHelper");
            throw null;
        }
        ve2Var.b();
        super/*xP0*/.onDestroy();
    }

    public final void onNewIntent(Intent intent) {
        Intrinsics.checkNotNullParameter(intent, "intent");
        super/*OL*/.onNewIntent(intent);
        c1();
    }

    public final void onPause() {
        super/*rC3*/.onPause();
        wm2.a.getClass();
        wm2.i();
    }

    public final void onResume() {
        super/*androidx.fragment.app.e*/.onResume();
    }

    public final void onStart() {
        YB3 yb3;
        super/*rp*/.onStart();
        if (this.P0 != null) {
            jV1 jv1 = this.M0;
            if (jv1 == null) {
                Intrinsics.n("networkManager");
                throw null;
            }
            bp1 c = jv1.c();
            c.getClass();
            if (c.a.j(a.B0, -1L) == -1 || (yb3 = this.P0) == null) {
                return;
            }
            jV1 jv12 = this.M0;
            if (jv12 == null) {
                Intrinsics.n("networkManager");
                throw null;
            }
            jv12.c().getClass();
            yb3.a(r1.a.j(r3, -1L));
        }
    }

    public final void onStop() {
        super/*ag*/.onStop();
        X0().D(this.Q0);
        Z0().l(this.Q0);
        jr3 Z0 = Z0();
        n nVar = ((rp) this).F0;
        Intrinsics.checkNotNullExpressionValue(nVar, "lifecycleScope");
        Z0.k(nVar);
    }

    public final void s0() {
        if (getResources().getBoolean(2131034120)) {
            return;
        }
        X0().W0 = false;
        hi.k(this);
        setRequestedOrientation(1);
        getWindow().getDecorView().setSystemUiVisibility(0);
        vz3 i = us3.i(getWindow().getDecorView());
        if (i != null) {
            e eVar = i.a;
            eVar.e();
            eVar.a(7);
        }
        wm2.a.getClass();
        wm2.C.setValue(Boolean.FALSE);
        wm2.b();
    }

    public final void w(YB3 yb3, ke2 ke2Var) {
        Intrinsics.checkNotNullParameter(yb3, "youTubePlayer");
        Intrinsics.checkNotNullParameter(ke2Var, "playerState");
        if (ke2Var == ke2.d) {
            n nVar = ((rp) this).F0;
            Intrinsics.checkNotNullExpressionValue(nVar, "lifecycleScope");
            Lx.q(nVar, (CoroutineContext) null, (mV) null, new sC3(this, (iT) null), 3);
            return;
        }
        if (ke2Var == ke2.e) {
            if (this.O0) {
                Z0().i(this.Q0);
                this.O0 = false;
                return;
            }
            return;
        }
        if (ke2Var != ke2.c) {
            if (ke2Var == ke2.f && this.O0) {
                Z0().i(this.Q0);
                this.O0 = false;
                return;
            }
            return;
        }
        VideoStatsData videoStatsData = Z0().f;
        if (videoStatsData != null) {
            videoStatsData.setComplete(true);
        }
        Z0().e(this.R0 / 1000);
        if (this.O0) {
            Z0().i(this.Q0);
            this.O0 = false;
        }
    }

    public final void x(YB3 yb3, je2 je2Var) {
        Intrinsics.checkNotNullParameter(yb3, "youTubePlayer");
        Intrinsics.checkNotNullParameter(je2Var, "playerError");
        Toast.makeText((Context) this, (CharSequence) "Some error occurred while playing video", 0).show();
        je2Var.toString();
    }

    public final void y0() {
    }

    public final void V0(Ur3 ur3) {
        Object obj;
        d7 d7Var = (d7) ur3;
        Intrinsics.checkNotNullParameter(d7Var, "<this>");
        e eVar = (e) this.b1.getValue();
        if (eVar != null) {
            l b = eVar.p().b(2131820548);
            if (X0().q() != null || ((Boolean) X0().k0.getValue()).booleanValue()) {
                b.L(2131363277);
            } else {
                b.L(2131363446);
            }
            eVar.H(b, getIntent().getExtras());
        }
        n nVar = ((rp) this).F0;
        Intrinsics.checkNotNullExpressionValue(nVar, "lifecycleScope");
        Lx.q(nVar, (CoroutineContext) null, (mV) null, new kC3(d7Var, this, (iT) null), 3);
        Kv0 a = kw2.a();
        mw2 mw2Var = mw2.a;
        String g = a.h.g(HgwdN.CPu);
        Intrinsics.checkNotNullExpressionValue(g, "getString(...)");
        if (g.length() != 0) {
            try {
                obj = pK0.a.f(g, pK0.e(MqttConfigData.class));
            } catch (k61 e) {
                TJ0.b("Parse Error (fromJsonToObject): Model Class :: ", MqttConfigData.class, " ", e);
                obj = null;
            }
            MqttConfigData mqttConfigData = (MqttConfigData) obj;
            if (mqttConfigData != null) {
                this.X0 = mqttConfigData.isEnabled();
            }
        }
        X0().o();
        if (this.X0 && X0().t().isLive()) {
            n nVar2 = ((rp) this).F0;
            Intrinsics.checkNotNullExpressionValue(nVar2, "lifecycleScope");
            Lx.q(nVar2, (CoroutineContext) null, (mV) null, new lC3(this, (iT) null), 3);
        }
    }

    public final void e(YB3 yb3) {
        Intrinsics.checkNotNullParameter(yb3, WdNHw.EApdJlJ);
        String videoUrl = X0().t().getVideoUrl();
        String str = "";
        if (!TextUtils.isEmpty(videoUrl)) {
            Pattern compile = Pattern.compile("(?<=watch\\?v=|/videos/|embed\\/|youtu.be\\/|\\/v\\/|\\/e\\/|watch\\?v%3D|watch\\?feature=player_embedded&v=|%2Fvideos%2F|embed%\u200c\u200b2F|youtu.be%2F|%2Fv%2F)[^#\\&\\?\\n]*");
            Intrinsics.checkNotNullExpressionValue(compile, "compile(...)");
            Matcher matcher = compile.matcher(videoUrl);
            Intrinsics.checkNotNullExpressionValue(matcher, "matcher(...)");
            if (matcher.find()) {
                str = matcher.group();
            }
        }
        if (str == null) {
            Toast.makeText((Context) this, (CharSequence) getString(2132018186), 0).show();
            finish();
        }
        this.P0 = yb3;
        Je2 je2 = this.W0;
        if (je2 == null) {
            Intrinsics.n("playerUiController");
            throw null;
        }
        je2.b();
        Je2 je22 = this.W0;
        if (je22 == null) {
            Intrinsics.n("playerUiController");
            throw null;
        }
        je22.c();
        if (this.Z0) {
            this.Z0 = false;
        }
        wm2.a.getClass();
        wm2.H = true;
        n nVar = ((rp) this).F0;
        Intrinsics.checkNotNullExpressionValue(nVar, "lifecycleScope");
        Lx.q(nVar, (CoroutineContext) null, (mV) null, new h(this, yb3, str, (iT) null), 3);
    }
}