| | |
| | | package com.qxueyou.scc.stucontroller; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.*; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.qxueyou.scc.sdk.MTCloud; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | |
| | | /** |
| | | * 查看直播明细 |
| | | * @param liveId 直播id |
| | | * @param couresId 直播id |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "view") |
| | | public Result view(String liveId) { |
| | | |
| | | MediaVideoLive live = liveService.read(liveId); |
| | | |
| | | return new Result(true, "success", CollectionUtils.newObjectMap( |
| | | "startTime",live.getStartTime(), |
| | | "endTime",live.getEndTime(), |
| | | "name",live.getName(), |
| | | "hlsPullUrl",live.getHlsPullUrl(), |
| | | "imgPath",live.getPreviewImgUrl(), |
| | | "chatroomId",dao.getChatRoomId(liveId), |
| | | "remark",live.getRemark() |
| | | )); |
| | | public Result view(String couresId) throws Exception { |
| | | |
| | | |
| | | MTCloud client = new MTCloud(); |
| | | |
| | | HashMap<Object,Object> options = new HashMap<Object, Object>(); |
| | | |
| | | String res = client.courseAccess(couresId, ClientUtils.getUserId(), ClientUtils.getUserName(), MTCloud.ROLE_USER, 10000, options); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(res); |
| | | |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | | |
| | | String liveUrl = (String) data.get("liveUrl"); |
| | | |
| | | System.out.println(liveUrl); |
| | | |
| | | return new Result(true, "success",liveUrl); |
| | | } |
| | | } |