public class LiveReportUtil
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static interface |
LiveReportUtil.UploadCallback |
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
DIR |
static int |
ERROR_CODE_DEFAULT
上传错误码
|
static int |
ERROR_CODE_EXCEPTION |
static int |
ERROR_CODE_FILE_NOT_EXIST |
static int |
ERROR_CODE_IMAGE_SIZE_INVALID |
static int |
ERROR_CODE_IMAGE_UPLOAD_ADDRESS_EMPTY |
static int |
ERROR_CODE_REQUEST_IMAGE_UPLOAD_ADDRESS_FAILED |
static int |
ERROR_CODE_UPLOAD_FAILED |
static int |
ERROR_CODE_VIDEO_DURATION_INVALID |
static int |
ERROR_CODE_VIDEO_SIZE_INVALID |
static int |
REQUEST_CODE_CHOOSE_IMAGE |
static int |
REQUEST_CODE_CHOOSE_VIDEO |
static java.lang.String |
TAG |
static int |
THRESHOLD_IMAGE_M |
static int |
THRESHOLD_VIDEO_M |
构造器和说明 |
---|
LiveReportUtil() |
限定符和类型 | 方法和说明 |
---|---|
static void |
chooseImageForResult(android.app.Activity activity)
打开相册选择图片
|
static void |
chooseImageForResult(androidx.fragment.app.Fragment fragment)
打开相册选择图片
|
static void |
chooseVideoForResult(android.app.Activity activity)
打开相册选择视频
|
static void |
chooseVideoForResult(androidx.fragment.app.Fragment fragment)
打开相册选择视频
|
static java.lang.String |
compressFileByUri(android.net.Uri imageUri)
对图片进行压缩
|
static void |
deleteFile(java.lang.String filePath) |
static java.lang.String |
getFileByUri(android.net.Uri imageUri,
int count)
对图片进行压缩
|
static void |
onImageSelect(android.net.Uri imageUri,
LiveReportUtil.UploadCallback callback)
选择图片后调用
|
static void |
onVideoSelect(android.net.Uri videoUri,
LiveReportUtil.UploadCallback callback)
从相册选择完视频后调用
|
static void |
uploadImage(android.net.Uri imageUri,
java.lang.String filePath,
java.lang.String uploadUrl,
java.lang.String imageUrl,
LiveReportUtil.UploadCallback callback)
开始上传图片
|
public static final java.lang.String TAG
public static final java.lang.String DIR
public static final int REQUEST_CODE_CHOOSE_VIDEO
public static final int REQUEST_CODE_CHOOSE_IMAGE
public static final int THRESHOLD_IMAGE_M
public static final int THRESHOLD_VIDEO_M
public static final int ERROR_CODE_DEFAULT
public static final int ERROR_CODE_FILE_NOT_EXIST
public static final int ERROR_CODE_IMAGE_SIZE_INVALID
public static final int ERROR_CODE_VIDEO_SIZE_INVALID
public static final int ERROR_CODE_EXCEPTION
public static final int ERROR_CODE_REQUEST_IMAGE_UPLOAD_ADDRESS_FAILED
public static final int ERROR_CODE_IMAGE_UPLOAD_ADDRESS_EMPTY
public static final int ERROR_CODE_UPLOAD_FAILED
public static final int ERROR_CODE_VIDEO_DURATION_INVALID
public static void chooseVideoForResult(androidx.fragment.app.Fragment fragment)
public static void chooseVideoForResult(android.app.Activity activity)
public static void chooseImageForResult(android.app.Activity activity)
public static void chooseImageForResult(androidx.fragment.app.Fragment fragment)
public static void onVideoSelect(android.net.Uri videoUri, LiveReportUtil.UploadCallback callback)
videoUri
- 视频的uri, 通过Intent.getData()
获取callback
- public static void onImageSelect(android.net.Uri imageUri, LiveReportUtil.UploadCallback callback)
imageUri
- 图片的uri, 通过Intent.getData()
获取callback
- public static java.lang.String compressFileByUri(android.net.Uri imageUri)
imageUri
- 图片的uripublic static java.lang.String getFileByUri(android.net.Uri imageUri, int count)
imageUri
- 图片的uripublic static void deleteFile(java.lang.String filePath)
public static void uploadImage(android.net.Uri imageUri, java.lang.String filePath, java.lang.String uploadUrl, java.lang.String imageUrl, LiveReportUtil.UploadCallback callback)
filePath
- 图片本地路径uploadUrl
- 图片上传地址imageUrl
- 图片上传成功后的访问地址callback
- 上传回调