package com.iab.omid.library.bytedance2.adsession.media;

import com.iab.omid.library.bytedance2.utils.d;
import com.iab.omid.library.bytedance2.utils.g;
import org.json.JSONException;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes.dex */
public final class VastProperties {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final boolean f24429a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final Float f24430b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private final boolean f24431c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private final Position f24432d;

    private VastProperties(boolean z10, Float f10, boolean z11, Position position) {
        this.f24429a = z10;
        this.f24430b = f10;
        this.f24431c = z11;
        this.f24432d = position;
    }

    public static VastProperties createVastPropertiesForNonSkippableMedia(boolean z10, Position position) {
        g.a(position, "Position is null");
        return new VastProperties(false, null, z10, position);
    }

    public static VastProperties createVastPropertiesForSkippableMedia(float f10, boolean z10, Position position) {
        g.a(position, "Position is null");
        return new VastProperties(true, Float.valueOf(f10), z10, position);
    }

    public JSONObject a() {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("skippable", this.f24429a);
            if (this.f24429a) {
                jSONObject.put("skipOffset", this.f24430b);
            }
            jSONObject.put("autoPlay", this.f24431c);
            jSONObject.put("position", this.f24432d);
        } catch (JSONException e10) {
            d.a("VastProperties: JSON error", e10);
        }
        return jSONObject;
    }

    public Position getPosition() {
        return this.f24432d;
    }

    public Float getSkipOffset() {
        return this.f24430b;
    }

    public boolean isAutoPlay() {
        return this.f24431c;
    }

    public boolean isSkippable() {
        return this.f24429a;
    }
}
