package com.bytedance.sdk.openadsdk.gqi.lb;

import org.json.JSONObject;

/* JADX INFO: loaded from: classes2.dex */
public class fm {
    public long ajl;
    public boolean fm;
    public long jnr;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    public boolean f7415lb;
    public boolean ro;
    public long wsy;
    public boolean yz;

    /* JADX INFO: renamed from: com.bytedance.sdk.openadsdk.gqi.lb.fm$fm, reason: collision with other inner class name */
    public interface InterfaceC0093fm {
        fm ajl();
    }

    public fm fm(long j10) {
        this.jnr = j10;
        return this;
    }

    public fm lb(long j10) {
        this.wsy = j10;
        return this;
    }

    public fm ro(long j10) {
        this.ajl = j10;
        return this;
    }

    public fm yz(boolean z10) {
        this.f7415lb = z10;
        return this;
    }

    public fm fm(boolean z10) {
        this.yz = z10;
        return this;
    }

    public fm lb(boolean z10) {
        this.ro = z10;
        return this;
    }

    public fm ro(boolean z10) {
        this.fm = z10;
        return this;
    }

    public JSONObject fm() {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("isCompleted", this.fm);
            jSONObject.put("isFromVideoDetailPage", this.ro);
            jSONObject.put("isFromDetailPage", this.f7415lb);
            jSONObject.put("duration", this.jnr);
            jSONObject.put("totalPlayDuration", this.ajl);
            jSONObject.put("currentPlayPosition", this.wsy);
            jSONObject.put("isAutoPlay", this.yz);
        } catch (Exception unused) {
        }
        return jSONObject;
    }

    public static fm fm(JSONObject jSONObject) {
        if (jSONObject == null) {
            return null;
        }
        fm fmVar = new fm();
        fmVar.ro(jSONObject.optBoolean("isCompleted"));
        fmVar.lb(jSONObject.optBoolean("isFromVideoDetailPage"));
        fmVar.yz(jSONObject.optBoolean("isFromDetailPage"));
        fmVar.fm(jSONObject.optLong("duration"));
        fmVar.ro(jSONObject.optLong("totalPlayDuration"));
        fmVar.lb(jSONObject.optLong("currentPlayPosition"));
        fmVar.fm(jSONObject.optBoolean("isAutoPlay"));
        return fmVar;
    }
}
