120 lines
3.5 KiB
Java
120 lines
3.5 KiB
Java
package com.ubt.jimu.widgets.player.info;
|
|
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
import com.tencent.open.SocialConstants;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class VideoInfo implements Parcelable {
|
|
public static final Parcelable.Creator<VideoInfo> CREATOR = new Parcelable.Creator<VideoInfo>() { // from class: com.ubt.jimu.widgets.player.info.VideoInfo.1
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // android.os.Parcelable.Creator
|
|
public VideoInfo createFromParcel(Parcel parcel) {
|
|
String readString = parcel.readString();
|
|
String readString2 = parcel.readString();
|
|
String readString3 = parcel.readString();
|
|
boolean[] zArr = new boolean[1];
|
|
parcel.readBooleanArray(zArr);
|
|
VideoInfo videoInfo = new VideoInfo(readString, readString2);
|
|
videoInfo.setImageUrl(readString3);
|
|
videoInfo.setCanDelete(zArr[0]);
|
|
return videoInfo;
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // android.os.Parcelable.Creator
|
|
public VideoInfo[] newArray(int i) {
|
|
return new VideoInfo[i];
|
|
}
|
|
};
|
|
private String title;
|
|
private String url;
|
|
private String imageUrl = "";
|
|
private boolean canDelete = true;
|
|
|
|
public VideoInfo(String str, String str2) {
|
|
this.title = "";
|
|
this.url = "";
|
|
this.title = str;
|
|
this.url = str2;
|
|
}
|
|
|
|
public static VideoInfo fromJson(JSONObject jSONObject) {
|
|
VideoInfo videoInfo;
|
|
try {
|
|
videoInfo = new VideoInfo(jSONObject.getString("title"), jSONObject.getString("url"));
|
|
try {
|
|
videoInfo.setImageUrl(jSONObject.optString(SocialConstants.PARAM_IMAGE_URL, ""));
|
|
videoInfo.setCanDelete(jSONObject.optBoolean("canDelete", true));
|
|
} catch (Exception e) {
|
|
e = e;
|
|
e.printStackTrace();
|
|
return videoInfo;
|
|
}
|
|
} catch (Exception e2) {
|
|
e = e2;
|
|
videoInfo = null;
|
|
}
|
|
return videoInfo;
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public int describeContents() {
|
|
return 0;
|
|
}
|
|
|
|
public String getImageUrl() {
|
|
return this.imageUrl;
|
|
}
|
|
|
|
public String getTitle() {
|
|
return this.title;
|
|
}
|
|
|
|
public String getUrl() {
|
|
return this.url;
|
|
}
|
|
|
|
public boolean isCanDelete() {
|
|
return this.canDelete;
|
|
}
|
|
|
|
public void setCanDelete(boolean z) {
|
|
this.canDelete = z;
|
|
}
|
|
|
|
public void setImageUrl(String str) {
|
|
this.imageUrl = str;
|
|
}
|
|
|
|
public void setTitle(String str) {
|
|
this.title = str;
|
|
}
|
|
|
|
public void setUrl(String str) {
|
|
this.url = str;
|
|
}
|
|
|
|
public JSONObject toJson() {
|
|
JSONObject jSONObject = new JSONObject();
|
|
try {
|
|
jSONObject.put("url", this.url);
|
|
jSONObject.put("title", this.title);
|
|
jSONObject.put(SocialConstants.PARAM_IMAGE_URL, this.imageUrl);
|
|
jSONObject.put("canDelete", this.canDelete);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
return jSONObject;
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
parcel.writeString(this.title);
|
|
parcel.writeString(this.url);
|
|
parcel.writeString(this.imageUrl);
|
|
parcel.writeBooleanArray(new boolean[]{this.canDelete});
|
|
}
|
|
}
|