package com.tencent.mm.plugin.appbrand.jsapi.live;

import android.os.Bundle;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.jsapi.e;
import com.tencent.mm.plugin.appbrand.jsapi.live.a.b;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.rtmp.ITXLivePlayListener;
import org.json.JSONException;
import org.json.JSONObject;

class a$8 implements ITXLivePlayListener {
    final /* synthetic */ e hCK;
    final /* synthetic */ int hCN;
    final /* synthetic */ a hLs;

    a$8(a aVar, int i, e eVar) {
        this.hLs = aVar;
        this.hCN = i;
        this.hCK = eVar;
    }

    public final void onPlayEvent(int i, Bundle bundle) {
        AppMethodBeat.i(96079);
        ab.i("MicroMsg.JsApiInsertLivePlayer", "onPlayEvent errCode:%d", new Object[]{Integer.valueOf(i)});
        a$c a_c = new a$c();
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("errCode", i);
            jSONObject.put("errMsg", bundle.getString("EVT_MSG"));
            jSONObject.put("livePlayerId", this.hCN);
        } catch (JSONException e) {
        }
        this.hCK.b(a_c.AM(jSONObject.toString()));
        AppMethodBeat.o(96079);
    }

    public final void onNetStatus(Bundle bundle) {
        AppMethodBeat.i(96080);
        b bVar = new b((byte) 0);
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("livePlayerId", this.hCN);
            JSONObject jSONObject2 = new JSONObject();
            if (bundle != null) {
                for (String str : bundle.keySet()) {
                    jSONObject2.put(str, bundle.get(str));
                }
            }
            jSONObject.put("info", jSONObject2);
        } catch (JSONException e) {
        }
        this.hCK.b(bVar.AM(jSONObject.toString()));
        AppMethodBeat.o(96080);
    }
}
