jimu-decompiled/sources/com/baidu/cloud/media/player/a/a.java
2025-05-13 19:24:51 +02:00

90 lines
2.3 KiB
Java

package com.baidu.cloud.media.player.a;
import android.content.Context;
import android.util.Log;
import com.baidu.cloud.media.player.BDCloudMediaPlayer;
import java.util.Random;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes.dex */
class a {
private String a;
private String b;
private String c = "";
private String d = BDCloudMediaPlayer.SDK_VERSION;
private String e = "sw";
private String f = "";
private e g;
private f h;
private c i;
private JSONObject j;
public a(Context context, String str) {
this.g = new e(context, str);
this.h = new f(context);
this.i = new c(context);
}
private String a(int i) {
Random random = new Random();
StringBuffer stringBuffer = new StringBuffer();
for (int i2 = 0; i2 < i; i2++) {
stringBuffer.append("abcdefghijklmnopqrstuvwxyz".charAt(random.nextInt(26)));
}
return stringBuffer.toString();
}
private String c() {
return ("" + System.currentTimeMillis()) + a(8);
}
public JSONObject a() {
if (this.j == null) {
this.j = new JSONObject();
try {
this.j.put("url", this.a);
this.j.put("vvid", this.b);
this.j.put("isLive", true);
this.j.put("playerVersion", this.d);
this.j.put("decodeMode", this.e);
this.j.put("ak", this.f);
this.j.put("bitrate", 0);
} catch (Exception e) {
Log.d("BaseInfo", "" + e.getMessage());
}
}
try {
this.j.put("playID", this.c);
} catch (JSONException e2) {
e2.printStackTrace();
}
return this.j;
}
public void a(String str) {
if (str == null || str.equals("")) {
return;
}
this.a = str;
this.b = c();
Log.i("BaseInfo", "Current vvid is:" + this.b);
this.j = null;
}
public void a(String str, String str2, String str3) {
this.d = str;
this.e = str2;
this.f = str3;
this.j = null;
}
public String b() {
return this.b;
}
public void b(String str) {
this.c = str;
}
}