desc:modify
parent
f1ea0f998d
commit
abe7aed4d0
@ -1,39 +0,0 @@
|
||||
package com.yinuo.safetywatcher.player.utils;
|
||||
|
||||
import android.os.Environment;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class FileUtil {
|
||||
|
||||
private static String path = Environment.getExternalStorageDirectory() +"/EasyPlayerRro";
|
||||
|
||||
public static String getPicturePath() {
|
||||
return path + "/picture";
|
||||
}
|
||||
|
||||
public static File getSnapshotFile(String url) {
|
||||
File file = new File(getPicturePath() + urlDir(url));
|
||||
file.mkdirs();
|
||||
|
||||
file = new File(file, "snapshot.jpg");
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
public static String getMoviePath() {
|
||||
return path + "/movie";
|
||||
}
|
||||
|
||||
private static String urlDir(String url) {
|
||||
url = url.replace("://", "");
|
||||
url = url.replace("/", "");
|
||||
url = url.replace(".", "");
|
||||
|
||||
if (url.length() > 64) {
|
||||
url.substring(0, 63);
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
package com.yinuo.safetywatcher.player.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
public class SPUtil {
|
||||
|
||||
/* ============================ 使用MediaCodec解码 ============================ */
|
||||
private static final String KEY_SW_CODEC = "pref.using_media_codec";
|
||||
|
||||
public static boolean getMediaCodec(Context context) {
|
||||
return PreferenceManager.getDefaultSharedPreferences(context)
|
||||
.getBoolean(KEY_SW_CODEC, false);
|
||||
}
|
||||
|
||||
public static void setMediaCodec(Context context, boolean isChecked) {
|
||||
PreferenceManager.getDefaultSharedPreferences(context)
|
||||
.edit()
|
||||
.putBoolean(KEY_SW_CODEC, isChecked)
|
||||
.apply();
|
||||
}
|
||||
|
||||
/* ============================ KEY_UDP_MODE ============================ */
|
||||
private static final String KEY_UDP_MODE = "USE_UDP_MODE";
|
||||
|
||||
public static boolean getUDPMode(Context context) {
|
||||
return PreferenceManager.getDefaultSharedPreferences(context)
|
||||
.getBoolean(KEY_UDP_MODE, false);
|
||||
}
|
||||
|
||||
public static void setUDPMode(Context context, boolean isChecked) {
|
||||
PreferenceManager.getDefaultSharedPreferences(context)
|
||||
.edit()
|
||||
.putBoolean(KEY_UDP_MODE, isChecked)
|
||||
.apply();
|
||||
}
|
||||
|
||||
public static void setDefaultParams(Context context) {
|
||||
PreferenceManager.getDefaultSharedPreferences(context).edit()
|
||||
.putInt("timeout", 5)
|
||||
.putLong("analyzeduration", 21000000L)
|
||||
.apply();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue