Commit 273cb05b645e697f4b7c469ae0623c5833492517

Authored by 刘基城
1 parent d256d569

修改 app播放

.classpath
... ... @@ -24,9 +24,9 @@
24 24 <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
25 25 </attributes>
26 26 </classpathentry>
27   - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
  27 + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
28 28 <attributes>
29   - <attribute name="owner.project.facets" value="java"/>
  29 + <attribute name="maven.pomderived" value="true"/>
30 30 </attributes>
31 31 </classpathentry>
32 32 <classpathentry kind="output" path="target/classes"/>
... ...
.settings/org.eclipse.jdt.core.prefs
1 1 eclipse.preferences.version=1
2 2 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 3 org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4   -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
  4 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
5 5 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6   -org.eclipse.jdt.core.compiler.compliance=1.7
  6 +org.eclipse.jdt.core.compiler.compliance=1.6
7 7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8 8 org.eclipse.jdt.core.compiler.debug.localVariable=generate
9 9 org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10 10 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11 11 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12 12 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
13   -org.eclipse.jdt.core.compiler.source=1.7
  13 +org.eclipse.jdt.core.compiler.source=1.6
... ...
.settings/org.eclipse.wst.common.component
... ... @@ -3,15 +3,20 @@
3 3 <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
4 4 <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
5 5 <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
6   - <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
7 6 <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
8 7 <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources/i18n"/>
9 8 <dependent-module archiveName="cnlive_live_model-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/cnlive_live_model/cnlive_live_model">
10 9 <dependency-type>uses</dependency-type>
11 10 </dependent-module>
  11 + <dependent-module archiveName="cnlive_ks3-1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/cnlive_ks3/cnlive_ks3">
  12 + <dependency-type>uses</dependency-type>
  13 + </dependent-module>
12 14 <dependent-module archiveName="smart-framework-4.0.1.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-framework/smart-framework">
13 15 <dependency-type>uses</dependency-type>
14 16 </dependent-module>
  17 + <dependent-module archiveName="smart-plugin-job-1.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-plugin-job/smart-plugin-job">
  18 + <dependency-type>uses</dependency-type>
  19 + </dependent-module>
15 20 <dependent-module archiveName="smart-plugin-dbcp-1.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-plugin-dbcp/smart-plugin-dbcp">
16 21 <dependency-type>uses</dependency-type>
17 22 </dependent-module>
... ...
.settings/org.eclipse.wst.common.project.facet.core.xml
... ... @@ -3,5 +3,5 @@
3 3 <installed facet="jst.web" version="3.0"/>
4 4 <installed facet="wst.jsdt.web" version="1.0"/>
5 5 <installed facet="jst.jaxrs" version="1.1"/>
6   - <installed facet="java" version="1.7"/>
  6 + <installed facet="java" version="1.6"/>
7 7 </faceted-project>
... ...
src/main/java/com/cnlive/mz/live/action/LiveAction.java
... ... @@ -15,10 +15,8 @@ import java.util.HashMap;
15 15 import java.util.List;
16 16 import java.util.Map;
17 17  
18   -import javax.servlet.http.HttpServletRequest;
19 18 import javax.servlet.http.HttpServletResponse;
20 19  
21   -import org.apache.commons.httpclient.NameValuePair;
22 20 import org.apache.commons.lang.StringUtils;
23 21 import org.apache.log4j.Logger;
24 22 import org.smart4j.framework.dao.bean.Pager;
... ... @@ -29,6 +27,7 @@ import org.smart4j.framework.mvc.annotation.Request;
29 27 import org.smart4j.framework.mvc.bean.Multipart;
30 28 import org.smart4j.framework.mvc.bean.Multiparts;
31 29 import org.smart4j.framework.mvc.bean.Params;
  30 +import org.smart4j.framework.mvc.bean.Redirect;
32 31 import org.smart4j.framework.mvc.bean.Result;
33 32 import org.smart4j.framework.mvc.bean.ResultBean;
34 33 import org.smart4j.framework.mvc.bean.View;
... ... @@ -40,7 +39,6 @@ import com.cnlive.mz.live.common.LiveUtils;
40 39 import com.cnlive.mz.live.entity.TChannel;
41 40 import com.cnlive.mz.live.entity.TLive;
42 41 import com.cnlive.mz.live.entity.TRoom;
43   -import com.cnlive.mz.live.rest.BaseUtil;
44 42 import com.cnlive.mz.live.service.TCheckService;
45 43 import com.cnlive.mz.live.service.TLiveService;
46 44 import com.cnlive.mz.live.service.TRoomService;
... ... @@ -188,11 +186,11 @@ public class LiveAction {
188 186 String activityId = params.getString("activityId");
189 187 int isHorizontalScreen = params.getInt("isHorizontalScreen");
190 188 String channelID = params.getString("channelId");
  189 + Map<String, Object> map = new HashMap<String, Object>();
191 190 if (StringUtils.isNotEmpty(appId) && StringUtils.isNotEmpty(activityId) && StringUtils.isNotEmpty(channelID)
192 191 && StringUtils.isNotEmpty("" + isHorizontalScreen)) {
193 192 TLive tLive = tLiveService.selectByParams(appId, activityId);
194 193 if (tLive != null) {
195   - Map<String, Object> map = new HashMap<String, Object>();
196 194 map.put("location", "");
197 195 rb.setData(map);
198 196 rb.setErrorCode("500");
... ... @@ -203,17 +201,15 @@ public class LiveAction {
203 201 boolean flag = tLiveService.addAcitvity(params);
204 202 TLive tlive = tLiveService.selectByParams(appId, activityId);
205 203 if (flag) {
206   - Map<String, Object> map = new HashMap<String, Object>();
207   - map.put("location",com.cnlive.mz.live.common.Constants.KS_HOST_UP_RTMP + channelID + "?vdoid=" + activityId);
  204 + map.put("location", com.cnlive.mz.live.common.Constants.KS_HOST_UP_RTMP + channelID + "?vdoid=" + activityId);
208 205 rb.setData(map);
209 206 rb.setErrorCode("0");
210 207 rb.setErrorMessage("创建活动成功");
211 208 log.info("创建活动成功");
212 209 // 通知cms直播
213   - boolean success = tLiveService.startLive(tlive);
  210 + boolean success = tLiveService.startLive(tlive);
214 211 return rb;
215 212 } else {
216   - Map<String, Object> map = new HashMap<String, Object>();
217 213 map.put("location", "");
218 214 rb.setData(map);
219 215 rb.setErrorCode("500");
... ... @@ -223,7 +219,6 @@ public class LiveAction {
223 219 }
224 220 }
225 221 } else {
226   - Map<String, Object> map = new HashMap<String, Object>();
227 222 map.put("location", "");
228 223 rb.setData(map);
229 224 rb.setErrorCode("500");
... ... @@ -231,7 +226,6 @@ public class LiveAction {
231 226 log.error("参数不正确");
232 227 return rb;
233 228 }
234   -
235 229 }
236 230  
237 231 /**
... ... @@ -342,7 +336,6 @@ public class LiveAction {
342 336 rb.setErrorMessage("获取活动列表成功");
343 337 return rb;
344 338 }
345   -
346 339 }
347 340 }
348 341  
... ... @@ -421,50 +414,24 @@ public class LiveAction {
421 414 * 1.8 获取APP直播URL接口.md
422 415 *
423 416 * @param params
424   - * @return
  417 + * @return 302 跳转播放地址
425 418 */
426 419 @Request.Get("/live/epg/play/app")
427   - public ResultBean appURL(Params params) throws IOException {
428   - HttpServletResponse response = DataContext.getResponse();
429   - ResultBean rb = new ResultBean();
  420 + public Redirect appURL(Params params) throws IOException {
  421 + log.info(params);
  422 + Redirect r = new Redirect();
430 423 String appId = params.getString("appId");
431 424 String activityid = params.getString("activityId");
432   - Map<String, Object> map = new HashMap<String, Object>();
433   - if (StringUtils.isEmpty(appId) || StringUtils.isEmpty(activityid)) {
434   - map.put("location", "");
435   - rb.setData(map);
436   - rb.setErrorCode("500");
437   - rb.setErrorMessage("启动app活动失败");
438   - return rb;
  425 + TLive tLive = tLiveService.selectByParams(appId, activityid);
  426 + TChannel tchannel = tLiveService.selectChannel(tLive.getRelation_id());
  427 + if (tchannel != null) {
  428 + // pgc直播
  429 + r.setRedirectUrl("http://ips.cnlive.com/IPS/liveplayByAPP.action?appId=" + appId + "&channelID=" + tLive.getRelation_id());
439 430 } else {
440   - TLive tLive = tLiveService.selectByParams(appId, activityid);
441   - if (tLive == null) {
442   - map.put("location", "");
443   - rb.setData(map);
444   - rb.setErrorCode("500");
445   - rb.setErrorMessage("启动app活动失败,活动对象为空");
446   - return rb;
447   - } else {
448   - TChannel tchannel = tLiveService.selectChannel(tLive.getRelation_id());
449   - if (tchannel != null) {
450   - // 请求到app.......
451   - redirect(response, "http://ips.cnlive.com/IPS/liveplayByAPP.action?appId=" + appId + "&channelID="
452   - + tLive.getRelation_id());
453   - map.put("location", "");
454   - rb.setData(map);
455   - rb.setErrorCode("0");
456   - rb.setErrorMessage("302重定向到app");
457   - return rb;
458   - } else {
459   - map.put("location", tLive.getLive_url());
460   - rb.setData(map);
461   - rb.setErrorCode("0");
462   - rb.setErrorMessage("启动app活动成功");
463   - return rb;
464   - }
465   - }
  431 + // ugc直播
  432 + r.setRedirectUrl(tLive.getLive_url());
466 433 }
467   -
  434 + return r;
468 435 }
469 436  
470 437 /**
... ... @@ -498,8 +465,7 @@ public class LiveAction {
498 465 TChannel tchannel = tLiveService.selectChannel(tLive.getRelation_id());
499 466 if (tchannel != null) {
500 467 // 重定向到h5.......
501   - redirect(response, "http://ips.cnlive.com/IPS/liveplayByH5?appId=" + appId + "&channelID="
502   - + tLive.getRelation_id());
  468 + redirect(response, "http://ips.cnlive.com/IPS/liveplayByH5?appId=" + appId + "&channelID=" + tLive.getRelation_id());
503 469 map.put("location", "");
504 470 rb.setData(map);
505 471 rb.setErrorCode("0");
... ... @@ -550,49 +516,17 @@ public class LiveAction {
550 516 rb.setErrorCode("0");
551 517 if (tchannel != null) {
552 518 // 302重定向到swf.......
553   - redirect(response, "http://ips.cnlive.com/IPS/liveplayBySWF.action?appId=" + appId + "&channelID="
554   - + tLive.getRelation_id());
  519 + redirect(response, "http://ips.cnlive.com/IPS/liveplayBySWF.action?appId=" + appId + "&channelID=" + tLive.getRelation_id());
555 520 map.put("location", "");
556 521 rb.setErrorMessage("302重定向到swf");
557 522 return rb;
558 523 } else {
559   -
560 524 map.put("location", tLive.getLive_url());
561 525 rb.setErrorMessage("启动swf活动成功");
562 526 return rb;
563 527 }
564 528 }
565 529 }
566   -
567   - }
568   -
569   - /**
570   - * 2.1 获取推流直播播放地址.md
571   - *
572   - * @param params
573   - * @return
574   - */
575   - @Request.Get("/live/epg/play")
576   - public ResultBean startLiveActivity(Params params) {
577   - ResultBean rb = new ResultBean();
578   - String appId = params.getString("appId");
579   - String activityid = params.getString("activityId");
580   - if (StringUtils.isEmpty(appId) || StringUtils.isEmpty(activityid)) {
581   - Map<String, Object> map = new HashMap<String, Object>();
582   - map.put("location", "");
583   - rb.setData(map);
584   - rb.setErrorCode("500");
585   - rb.setErrorMessage("启动活动失败");
586   - return rb;
587   - } else {
588   - TLive tLive = tLiveService.selectByParams(appId, activityid);
589   - Map<String, Object> map = new HashMap<String, Object>();
590   - map.put("location", tLive.getLive_url());
591   - rb.setData(map);
592   - rb.setErrorCode("0");
593   - rb.setErrorMessage("启动活动成功");
594   - return rb;
595   - }
596 530 }
597 531  
598 532 @Request.Post("/live/epg/error500")
... ... @@ -617,12 +551,6 @@ public class LiveAction {
617 551 }
618 552 }
619 553  
620   - @Request.Get("/live/epg/302")
621   - public void red302() {
622   - HttpServletResponse response = DataContext.getResponse();
623   - redirect(response, "http://ips.cnlive.com/IPS/liveplayBySWF.action?activityId=12345");
624   - }
625   -
626 554 public static void main(String[] args) {
627 555  
628 556 /*
... ... @@ -644,8 +572,7 @@ public class LiveAction {
644 572 * "http://bc.cnlive.com/live/epg/startActivity?appId=123&activityId=234"
645 573 * ); System.out.println(aa);
646 574 */
647   - String aa = HttpReq
648   - .getRequestWidthResult("http://bc.cnlive.com/live/epg/startActivity?appId=123&activityId=234");
  575 + String aa = HttpReq.getRequestWidthResult("http://bc.cnlive.com/live/epg/startActivity?appId=123&activityId=234");
649 576 System.out.println(aa);
650 577 }
651 578 }
652 579 \ No newline at end of file
... ...
target/m2e-wtp/web-resources/META-INF/MANIFEST.MF
1 1 Manifest-Version: 1.0
2   -Build-Jdk: 1.7.0_13
3   -Built-By: Administrator
  2 +Build-Jdk: 1.7.0_79
  3 +Built-By: adm
4 4 Created-By: Maven Integration for Eclipse
5 5  
... ...
target/m2e-wtp/web-resources/META-INF/maven/com.cnlive.mz.live.web/cnlive_live_web/pom.properties
1 1 #Generated by Maven Integration for Eclipse
2   -#Sat Aug 20 18:14:13 CST 2016
  2 +#Sat Aug 20 22:58:05 CST 2016
3 3 version=0.0.1-SNAPSHOT
4 4 groupId=com.cnlive.mz.live.web
5 5 m2e.projectName=cnlive_live_web
6   -m2e.projectLocation=C\:\\Users\\Administrator\\git\\cnlive_live_web
  6 +m2e.projectLocation=D\:\\1_CNLIVE_JAVA_CODE\\cnlive_live_web
7 7 artifactId=cnlive_live_web
... ...