package com.bytedance.android.livesdk.browser.jsbridge.newmethods;

import X.0aP;
import X.0cm;
import X.C2718Ggh;
import X.KLg;
import X.KMH;
import X.M12;
import com.bytedance.android.livesdkapi.host.IHostSubscription;
import com.bytedance.covode.number.Covode;
import kotlin.h.b.n;
import org.json.JSONObject;

public final class OpenVideoFullScreenMethod extends KMH<JSONObject, JSONObject> {
    static {
        Covode.recordClassIndex(13023);
    }

    public final void onTerminate() {
    }

    public final void invoke(JSONObject jSONObject, KLg kLg) {
        M12.LIZ(jSONObject, kLg);
        JSONObject jSONObject2 = new JSONObject();
        int optInt = jSONObject.optInt("current_position");
        boolean optBoolean = jSONObject.optBoolean("is_mute");
        boolean optBoolean2 = jSONObject.optBoolean("is_pause");
        String optString = jSONObject.optString("video_url");
        jSONObject.optString("from_page");
        boolean optBoolean3 = jSONObject.optBoolean("is_auto_play", true);
        int optInt2 = jSONObject.optInt("video_len");
        n.LIZIZ(optString, "");
        if (optString.length() == 0) {
            finishWithFailure();
        }
        try {
            IHostSubscription LIZ = 0cm.LIZ(IHostSubscription.class);
            if (LIZ == null) {
                finishWithFailure();
            }
            LIZ.LIZ(kLg.LIZ, optString, optInt2, optBoolean3, optInt, optBoolean2, optBoolean, new C2718Ggh());
        } catch (Exception e) {
            0aP.LIZ("openVideoFullScreenMethod", e);
        }
        jSONObject2.put("code", 1);
        finishWithResult(jSONObject2);
    }
}
