package com.ysvideo.zhibo.app.util.video;
|
|
|
import com.ysvideo.zhibo.app.entity.video.VideoResource;
|
import com.ysvideo.zhibo.lib.common.util.common.StringUtils;
|
|
import java.text.DecimalFormat;
|
import java.util.List;
|
|
public class VideoUtil {
|
|
public static String getWatchCountShortName(String watchCount) {
|
DecimalFormat df = new DecimalFormat("###.0");
|
try {
|
return (StringUtils.isBlank(watchCount) ? "0" : (Integer.parseInt(watchCount)) / 10000 > 0 ? df.format(Integer.parseInt(watchCount) / 10000f) + "万" : watchCount);
|
} catch (Exception e) {
|
}
|
return "";
|
}
|
|
/**
|
* 获取选中的资源
|
*
|
* @param resourceList
|
* @return
|
*/
|
|
public static VideoResource getSelectedResource(List<VideoResource> resourceList) {
|
|
for (VideoResource resource : resourceList) {
|
if (resource.isChecked()) {
|
return resource;
|
}
|
}
|
return null;
|
}
|
|
|
}
|