|
@@ -11,6 +11,8 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.Page;
|
|
|
|
+import com.tencentcloudapi.vod.v20180717.models.MediaBasicInfo;
|
|
|
|
+import com.tencentcloudapi.vod.v20180717.models.MediaInfo;
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
@@ -32,6 +34,7 @@ import com.zhongzheng.modules.polyv.bo.PolyvLiveQueryBo;
|
|
import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
|
|
import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
|
|
import com.zhongzheng.modules.polyv.service.IPolyvVideoService;
|
|
import com.zhongzheng.modules.polyv.service.IPolyvVideoService;
|
|
import com.zhongzheng.modules.polyv.vo.PolyvVideoQuerVo;
|
|
import com.zhongzheng.modules.polyv.vo.PolyvVideoQuerVo;
|
|
|
|
+import com.zhongzheng.modules.tencentcloud.service.IVodService;
|
|
import net.polyv.live.v1.entity.chat.LiveGetMessageListResponse;
|
|
import net.polyv.live.v1.entity.chat.LiveGetMessageListResponse;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -82,6 +85,9 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
|
|
@Autowired
|
|
@Autowired
|
|
private IPolyvVideoService iPolyvVideoService;
|
|
private IPolyvVideoService iPolyvVideoService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IVodService iVodService;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private IPolyvLiveService iPolyvLiveService;
|
|
private IPolyvLiveService iPolyvLiveService;
|
|
|
|
|
|
@@ -354,15 +360,28 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(bo.getSectionType()==1){
|
|
if(bo.getSectionType()==1){
|
|
- try{
|
|
|
|
- PolyvVideoQuerVo poly = iPolyvVideoService.queryById(bo.getRecordingUrl());
|
|
|
|
- if(Validator.isNotEmpty(poly)){
|
|
|
|
- bo.setDurationTime(new Long(DateUtils.durationFormat(poly.getDuration())));
|
|
|
|
|
|
+ if(Validator.isEmpty(bo.getViewSign())||bo.getViewSign()==1){
|
|
|
|
+ try{
|
|
|
|
+ PolyvVideoQuerVo poly = iPolyvVideoService.queryById(bo.getRecordingUrl());
|
|
|
|
+ if(Validator.isNotEmpty(poly)){
|
|
|
|
+ bo.setDurationTime(new Long(DateUtils.durationFormat(poly.getDuration())));
|
|
|
|
+ }
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ errorLog+="第"+(size - Index)+"条:读取保利威时长错误。\r\n";
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ try{
|
|
|
|
+ MediaInfo mediaInfo = iVodService.describeMediaInfo(bo.getRecordingUrl());
|
|
|
|
+ if(Validator.isNotEmpty(mediaInfo)){
|
|
|
|
+ bo.setDurationTime(new Long(DateUtils.durationFormat(mediaInfo.getMetaData().getDuration().toString())));
|
|
|
|
+ }
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ errorLog+="第"+(size - Index)+"条:读取保利威时长错误。\r\n";
|
|
|
|
+ continue;
|
|
}
|
|
}
|
|
- }catch (Exception e){
|
|
|
|
- errorLog+="第"+(size - Index)+"条:读取保利威时长错误。\r\n";
|
|
|
|
- continue;
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
if(bo.getSectionType()==2){
|
|
if(bo.getSectionType()==2){
|
|
bo.setDurationTime(bo.getLiveEndTime().longValue() - bo.getLiveStartTime().longValue());
|
|
bo.setDurationTime(bo.getLiveEndTime().longValue() - bo.getLiveStartTime().longValue());
|