package com.ss.android.ugc.aweme.discover.ui.search.jsbridge.bullet;

import X.0CB;
import X.0CH;
import X.0HH;
import X.1hK;
import X.4UQ;
import X.6Is;
import X.7TD;
import X.7cy;
import X.7hA;
import X.7he;
import X.8Du;
import X.8Fb;
import X.8YM;
import X.C3276SSa;
import X.C3277SSb;
import X.C3278SSc;
import X.C3279SSd;
import X.C3280SSe;
import X.C3283SSh;
import X.C3799Sf5;
import X.Crj;
import X.KOx;
import X.KT7;
import X.KT8;
import X.M12;
import android.content.Context;
import android.content.ContextWrapper;
import android.view.View;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.bullet.bridge.BaseBridgeMethod;
import com.ss.android.ugc.aweme.discover.helper.MusicPlayHelper;
import com.ss.android.ugc.aweme.music.model.Music;
import com.ss.android.ugc.aweme.player.sdk.api.OnUIPlayListener;
import com.ss.android.ugc.aweme.utils.GsonHolder;
import com.ss.android.ugc.aweme.utils.GsonProvider;
import java.lang.reflect.Type;
import kotlin.h.b.n;
import org.json.JSONArray;
import org.json.JSONObject;

public final class PlayMusicBridge extends BaseBridgeMethod implements 6Is, 8Du {
    public static final C3283SSh LIZIZ = new C3283SSh((byte) 0);
    public final Crj LIZJ;
    public final Crj LIZLLL;
    public final Crj LJ = 7he.LIZ(new C3276SSa(this));
    public final String LJFF = "playMusic";

    static {
        Covode.recordClassIndex(65934);
    }

    public final void LIZ(int i) {
    }

    public final void LIZJ() {
    }

    public final boolean LJIIIZ() {
        return false;
    }

    public final KT8<Context> LJIIJJI() {
        return (KT8) this.LIZJ.getValue();
    }

    public final KT8<KOx> LJIIL() {
        return (KT8) this.LIZLLL.getValue();
    }

    public final MusicPlayHelper LJIILIIL() {
        return (MusicPlayHelper) this.LJ.getValue();
    }

    public final View LJIJJLI() {
        return null;
    }

    public final void LJIL() {
    }

    public final void LJJI() {
    }

    public final void LJJIFFI() {
    }

    public final void LJJII() {
    }

    public final OnUIPlayListener getWrapperedListener() {
        return null;
    }

    public final void onBufferedPercent(String str, long j, int i) {
    }

    public final void onBufferedTimeMs(String str, long j) {
    }

    public final void onBuffering(String str, boolean z) {
    }

    public final void onBuffering(String str, boolean z, 7TD r3) {
    }

    public final void onBuffering(boolean z) {
    }

    public final void onCompleteLoaded(String str, boolean z) {
    }

    public final void onDecoderBuffering(String str, boolean z) {
    }

    public final void onDecoderBuffering(String str, boolean z, 7TD r3) {
    }

    public final void onDecoderBuffering(boolean z) {
    }

    public final void onPausePlay(String str) {
    }

    public final void onPausePlay(String str, 7TD r2) {
    }

    public final void onPlayCompleted(String str) {
    }

    public final void onPlayCompleted(String str, int i) {
    }

    public final void onPlayCompletedFirstTime(String str) {
    }

    public final void onPlayCompletedFirstTime(String str, 7TD r2) {
    }

    public final void onPlayFailed(7cy r1) {
    }

    public final void onPlayFailed(String str, 7cy r2) {
    }

    public final void onPlayFailed(String str, 7cy r2, 7TD r3) {
    }

    public final void onPlayPause(String str) {
    }

    public final void onPlayPrepare(String str) {
    }

    public final void onPlayProgressChange(float f) {
    }

    public final void onPlayProgressChange(String str, long j, long j2) {
    }

    public final void onPlayRelease(String str) {
    }

    public final void onPlayStop(String str) {
    }

    public final void onPlayStop(String str, JSONObject jSONObject) {
    }

    public final void onPlayStop(String str, JSONObject jSONObject, 7TD r3) {
    }

    public final void onPlayStop(String str, boolean z) {
    }

    public final void onPlayerInternalEvent(String str, int i, JSONObject jSONObject) {
    }

    public final void onPlaying(String str) {
    }

    public final void onPlaying(String str, 7TD r2) {
    }

    public final void onPreRenderSessionMissed(String str) {
    }

    public final void onPreparePlay(String str) {
    }

    public final void onPreparePlay(String str, 7TD r2) {
    }

    public final void onRenderFirstFrame(8Fb r1) {
    }

    public final void onRenderFirstFrame(String str, 8Fb r2) {
    }

    public final void onRenderFirstFrameFromResume(String str) {
    }

    public final void onRenderReady(7TD r1) {
    }

    public final void onResumePlay(String str) {
    }

    public final void onResumePlay(String str, 7TD r2) {
    }

    public final void onRetryOnError(7cy r1) {
    }

    public final void onRetryOnError(String str, 7cy r2) {
    }

    public final void onSeekEnd(String str, boolean z) {
    }

    public final void onSeekStart(String str, int i, float f) {
    }

    public final void onStateChanged(0CH r1, 0CB r2) {
        PlayMusicBridge.super.onStateChanged(r1, r2);
    }

    public final void onVideoBitrateChanged(String str, 8YM r2, int i) {
    }

    public final void onVideoSizeChanged(String str, int i, int i2) {
    }

    public final String LIZLLL() {
        return this.LJFF;
    }

    public final void LJJ() {
        MusicPlayHelper LJIILIIL = LJIILIIL();
        if (LJIILIIL != null) {
            LJIILIIL.LIZ();
        }
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public PlayMusicBridge(KT7 kt7) {
        super(kt7);
        M12.LIZ(kt7);
        this.LIZJ = 7he.LIZ(new C3277SSb(kt7));
        this.LIZLLL = 7he.LIZ(new C3278SSc(kt7));
    }

    public final void LIZ(JSONObject jSONObject, 4UQ r13) {
        Context context;
        M12.LIZ(jSONObject, r13);
        try {
            String optString = jSONObject.optString("music");
            JSONObject optJSONObject = jSONObject.optJSONObject("music_extra");
            if (optString != null && optJSONObject != null) {
                Type type = new C3279SSd().type;
                GsonProvider LIZJ2 = GsonHolder.LIZJ();
                n.LIZIZ(LIZJ2, "");
                Object LIZ = LIZJ2.LIZIZ().LIZ(optString, type);
                n.LIZIZ(LIZ, "");
                Music music = (Music) LIZ;
                music.setId(optJSONObject.optLong("id"));
                MusicPlayHelper LJIILIIL = LJIILIIL();
                if (LJIILIIL != null) {
                    if (LJIILIIL.LIZ(music.getId()) || LJIILIIL.LIZIZ(music.getId())) {
                        C3799Sf5.LIZIZ.LIZIZ(this);
                        LJIILIIL.LIZ();
                    } else {
                        KT8<Context> LJIIJJI = LJIIJJI();
                        if (LJIIJJI != null && (context = (Context) LJIIJJI.LIZIZ()) != null) {
                            while (true) {
                                if (context != null) {
                                    if (!(context instanceof 1hK)) {
                                        if (!(context instanceof ContextWrapper)) {
                                            break;
                                        }
                                        context = ((ContextWrapper) context).getBaseContext();
                                    } else {
                                        1hK r4 = (1hK) context;
                                        if (r4 != null) {
                                            C3799Sf5.LIZIZ.LIZ(this);
                                            C3799Sf5.LIZIZ.LIZJ(this);
                                            C3799Sf5.LIZIZ.LIZLLL(this);
                                            LJIILIIL.LIZ(r4, new C3280SSe(this, music, optJSONObject));
                                            LJIILIIL.LIZ(r4, music, "", 0, true, true, "");
                                        }
                                    }
                                } else {
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            r13.LIZ(new JSONArray());
        } catch (Exception e) {
            7hA.LIZ.LIZ(e, "ShowEasterEggMethod");
            r13.LIZ(0, e.getMessage());
            0HH.LIZ(e);
        }
    }
}
