Commit ac47d98aa8fa09a39cc457da8cd8d2936fd638f8

Authored by 刘基城
1 parent 4f74989d

添加直播管理

.settings/org.eclipse.wst.common.component
... ... @@ -8,7 +8,7 @@
8 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">
9 9 <dependency-type>uses</dependency-type>
10 10 </dependent-module>
11   - <dependent-module archiveName="smart-framework-4.0.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-framework/smart-framework">
  11 + <dependent-module archiveName="smart-framework-4.0.1.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-framework/smart-framework">
12 12 <dependency-type>uses</dependency-type>
13 13 </dependent-module>
14 14 <dependent-module archiveName="smart-plugin-dbcp-1.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-plugin-dbcp/smart-plugin-dbcp">
... ...
src/main/java/com/cnlive/mz/live/action/VideoAction.java
... ... @@ -4,6 +4,7 @@ import java.util.Date;
4 4 import java.util.LinkedHashMap;
5 5 import java.util.Map;
6 6  
  7 +import org.apache.commons.lang3.StringUtils;
7 8 import org.smart4j.framework.dao.bean.Pager;
8 9 import org.smart4j.framework.ioc.annotation.Inject;
9 10 import org.smart4j.framework.mvc.DataContext;
... ... @@ -27,7 +28,6 @@ import com.cnlive.mz.live.service.TVideoService;
27 28 public class VideoAction {
28 29 @Inject
29 30 private TDispatchServerService tDispatchServerService;
30   -
31 31 @Inject
32 32 private TVideoService tVideoService;
33 33 @Inject
... ... @@ -62,11 +62,12 @@ public class VideoAction {
62 62 String server_access_key = params.getString("server_access_key");
63 63 String active_id = params.getString("active_id");
64 64 String title = params.getString("title");
  65 + String direct = params.getString("direct");
65 66 String description = params.getString("description");
66 67 String custom_args = params.getString("custom_args");
67   - String uuid = CnliveUtil.getUUID();
68 68 String md5 = params.getString("md5");
69 69 String relation_id = params.getString("relation_id");
  70 + String uuid = "";
70 71 if (video_type.equals("2")) {
71 72 // 2:sdk上传录播文件
72 73 TVideo tVideo = new TVideo();
... ... @@ -77,22 +78,30 @@ public class VideoAction {
77 78 tVideo.setPlat(params.getString("plat"));
78 79 tVideo.setState(207);
79 80 tVideo.setMd5(md5);
  81 + uuid = CnliveUtil.getUUID();
80 82 tVideo.setVideo_uuid(uuid);
81 83 tVideo.setTitle(title);
82 84 tVideo.setDescription(description);
83 85 tVideoService.saveSdkVideo(tVideo, server_access_key, user_access_key, app_access_key);
84 86 } else if (video_type.equals("3")) {
85 87 // 3: sdk直播上传文件
86   - TLive tLive = tLiveService.getTLiveById(Integer.parseInt(active_id));
  88 + TLive tLive = tLiveService.getTLiveByUUId(active_id);
87 89 tLive.setTitle(title);
88 90 tLive.setDescription(description);
89 91 tLive.setStart_time(new Date());
90   - tLive.setUuid(uuid);
91 92 tLive.setUser_uuid(params.getString("name"));
92 93 tLive.setRelation_id(relation_id);
93 94 tLive.setCustom_args(custom_args);
94   - tLive.setLive_url("http://cnlive.hlslive.ks-cdn.com/live/" + tLive.getT_user_id() + "_" + tLive.getId()
95   - + "/index.m3u8");
  95 + uuid = tLive.getUuid();
  96 + if (StringUtils.isEmpty(direct)) {
  97 + tLive.setDirect(0);
  98 + } else {
  99 + tLive.setDirect(Integer.parseInt(direct));
  100 + }
  101 + // tLive.setLive_url("http://cnlive.hlslive.ks-cdn.com/live/" +
  102 + // tLive.getT_user_id() + "_" + uuid
  103 + // + "/index.m3u8");
  104 + tLive.setLive_url("rtmp://cnlive.rtmplive.ks-cdn.com/live/" + tLive.getT_user_id() + "_" + uuid);
96 105 tLiveService.startLive(tLive);
97 106 }
98 107 data.put("video_uuid", uuid);
... ...
src/main/webapp/pages/live/video_management.jsp 0 → 100644
  1 +<%@ page language="java" pageEncoding="UTF-8"%>
  2 +<%@ include file="/pages/common/taglib.jsp"%>
  3 +<!DOCTYPE html>
  4 +<html>
  5 +<head>
  6 +<meta charset="UTF-8">
  7 +<title>直播录制管理 | <f:message key="common.title" /></title>
  8 +<meta
  9 + content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
  10 + name='viewport'>
  11 +<%@ include file="/pages/common/css.jsp"%>
  12 +</head>
  13 +<body class="skin-blue fixed ">
  14 + <div class="wrapper">
  15 + <%@ include file="/pages/common/top.jsp"%>
  16 + <%@ include file="/pages/common/left.jsp"%>
  17 + <div class="content-wrapper">
  18 + <!-- Content Header (Page header) -->
  19 + <section class="content-header">
  20 + <h1>
  21 + 直播录制管理 <small class="label label-warning"
  22 + style="display: none" id="info_tab_span"><i
  23 + class="fa fa-bell-o"></i></small>
  24 + </h1>
  25 +
  26 + <ol class="breadcrumb">
  27 + <li><a><i class="fa fa-dashboard"></i> 首页</a></li>
  28 + <li class="active">活动管理</li>
  29 + </ol>
  30 + </section>
  31 + <!-- Main content -->
  32 + <section class="content">
  33 + <div class="row">
  34 + <div class="col-xs-12">
  35 + <div class="box box-warning">
  36 + <div class="box-header with-border">
  37 + <h3 class="box-title"></h3>
  38 + <div class="box-tools">
  39 + <div class="input-group">
  40 + <form action="../search/1" method="post">
  41 + <div class="input-group">
  42 + <input type="text" name="search_text" id="search_text"
  43 + class="form-control input-sm" style="width: 150px;"
  44 + placeholder="Search" />
  45 + <button id="t_activity_search_btn" type="submit"
  46 + class="btn btn-sm btn-default">
  47 + <i class="fa fa-search"></i>搜索
  48 + </button>
  49 + </div>
  50 + </form>
  51 + </div>
  52 + </div>
  53 + </div>
  54 + <!-- /.box-header -->
  55 + <div class="box-body">
  56 + <table class="table table-bordered">
  57 + <tr>
  58 + <th>名称</th>
  59 + <th>状态</th>
  60 + <th>修改</th>
  61 + <th>删除</th>
  62 + </tr>
  63 + <c:forEach var="item" items="${videos.recordList}"
  64 + varStatus="stat">
  65 + <tr>
  66 + <td><a href="${BASE}/live/preview/${item.id}">${item.title}</a>
  67 + </td>
  68 + <td><c:if test="${item.t_status_id==0}">
  69 + <span class="badge bg-green">未开始</span>
  70 + </c:if> <c:if test="${item.t_status_id==1}">
  71 + <span class="badge bg-red">直播中</span>
  72 + </c:if> <c:if test="${item.t_status_id==2}">
  73 + <span class="badge">直播结束</span>
  74 + </c:if> <c:if test="${item.t_status_id==3}">
  75 + <span class="badge">回放同步中</span>
  76 + </c:if> <c:if test="${item.t_status_id==4}">
  77 + <span class="badge">同步完成</span>
  78 + </c:if></td>
  79 + <td>
  80 + <button class="btn btn-default btn-sm"
  81 + onclick="t_live_edit(${item.id});">
  82 + <i class="fa fa-edit"></i>
  83 + </button>
  84 + </td>
  85 + <td>
  86 + <button class="btn btn-danger btn-sm"
  87 + onclick="t_live_delete(${item.id});">
  88 + <i class="fa fa-close"></i>
  89 + </button>
  90 + </td>
  91 + </tr>
  92 + </c:forEach>
  93 + </table>
  94 + </div>
  95 + <!-- /.box-body -->
  96 + <div class="box-footer clearfix">
  97 + <center>
  98 + <tag:pager id="product_pager" pager="${tLive}" />
  99 + </center>
  100 + </div>
  101 + </div>
  102 + </div>
  103 + </div>
  104 + </div>
  105 + <%@ include file="/pages/common/bottom.jsp"%>
  106 + </div>
  107 + <%@ include file="/pages/common/js.jsp"%>
  108 +</body>
  109 +</html>
... ...
src/main/webapp/pages/live/video_view.jsp 0 → 100644
  1 +<%@ page language="java" pageEncoding="UTF-8"%>
  2 +<%@ include file="/pages/common/taglib.jsp"%>
  3 +<!DOCTYPE html>
  4 +<html>
  5 +<head>
  6 +<meta charset="UTF-8">
  7 +<title>活动详情 | <f:message key="common.title" /></title>
  8 +<meta
  9 + content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
  10 + name='viewport'>
  11 +<%@ include file="/pages/common/css.jsp"%>
  12 +<script src="${BASE}/static/assets/jwplayer/jwplayer.js"></script>
  13 +<script src="${BASE}/static/assets/jwplayer/jwplayer.html5.js"></script>
  14 +<script type="text/javascript">jwplayer.key="MGAzpXRYxGnaVXhH8jSdKXzDe7ucAAvZGWggIA==";</script>
  15 +</head>
  16 +<body class="skin-blue fixed ">
  17 + <div class="wrapper">
  18 + <%@ include file="/pages/common/top.jsp"%>
  19 + <%@ include file="/pages/common/left.jsp"%>
  20 + <div class="content-wrapper">
  21 + <!-- Content Header (Page header) -->
  22 + <section class="content-header">
  23 + <h1>
  24 + 直播活动详情 <small>${tActivity.name}</small>
  25 + </h1>
  26 + <ol class="breadcrumb">
  27 + <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
  28 + <li><a href="#">直播详情</a></li>
  29 + </ol>
  30 + </section>
  31 + <!-- Main content -->
  32 + <section class="content">
  33 + <!-- row -->
  34 + <div class="row">
  35 + <div class="col-md-12">
  36 + <!-- The time line -->
  37 + <ul class="timeline">
  38 + <li class="time-label"><span class="bg-blue">活动信息详情</span></li>
  39 + <li><i class="fa fa-gears bg-maroon"></i>
  40 + <div class="timeline-item">
  41 + <div class="timeline-body">
  42 + <div class="row">
  43 + <div class="col-md-12">
  44 + <div class="box box-danger">
  45 + <div class="box-body">
  46 + <table class="table table-bordered">
  47 + <tr>
  48 + <td colspan="3" align='center'><h2>${tActivity.name}</h2></td>
  49 + </tr>
  50 + <tr>
  51 + <td style="width: 200pt">状态:</td>
  52 + <td colspan="3"><span class="class label-danger">
  53 + <c:if test="${tActivity.state==0}">未开始</c:if> <c:if
  54 + test="${tActivity.state==1}">直播中</c:if> <c:if
  55 + test="${tActivity.state==2}">已结束</c:if>
  56 + </span></td>
  57 + </tr>
  58 + <tr>
  59 + <td>EPG条目:</td>
  60 + <td colspan="3">${tActivity.epg_name}</td>
  61 + </tr>
  62 + <tr>
  63 + <td>地点:</td>
  64 + <td colspan="3">${tActivity.place}</td>
  65 + </tr>
  66 + <tr>
  67 + <td>简介:</td>
  68 + <td colspan="3">${tActivity.description}</td>
  69 + </tr>
  70 + <tr>
  71 + <td>直播时间</td>
  72 + <td colspan="3">${tActivity.start_time}</td>
  73 + </tr>
  74 + <tr>
  75 + <td>直播地点</td>
  76 + <td colspan="3">${tActivity.end_time}</td>
  77 + </tr>
  78 + <tr>
  79 + <td>现场联系人</td>
  80 + <td colspan="3">${tActivity.contact_user}</td>
  81 + </tr>
  82 +<tr>
  83 + <td>邮件抄送</td>
  84 + <td colspan="3">${tActivity.notify_user}</td>
  85 + </tr>
  86 + <tr>
  87 + <td>并发用户数</td>
  88 + <td colspan="3">${tActivity.v_count}</td>
  89 + </tr>
  90 + <tr>
  91 + <td>画面LOGO</td>
  92 + <td colspan="3">${tActivity.logo}</td>
  93 + </tr>
  94 + <tr>
  95 + <td>UUID</td>
  96 + <td colspan="3"><span class="class label-success">${tActivity.uuid}</span></td>
  97 + </tr>
  98 + <tr>
  99 + <td>是否收费</td>
  100 + <td colspan="3"><c:if
  101 + test="${tActivity.is_free==0}">收费</c:if> <c:if
  102 + test="${tActivity.is_free==1}">免费</c:if></td>
  103 + </tr>
  104 + <tr>
  105 + <td>回放地址</td>
  106 + <td colspan="3">${tActivity.playbak_url}</td>
  107 + </tr>
  108 + </table>
  109 + </div>
  110 + </div>
  111 + </div>
  112 + </div>
  113 + </div>
  114 + </div></li>
  115 + <li class="time-label"><span class="bg-red">播出频道</span></li>
  116 + <li><i class="fa fa-video-camera bg-maroon"></i>
  117 + <div class="timeline-item">
  118 + <h3 class="timeline-header">
  119 + <a>频道名称(实际播放地址)</a>
  120 + </h3>
  121 + <div class="timeline-body">
  122 + <div class="row">
  123 + <c:forEach var="item" items="${vChannels}" varStatus="stat">
  124 + <div class="col-md-6">
  125 + <div class="box box-success box-solid">
  126 + <div class="box-header with-border">
  127 + <h3 class="box-title">${item.name_zh}</h3>
  128 + <div class="box-tools pull-right">
  129 + <button class="btn btn-sm" id="play_button_${item.id}"
  130 + onclick="play(${item.id});">重新载入</button>
  131 + </div>
  132 + </div>
  133 + <div class="box-body">
  134 + <input type="hidden" name="play_url_${item.id}"
  135 + id="play_url_${item.id}" value="${item.play_url}" /> <span
  136 + class="mailbox-attachment-icon has-img"
  137 + id="player_span_${item.id}"> <img
  138 + src="${BASE}/static/assets/dist/img/photo2.png"
  139 + alt="Attachment">
  140 + </span>
  141 + </div>
  142 + <div class="box-footer"></div>
  143 + </div>
  144 + </div>
  145 + </c:forEach>
  146 + </div>
  147 + </div>
  148 + <div class='timeline-footer'></div>
  149 + </div></li>
  150 + <li class="time-label"><span class="bg-yellow">流媒体服务器</span></li>
  151 + <li><i class="fa fa-gears bg-aqua"></i>
  152 + <div class="timeline-item">
  153 + <h3 class="timeline-header">
  154 + <a href="#">wowza 编解码地址</a>
  155 + </h3>
  156 + <div class="timeline-body">
  157 + <div class="row">
  158 + <c:forEach var="item" items="${vChannels}" varStatus="stat">
  159 + <div class="col-md-6">
  160 + <div class="box box-warning box-solid">
  161 + <div class="box-header with-border">
  162 + <h3 class="box-title">${item.application_name}/${item.stream_name}</h3>
  163 + <div class="box-tools pull-right">
  164 + <button class="btn btn-sm"
  165 + id="play_button_w_${item.uuid}"
  166 + onclick="play_w('${item.uuid}');">重新载入</button>
  167 + </div>
  168 + </div>
  169 + <div class="box-body">
  170 + <input type="hidden"
  171 + name="play_url_w_${item.uuid}"
  172 + id="play_url_w_${item.uuid}"
  173 + value="${item.publish_url}" /> <span
  174 + class="mailbox-attachment-icon has-img w"
  175 + id="player_span_${item.uuid}"> <img
  176 + src="${BASE}/static/assets/dist/img/photo2.png"
  177 + alt="Attachment">
  178 + </span>
  179 + </div>
  180 + <div class="box-footer"></div>
  181 + </div>
  182 + </div>
  183 + </c:forEach>
  184 + </div>
  185 + </div>
  186 + </div></li>
  187 + </ul>
  188 + </div>
  189 + </div>
  190 + </section>
  191 + </div>
  192 + <%@ include file="/pages/common/bottom.jsp"%>
  193 + </div>
  194 + <%@ include file="/pages/common/js.jsp"%>
  195 + <script src="${BASE}/static/assets/cnlive/js/player_6.js"></script>
  196 +</body>
  197 +</html>
... ...
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   -#Mon Jun 06 10:53:20 CST 2016
  2 +#Tue Jun 07 09:46:42 CST 2016
3 3 version=0.0.1-SNAPSHOT
4 4 groupId=com.cnlive.mz.live.web
5 5 m2e.projectName=cnlive_live_web
... ...