| | |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.exception.video.VideoPlayException; |
| | | import com.yeshi.buwan.service.inter.video.VideoResourcePlayVersionMapService; |
| | | import com.yeshi.buwan.service.manager.APPManager; |
| | | import com.yeshi.buwan.util.JuHe.VideoResourceUtil; |
| | | import com.yeshi.buwan.videos.acFun.AcFunUtil; |
| | | import com.yeshi.buwan.dao.VideoInfoDao; |
| | |
| | | |
| | | @Resource |
| | | private BilibiliUtil bilibiliUtil; |
| | | |
| | | @Resource |
| | | private APPManager appManager; |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | // @Cacheable(value = "homeCache", key = "'getVideoInfo'+'-'+#videoid+'-'+#resourceId+'-'+#cacheMD5") |
| | |
| | | return solrShortVideoDataManager.getPlayUrl(id, vr); |
| | | } |
| | | |
| | | String oldId = id; |
| | | if (id.startsWith("native_")) { |
| | | id = id.replace("native_", ""); |
| | | } |
| | | |
| | | |
| | | PlayUrl playUrl = null; |
| | | |
| | | switch (resourceid) { |
| | | case IqiyiUtil2.RESOURCE_ID: |
| | | return iqiyi2Service.getPlayUrl(detailSystemId, resourceid, id, videoid); |
| | | playUrl = iqiyi2Service.getPlayUrl(detailSystemId, resourceid, id, videoid); |
| | | break; |
| | | case IqiyiUtil.RESOURCE_ID: |
| | | return iqiyiUtil.getPlayUrl(detailSystemId, resourceid + "", type, id); |
| | | playUrl = iqiyiUtil.getPlayUrl(detailSystemId, resourceid + "", type, id); |
| | | break; |
| | | case FunTVUtil2.RESOURCE_ID: |
| | | return funTV2Service.getPlayUrl(acceptData, detailSystemId, resourceid, id, videoid); |
| | | playUrl = funTV2Service.getPlayUrl(acceptData, detailSystemId, resourceid, id, videoid); |
| | | break; |
| | | case FunTVUtil.RESOURCE_ID: |
| | | return funTVService.getPlayUrl(detailSystemId, id, type, resourceid, videoid); |
| | | playUrl = funTVService.getPlayUrl(detailSystemId, id, type, resourceid, videoid); |
| | | break; |
| | | case SoHuUtil.RESOURCE_ID: |
| | | return soHuUtil.getPlayUrl(detailSystemId, resourceid + "", type, id); |
| | | playUrl = soHuUtil.getPlayUrl(detailSystemId, resourceid + "", type, id); |
| | | break; |
| | | case AcFunUtil.RESOURCE_ID: |
| | | return videoInfoService.getPlayUrl(detailSystemId, id, type, resourceid, videoid); |
| | | playUrl = videoInfoService.getPlayUrl(detailSystemId, id, type, resourceid, videoid); |
| | | break; |
| | | case YouKuUtil.RESOURCE_ID: |
| | | return youKuUtil.getPlayUrl(detailSystemId, id, type, resourceid, videoid); |
| | | playUrl = youKuUtil.getPlayUrl(detailSystemId, id, type, resourceid, videoid); |
| | | break; |
| | | case MogoTVUtil.RESOURCE_ID: |
| | | return mogoTVUtil.getPlayUrl(detailSystemId, id, type, resourceid, videoid); |
| | | playUrl = mogoTVUtil.getPlayUrl(detailSystemId, id, type, resourceid, videoid); |
| | | break; |
| | | case TencentVideoUtil.RESOURCE_ID: |
| | | return tencentVideoUtil.getPlayUrl(detailSystemId, id, type, resourceid, videoid); |
| | | playUrl = tencentVideoUtil.getPlayUrl(detailSystemId, id, type, resourceid, videoid); |
| | | break; |
| | | case BilibiliUtil.RESOURCE_ID: |
| | | return bilibiliUtil.getPlayUrl(detailSystemId, id, type, resourceid, videoid); |
| | | playUrl = bilibiliUtil.getPlayUrl(detailSystemId, id, type, resourceid, videoid); |
| | | break; |
| | | case HanmiUtil.RESOURCE_ID: |
| | | return hanmiService.getPlayUrl(detailSystemId, resourceid, id, videoid); |
| | | playUrl = hanmiService.getPlayUrl(detailSystemId, resourceid, id, videoid); |
| | | break; |
| | | default: |
| | | throw new VideoPlayException(2, "未知播放源"); |
| | | } |
| | | |
| | | if (playUrl != null) { |
| | | //韩剧 |
| | | if ("48".equalsIgnoreCase(acceptData.getDetailSystem().getId())) { |
| | | //正在上线 |
| | | //TODO 上线的时候开启,防止误操作 |
| | | // if (appManager.isOnline(acceptData.getDetailSystem().getId(), acceptData.getVersion(), acceptData.getChannel())) { |
| | | // //需要原生播放器 |
| | | // if (oldId != null && oldId.startsWith("native_")) { |
| | | // if (playUrl.getPlayType() == 1) { |
| | | // //原生播放器播放 |
| | | // playUrl.setPlayType(2); |
| | | // playUrl.setUrl("https://jx.parwix.com:4433/player/?url=" + playUrl.getUrl()); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | } |
| | | |
| | | return playUrl; |
| | | |
| | | |
| | | } |
| | | |
| | | } |