Commit 543bc3d25fc01b1ffbef8e8f7f16b8abe3260649
1 parent
df6bba2a
点播时长换算单位
Showing
1 changed file
with
4 additions
and
3 deletions
src/main/java/com/cnlive/shenhe/api/VideosControllerApi.java
| ... | ... | @@ -72,6 +72,8 @@ public class VideosControllerApi { |
| 72 | 72 | //g得到视频id去查询是否已有 |
| 73 | 73 | String videoId = json.getString("videoId"); |
| 74 | 74 | shyVideos1.setVideo_id(videoId); |
| 75 | + Integer duration = json.getInteger("duration"); | |
| 76 | + if (CommonUtils.isNotNull(duration)) duration = duration / 1000; | |
| 75 | 77 | //查询一下 存在,更新 没有,插入 |
| 76 | 78 | List<ShyVideos> listshyVideos = videosService.findshyVideo(shyVideos1); |
| 77 | 79 | if (listshyVideos.size() > 0) { |
| ... | ... | @@ -96,7 +98,7 @@ public class VideosControllerApi { |
| 96 | 98 | shyVideos.setState(CommonConst.AUDIT_INTT); |
| 97 | 99 | shyVideos.setBucket(json.getString("bucketName")); |
| 98 | 100 | shyVideos.setPlat(json.getInteger("bucketType")); |
| 99 | - shyVideos.setDuration(json.getInteger("duration")); | |
| 101 | + shyVideos.setDuration(duration); | |
| 100 | 102 | boolean YorN = videosService.updateshyVideos(shyVideos); |
| 101 | 103 | if (YorN == true) { |
| 102 | 104 | return new ResponseBean(ErrorEnum.SUCCESS); |
| ... | ... | @@ -111,7 +113,7 @@ public class VideosControllerApi { |
| 111 | 113 | shyVideos1.setVideo_imgs(videoCoverUrl); |
| 112 | 114 | if (CommonUtils.isNotEmpty(videoCoverUrl)) { |
| 113 | 115 | String poster = json.getJSONObject("videoCoverUrl").getString("224*126"); |
| 114 | - if(CommonUtils.isEmpty(poster)){ | |
| 116 | + if (CommonUtils.isEmpty(poster)) { | |
| 115 | 117 | //ugc短视频只有一张图片 |
| 116 | 118 | poster = json.getJSONObject("videoCoverUrl").getString("key"); |
| 117 | 119 | } |
| ... | ... | @@ -127,7 +129,6 @@ public class VideosControllerApi { |
| 127 | 129 | shyVideos1.setState(CommonConst.AUDIT_INTT); |
| 128 | 130 | shyVideos1.setBucket(json.getString("bucketName")); |
| 129 | 131 | shyVideos1.setPlat(json.getInteger("bucketType")); |
| 130 | - Integer duration = json.getInteger("duration"); | |
| 131 | 132 | shyVideos1.setDuration(duration); |
| 132 | 133 | if (CommonUtils.isNotNull(duration) && duration > 80) { |
| 133 | 134 | shyVideos1 = avsample(shyVideos1);//视频至少可以抽8张,请求抽帧 | ... | ... |