Commit 76537926b9506eda651380f2fc1fd9ad837803f6
Merge branch 'zzpUGC' into 'master'
video See merge request !2
Showing
15 changed files
with
1923 additions
and
2 deletions
src/main/java/com/cnlive/mz/live/action/CheckAction.java
0 → 100644
| 1 | +package com.cnlive.mz.live.action; | ||
| 2 | + | ||
| 3 | +import org.smart4j.framework.dao.bean.Pager; | ||
| 4 | +import org.smart4j.framework.ioc.annotation.Inject; | ||
| 5 | +import org.smart4j.framework.mvc.DataContext; | ||
| 6 | +import org.smart4j.framework.mvc.annotation.Action; | ||
| 7 | +import org.smart4j.framework.mvc.annotation.Request; | ||
| 8 | +import org.smart4j.framework.mvc.bean.View; | ||
| 9 | +import org.smart4j.framework.util.CastUtil; | ||
| 10 | + | ||
| 11 | +import com.cnlive.mz.live.common.LiveUtils; | ||
| 12 | +import com.cnlive.mz.live.entity.TLive; | ||
| 13 | +import com.cnlive.mz.live.service.TLiveService; | ||
| 14 | +import com.cnlive.mz.live.service.TRoomService; | ||
| 15 | + | ||
| 16 | +@Action | ||
| 17 | +public class CheckAction { | ||
| 18 | + | ||
| 19 | + @Inject | ||
| 20 | + private TLiveService tLiveService; | ||
| 21 | + @Inject | ||
| 22 | + private TRoomService tRoomService; | ||
| 23 | + | ||
| 24 | + @Request.Get("/check/list/{page_number}") | ||
| 25 | + public View list(int page_number) { | ||
| 26 | + int user_id = CastUtil.castInt(DataContext.getRequest().getSession().getAttribute(LiveUtils.SESSION_KEY_ID)); | ||
| 27 | + System.out.println(user_id); | ||
| 28 | + Pager<TLive> tLive = tLiveService.getTLivePager(page_number, 16, user_id); | ||
| 29 | + return new View("check/check_management.jsp").data("tLive", tLive); | ||
| 30 | + } | ||
| 31 | +} |
src/main/java/com/cnlive/mz/live/action/LiveAction.java
| @@ -16,7 +16,12 @@ import org.smart4j.framework.ioc.annotation.Inject; | @@ -16,7 +16,12 @@ import org.smart4j.framework.ioc.annotation.Inject; | ||
| 16 | import org.smart4j.framework.mvc.DataContext; | 16 | import org.smart4j.framework.mvc.DataContext; |
| 17 | import org.smart4j.framework.mvc.annotation.Action; | 17 | import org.smart4j.framework.mvc.annotation.Action; |
| 18 | import org.smart4j.framework.mvc.annotation.Request; | 18 | import org.smart4j.framework.mvc.annotation.Request; |
| 19 | +import org.smart4j.framework.mvc.bean.Multipart; | ||
| 20 | +import org.smart4j.framework.mvc.bean.Multiparts; | ||
| 21 | +import org.smart4j.framework.mvc.bean.Params; | ||
| 22 | +import org.smart4j.framework.mvc.bean.Result; | ||
| 19 | import org.smart4j.framework.mvc.bean.View; | 23 | import org.smart4j.framework.mvc.bean.View; |
| 24 | +import org.smart4j.framework.orm.DataSet; | ||
| 20 | import org.smart4j.framework.util.CastUtil; | 25 | import org.smart4j.framework.util.CastUtil; |
| 21 | 26 | ||
| 22 | import com.cnlive.mz.commons.Constants; | 27 | import com.cnlive.mz.commons.Constants; |
| @@ -58,4 +63,35 @@ public class LiveAction { | @@ -58,4 +63,35 @@ public class LiveAction { | ||
| 58 | return new View("live/live_management.jsp").data("tLive", tLive); | 63 | return new View("live/live_management.jsp").data("tLive", tLive); |
| 59 | } | 64 | } |
| 60 | 65 | ||
| 61 | -} | 66 | + @Request.Post("/live/save") |
| 67 | + public Result saveLive(Params params, Multiparts multiparts) { | ||
| 68 | + System.out.println(params + "....and....." + multiparts); | ||
| 69 | + int user_id = CastUtil.castInt(DataContext.getRequest().getSession().getAttribute(LiveUtils.SESSION_KEY_ID)); | ||
| 70 | + Multipart multipart = multiparts.getOne(); | ||
| 71 | + tLiveService.add(user_id, params, multipart); | ||
| 72 | + return new Result(false); | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + @Request.Get("/live/edit/{id}") | ||
| 76 | + public View edit(int id) { | ||
| 77 | + TLive tLive = tLiveService.getTLiveById(id); | ||
| 78 | + TRoom tRoom = tRoomService.getTRoomById(Integer.parseInt(tLive.getLive_room_id())); | ||
| 79 | + List<TRoom> list = tRoomService.getTRooms(tLive.getT_user_id()); | ||
| 80 | + View view = new View("live/live_edit.jsp"); | ||
| 81 | + view.data("tActivity", tLive); | ||
| 82 | + view.data("tRoom", tRoom); | ||
| 83 | + view.data("tRooms", list); | ||
| 84 | + return view; | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + // | ||
| 88 | + @Request.Get("/live/preview/{id}") | ||
| 89 | + public View preview(int id) { | ||
| 90 | + TLive tLive = tLiveService.getTLiveById(id); | ||
| 91 | + TRoom tRoom = tRoomService.getTRoomById(Integer.parseInt(tLive.getLive_room_id())); | ||
| 92 | + View view = new View("live/live_preview.jsp"); | ||
| 93 | + view.data("tLive", tLive); | ||
| 94 | + view.data("tRoom", tRoom); | ||
| 95 | + return view; | ||
| 96 | + } | ||
| 97 | +} | ||
| 62 | \ No newline at end of file | 98 | \ No newline at end of file |
src/main/java/com/cnlive/mz/live/action/RoomAction.java
| @@ -9,6 +9,9 @@ | @@ -9,6 +9,9 @@ | ||
| 9 | 9 | ||
| 10 | package com.cnlive.mz.live.action; | 10 | package com.cnlive.mz.live.action; |
| 11 | 11 | ||
| 12 | +import java.util.List; | ||
| 13 | +import java.util.Map; | ||
| 14 | + | ||
| 12 | import org.smart4j.framework.dao.bean.Pager; | 15 | import org.smart4j.framework.dao.bean.Pager; |
| 13 | import org.smart4j.framework.ioc.annotation.Inject; | 16 | import org.smart4j.framework.ioc.annotation.Inject; |
| 14 | import org.smart4j.framework.mvc.DataContext; | 17 | import org.smart4j.framework.mvc.DataContext; |
| @@ -18,6 +21,7 @@ import org.smart4j.framework.mvc.bean.Multiparts; | @@ -18,6 +21,7 @@ import org.smart4j.framework.mvc.bean.Multiparts; | ||
| 18 | import org.smart4j.framework.mvc.bean.Params; | 21 | import org.smart4j.framework.mvc.bean.Params; |
| 19 | import org.smart4j.framework.mvc.bean.Result; | 22 | import org.smart4j.framework.mvc.bean.Result; |
| 20 | import org.smart4j.framework.mvc.bean.View; | 23 | import org.smart4j.framework.mvc.bean.View; |
| 24 | +import org.smart4j.framework.orm.DataSet; | ||
| 21 | import org.smart4j.framework.util.CastUtil; | 25 | import org.smart4j.framework.util.CastUtil; |
| 22 | 26 | ||
| 23 | import com.cnlive.mz.commons.Constants; | 27 | import com.cnlive.mz.commons.Constants; |
| @@ -56,8 +60,17 @@ public class RoomAction { | @@ -56,8 +60,17 @@ public class RoomAction { | ||
| 56 | // 查看读取 | 60 | // 查看读取 |
| 57 | @Request.Get("/room/edit/{id}") | 61 | @Request.Get("/room/edit/{id}") |
| 58 | public View edit(int id) { | 62 | public View edit(int id) { |
| 63 | + /*String sql = "select * " | ||
| 64 | + + "from t_video t " | ||
| 65 | + + "where t_user_id = ? and state !=207 and state !=201 and state !=601 order by t.create_time desc "; | ||
| 66 | + List<Map<String,Object>> videoList = DataSet.selectMapWithSql(sql, 9); | ||
| 67 | + System.out.println("....................."+videoList); | ||
| 68 | + for (int i = 0; i < videoList.size(); i++) { | ||
| 69 | + System.out.println("....................."); | ||
| 70 | + System.out.println(videoList.get(i)); | ||
| 71 | + }*/ | ||
| 59 | TRoom tRoom = tRoomService.getTRoomById(id); | 72 | TRoom tRoom = tRoomService.getTRoomById(id); |
| 60 | - View view = new View("room/room_add.jsp"); | 73 | + View view = new View("room/room_edit.jsp"); |
| 61 | view.data("tRoom", tRoom); | 74 | view.data("tRoom", tRoom); |
| 62 | return view; | 75 | return view; |
| 63 | } | 76 | } |
| @@ -72,7 +85,16 @@ public class RoomAction { | @@ -72,7 +85,16 @@ public class RoomAction { | ||
| 72 | // 查看读取 | 85 | // 查看读取 |
| 73 | @Request.Get("/room/pload") | 86 | @Request.Get("/room/pload") |
| 74 | public View pload() { | 87 | public View pload() { |
| 88 | + System.out.println("......."); | ||
| 75 | View view = new View("room/room_add.jsp"); | 89 | View view = new View("room/room_add.jsp"); |
| 76 | return view; | 90 | return view; |
| 77 | } | 91 | } |
| 92 | + //room/editSave | ||
| 93 | + @Request.Post("/room/editSave") | ||
| 94 | + public Result editSave(Params params, Multiparts multiparts) { | ||
| 95 | + System.out.println(params+"..nnnn.."+multiparts); | ||
| 96 | + int user_id = CastUtil.castInt(DataContext.getRequest().getSession().getAttribute(LiveUtils.SESSION_KEY_ID)); | ||
| 97 | + tRoomService.save(user_id, params, multiparts); | ||
| 98 | + return new Result(true); | ||
| 99 | + } | ||
| 78 | } | 100 | } |
src/main/java/com/cnlive/mz/live/action/VideoApiAction.java
0 → 100644
| 1 | +package com.cnlive.mz.live.action; | ||
| 2 | + | ||
| 3 | +import org.smart4j.framework.ioc.annotation.Inject; | ||
| 4 | +import org.smart4j.framework.mvc.annotation.Action; | ||
| 5 | +import org.smart4j.framework.mvc.annotation.Request; | ||
| 6 | +import org.smart4j.framework.mvc.bean.Params; | ||
| 7 | +import org.smart4j.framework.mvc.bean.Result; | ||
| 8 | + | ||
| 9 | +import com.cnlive.mz.live.entity.ResultBean; | ||
| 10 | +import com.cnlive.mz.live.entity.TApp; | ||
| 11 | +import com.cnlive.mz.live.service.AppService; | ||
| 12 | +import com.cnlive.mz.live.service.VideoApiService; | ||
| 13 | + | ||
| 14 | +@Action | ||
| 15 | +public class VideoApiAction { | ||
| 16 | + @Inject | ||
| 17 | + private VideoApiService videoApiService; | ||
| 18 | + @Inject | ||
| 19 | + private AppService appService; | ||
| 20 | + | ||
| 21 | + @Request.Post("com/api/video/redirect") | ||
| 22 | + public Result redirect(Params params) { | ||
| 23 | + String app_access_key = params.getString("app_access_key"); | ||
| 24 | + String video_type = params.getString("video_type"); | ||
| 25 | + TApp app =appService.getAppByAccessKey(app_access_key); | ||
| 26 | + //String ip = getRequest().getRemoteAddr(); | ||
| 27 | + String ip =null; | ||
| 28 | + ResultBean resultBean = new ResultBean(); | ||
| 29 | + resultBean.setCode(100); | ||
| 30 | + resultBean.setMessage("请求成功"); | ||
| 31 | + resultBean.setData(videoApiService.getDispatchServer(app,ip, video_type, app_access_key)); | ||
| 32 | + Result result= new Result(true); | ||
| 33 | + return result.data(resultBean); | ||
| 34 | + } | ||
| 35 | + @Request.Post("com/api/video/all") | ||
| 36 | + public Result all(Params params){ | ||
| 37 | + String app_access_key =params.getString("app_access_key"); | ||
| 38 | + String relationId = params.getString("relation_id"); | ||
| 39 | + String pageNo = params.getString("page_no"); | ||
| 40 | + ResultBean resultBean = new ResultBean(); | ||
| 41 | + resultBean.setCode(100); | ||
| 42 | + resultBean.setMessage("请求成功"); | ||
| 43 | + resultBean.setData(videoApiService.findAll(app_access_key, relationId, pageNo)); | ||
| 44 | + Result result= new Result(true); | ||
| 45 | + return result.data(resultBean); | ||
| 46 | + } | ||
| 47 | + /*@Request.Post("com/api/video/uploadNotify") | ||
| 48 | + public Result uploadNotify(Params params){ | ||
| 49 | + String video_uuid = params.getString("video_uuid"); | ||
| 50 | + System.out.println("video_uuid:" + video_uuid); | ||
| 51 | + String upload_type = params.getString("upload_type"); | ||
| 52 | + int video_type = params.getInt("video_type"); | ||
| 53 | + String state = params.getString("state"); | ||
| 54 | + videoApiService.notify(video_uuid, upload_type, video_type, state); | ||
| 55 | + Result result= new Result(true); | ||
| 56 | + return result.data(new ResultBean(100, "请求成功", null)); | ||
| 57 | + }*/ | ||
| 58 | + public static void main(String[] args) { | ||
| 59 | + | ||
| 60 | + } | ||
| 61 | +} |
src/main/webapp/WEB-INF/tags/pager2.tag
0 → 100644
| 1 | +<%@ tag pageEncoding="UTF-8"%> | ||
| 2 | +<%@ include file="/pages/common/taglib.jsp"%> | ||
| 3 | +<%@ attribute name="id" required="true" type="java.lang.String"%> | ||
| 4 | +<%@ attribute name="pager" required="true" type="org.smart4j.framework.dao.bean.Pager"%> | ||
| 5 | +<c:set var="pageNumber" value="${pager.pageNumber}" /> | ||
| 6 | +<c:set var="pageSize" value="${pager.pageSize}" /> | ||
| 7 | +<c:set var="totalRecord" value="${pager.totalRecord}" /> | ||
| 8 | +<c:set var="totalPage" value="${pager.totalPage}" /> | ||
| 9 | + | ||
| 10 | +<div class="css-row"> | ||
| 11 | + <div class="css-right"> | ||
| 12 | + <div id="${id}"> | ||
| 13 | + <!-- <span>每页记录数:</span> | ||
| 14 | + ${pageSize} --> | ||
| 15 | + <div class="css-button-group ext-pager-button"> | ||
| 16 | + <c:choose> | ||
| 17 | + <c:when test="${pageNumber > 1 && pageNumber <= totalPage}"> | ||
| 18 | + <button class="btn btn-xs btn-danger" type="button" onclick="next_page(1);" data-pn="1">|第一页</button> | ||
| 19 | + <button class="btn btn-xs btn-danger" type="button" onclick="next_page(${pageNumber - 1});" data-pn="${pageNumber - 1}"><上一页</button> | ||
| 20 | + </c:when> | ||
| 21 | + <c:otherwise> | ||
| 22 | + <button class="btn btn-xs btn-danger" type="button" disabled>|<首页</button> | ||
| 23 | + <button class="btn btn-xs btn-danger" type="button" disabled><上一页</button> | ||
| 24 | + </c:otherwise> | ||
| 25 | + </c:choose> | ||
| 26 | + <c:choose> | ||
| 27 | + <c:when test="${pageNumber < totalPage}"> | ||
| 28 | + <button class="btn btn-xs btn-danger" type="button" onclick="next_page(${pageNumber + 1});" data-pn="${pageNumber + 1}">下一页></button> | ||
| 29 | + <button class="btn btn-xs btn-danger" type="button" onclick="next_page(${totalPage});" data-pn="${totalPage}">最后一页>|</button> | ||
| 30 | + </c:when> | ||
| 31 | + <c:otherwise> | ||
| 32 | + <button class="btn btn-xs btn-danger" type="button" disabled>下一页></button> | ||
| 33 | + <button class="btn btn-xs btn-danger" type="button" disabled>最后一页>|</button> | ||
| 34 | + </c:otherwise> | ||
| 35 | + </c:choose> | ||
| 36 | + </div> | ||
| 37 | + </div> | ||
| 38 | + </div> | ||
| 39 | +</div> | ||
| 0 | \ No newline at end of file | 40 | \ No newline at end of file |
src/main/webapp/WEB-INF/web.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 3 | + xmlns="http://java.sun.com/xml/ns/javaee" | ||
| 4 | + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" | ||
| 5 | + version="3.0"> | ||
| 6 | + | ||
| 7 | +</web-app> | ||
| 0 | \ No newline at end of file | 8 | \ No newline at end of file |
src/main/webapp/pages/check/check_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 | +<style type="text/css"> | ||
| 13 | +.divcss5 { | ||
| 14 | + border: 1px solid #00ff00; | ||
| 15 | + width: 200px; | ||
| 16 | + height: 100px | ||
| 17 | +} | ||
| 18 | + | ||
| 19 | +.divcss { | ||
| 20 | + border: 1px solid #F00; | ||
| 21 | + width: 300px; | ||
| 22 | + height: 520px | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +body { | ||
| 26 | + font-family: Verdana, Arial, Helvetica, sans-serif; | ||
| 27 | + font-size: 12px; | ||
| 28 | + line-height: 20px; | ||
| 29 | + color: #000000; | ||
| 30 | +} | ||
| 31 | + | ||
| 32 | +#main_box { | ||
| 33 | + /*正文区大容器*/ | ||
| 34 | + width: 770px; | ||
| 35 | + margin-right: auto; | ||
| 36 | + margin-left: auto; | ||
| 37 | + background: #EFEFEF; | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +.row { | ||
| 41 | + /*定义每行*/ | ||
| 42 | + width: 100%; | ||
| 43 | + clear: both; | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +.left3 { | ||
| 47 | + /*用在五列布局上*/ | ||
| 48 | + border: 1px solid #00ff00; | ||
| 49 | + width: 25%; | ||
| 50 | + height: 150px; | ||
| 51 | + background: #888; | ||
| 52 | + float: left; | ||
| 53 | +} | ||
| 54 | + | ||
| 55 | +.middle { | ||
| 56 | + width: 470px; | ||
| 57 | + background: #6699CC; | ||
| 58 | + float: left; | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +.divleft { | ||
| 62 | + width: 21%; | ||
| 63 | + height: 600px; | ||
| 64 | + float: left; | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +.divright { | ||
| 68 | + width: 77%; | ||
| 69 | + height: 600px; | ||
| 70 | + float: right; | ||
| 71 | +} | ||
| 72 | + | ||
| 73 | +.leftTop { | ||
| 74 | + width: 100%; | ||
| 75 | + height: 340px; | ||
| 76 | + background: #6600CC; | ||
| 77 | + float: right; | ||
| 78 | +} | ||
| 79 | + | ||
| 80 | +.leftBootom { | ||
| 81 | + width: 100%; | ||
| 82 | + height: 250px; | ||
| 83 | + float: right; | ||
| 84 | +} | ||
| 85 | +</style> | ||
| 86 | +</head> | ||
| 87 | +<body class="skin-blue fixed "> | ||
| 88 | + <div class="wrapper"> | ||
| 89 | + <%@ include file="/pages/common/top.jsp"%> | ||
| 90 | + <%@ include file="/pages/common/left.jsp"%> | ||
| 91 | + <div class="content-wrapper"> | ||
| 92 | + <!-- Content Header (Page header) --> | ||
| 93 | + <section class="content-header"> | ||
| 94 | + <h1> | ||
| 95 | + 监审管理<small><a href="../../live/preload"><i | ||
| 96 | + class="fa fa-plus"></i>直播监审</a> </small> <small class="label label-warning" | ||
| 97 | + style="display: none" id="info_tab_span"><i | ||
| 98 | + class="fa fa-bell-o"></i></small> | ||
| 99 | + </h1> | ||
| 100 | + | ||
| 101 | + <ol class="breadcrumb"> | ||
| 102 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 103 | + <li class="active">监审管理</li> | ||
| 104 | + </ol> | ||
| 105 | + </section> | ||
| 106 | + <!-- Main content --> | ||
| 107 | + <section class="content"> | ||
| 108 | + <div class="row"> | ||
| 109 | + | ||
| 110 | + <div class="col-xs-12"> | ||
| 111 | + <div class="box box-warning"> | ||
| 112 | + <div class="box-header with-border"> | ||
| 113 | + <h3 class="box-title"></h3> | ||
| 114 | + <div class="box-tools"> | ||
| 115 | + <div class="input-group"> | ||
| 116 | + <div class="box-footer clearfix"> | ||
| 117 | + <center> | ||
| 118 | + <tag:pager2 id="product_pager" pager="${tLive}" /> | ||
| 119 | + </center> | ||
| 120 | + </div> | ||
| 121 | + </div> | ||
| 122 | + </div> | ||
| 123 | + </div> | ||
| 124 | + <!-- /.box-header --> | ||
| 125 | + <div class="box-body"> | ||
| 126 | + | ||
| 127 | + <div class="divleft"> | ||
| 128 | + <div class="leftTop" id="leftTopPlay"></div> | ||
| 129 | + <div class="leftBootom"> | ||
| 130 | + | ||
| 131 | + <table class="table table-bordered"> | ||
| 132 | + | ||
| 133 | + <h4>直播活动详情:</h4> | ||
| 134 | + | ||
| 135 | + <tr> | ||
| 136 | + <th width="30%">活动名称</th> | ||
| 137 | + <th id="live_name"></th> | ||
| 138 | + | ||
| 139 | + </tr> | ||
| 140 | + <tr> | ||
| 141 | + <th width="30%">开始时间</th> | ||
| 142 | + <th id="start_time"></th> | ||
| 143 | + </tr> | ||
| 144 | + <tr> | ||
| 145 | + <th width="30%">结束时间</th> | ||
| 146 | + <th id="end_time"></th> | ||
| 147 | + </tr> | ||
| 148 | + <tr> | ||
| 149 | + <th width="30%">活动简述</th> | ||
| 150 | + <th id="live_desper"></th> | ||
| 151 | + </tr> | ||
| 152 | + <tr> | ||
| 153 | + <th width="30%">live_url</th> | ||
| 154 | + <th id="live_url"></th> | ||
| 155 | + </tr> | ||
| 156 | + <tr> | ||
| 157 | + <th width="30%">活动简述</th> | ||
| 158 | + <th id=""></th> | ||
| 159 | + </tr> | ||
| 160 | + | ||
| 161 | + | ||
| 162 | + | ||
| 163 | + </table> | ||
| 164 | + </div> | ||
| 165 | + | ||
| 166 | + </div> | ||
| 167 | + | ||
| 168 | + <div class="divright"> | ||
| 169 | + <!--五列开始--> | ||
| 170 | + | ||
| 171 | + <div class="row"> | ||
| 172 | + <c:forEach var="item" items="${tLive.recordList}" | ||
| 173 | + varStatus="stat"> | ||
| 174 | + <div id="paly_live_${item.id}" class="left3" | ||
| 175 | + onclick="getParam('${item.id}','${item.title}','${item.live_url}','${item.start_time}','${item.end_time}')"> | ||
| 176 | + ${item.title} | ||
| 177 | + <p>这是五列的第一列</p> | ||
| 178 | + <p></p> | ||
| 179 | + <p></p> | ||
| 180 | + </div> | ||
| 181 | + </c:forEach> | ||
| 182 | + <!-- <div class="left3"> | ||
| 183 | + | ||
| 184 | + <p>这是五列的第一列</p> | ||
| 185 | + <p></p> | ||
| 186 | + <p></p> | ||
| 187 | + </div> | ||
| 188 | + <div class="left3"> | ||
| 189 | + <p>这是五列的第二列</p> | ||
| 190 | + <p></p> | ||
| 191 | + <p></p> | ||
| 192 | + </div> | ||
| 193 | + <div class="left3"> | ||
| 194 | + <p>这是五列的第三列</p> | ||
| 195 | + <p></p> | ||
| 196 | + <p></p> | ||
| 197 | + </div> | ||
| 198 | + <div class="left3"> | ||
| 199 | + <p>这是五列的第四列</p> | ||
| 200 | + <p></p> | ||
| 201 | + <p></p> | ||
| 202 | + </div> | ||
| 203 | + | ||
| 204 | + </div> | ||
| 205 | + | ||
| 206 | + <div class="row"> | ||
| 207 | + <div class="left3"> | ||
| 208 | + <p>这是五列的第一列</p> | ||
| 209 | + <p></p> | ||
| 210 | + <p></p> | ||
| 211 | + </div> | ||
| 212 | + <div class="left3"> | ||
| 213 | + <p>这是五列的第二列</p> | ||
| 214 | + <p></p> | ||
| 215 | + <p></p> | ||
| 216 | + </div> | ||
| 217 | + <div class="left3"> | ||
| 218 | + <p>这是五列的第三列</p> | ||
| 219 | + <p></p> | ||
| 220 | + <p></p> | ||
| 221 | + </div> | ||
| 222 | + <div class="left3"> | ||
| 223 | + <p>这是五列的第四列</p> | ||
| 224 | + <p></p> | ||
| 225 | + <p></p> | ||
| 226 | + </div> | ||
| 227 | + | ||
| 228 | + </div> | ||
| 229 | + <div class="row"> | ||
| 230 | + <div class="left3"> | ||
| 231 | + <p>这是五列的第一列</p> | ||
| 232 | + <p></p> | ||
| 233 | + <p></p> | ||
| 234 | + </div> | ||
| 235 | + <div class="left3"> | ||
| 236 | + <p>这是五列的第二列</p> | ||
| 237 | + <p></p> | ||
| 238 | + <p></p> | ||
| 239 | + </div> | ||
| 240 | + <div class="left3"> | ||
| 241 | + <p>这是五列的第三列</p> | ||
| 242 | + <p></p> | ||
| 243 | + <p></p> | ||
| 244 | + </div> | ||
| 245 | + <div class="left3"> | ||
| 246 | + <p>这是五列的第四列</p> | ||
| 247 | + <p></p> | ||
| 248 | + <p></p> | ||
| 249 | + </div> | ||
| 250 | + | ||
| 251 | + </div> | ||
| 252 | + <div class="row"> | ||
| 253 | + <div class="left3"> | ||
| 254 | + <p>这是五列的第一列</p> | ||
| 255 | + <p></p> | ||
| 256 | + <p></p> | ||
| 257 | + </div> | ||
| 258 | + <div class="left3"> | ||
| 259 | + <p>这是五列的第二列</p> | ||
| 260 | + <p></p> | ||
| 261 | + <p></p> | ||
| 262 | + </div> | ||
| 263 | + <div class="left3"> | ||
| 264 | + <p>这是五列的第三列</p> | ||
| 265 | + <p></p> | ||
| 266 | + <p></p> | ||
| 267 | + </div> | ||
| 268 | + <div class="left3"> | ||
| 269 | + <p>这是五列的第四列</p> | ||
| 270 | + <p></p> | ||
| 271 | + <p></p> | ||
| 272 | + </div> --> | ||
| 273 | + | ||
| 274 | + </div> | ||
| 275 | + </div> | ||
| 276 | + </div> | ||
| 277 | + <div class="modal-body"> | ||
| 278 | + <div> | ||
| 279 | + <h4>100013-1463713882750.m3u8</h4> | ||
| 280 | + <div class="error-ctn"></div> | ||
| 281 | + <div class="preview-ctn" id="preview-ctn"> | ||
| 282 | + <object | ||
| 283 | + pluginspage="http://www.macromedia.com/go/getflashplayer" | ||
| 284 | + classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" | ||
| 285 | + codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=11,3,0,0" | ||
| 286 | + width="100%" height="400" id="ckplayer_a2" name="ckplayer_a2" | ||
| 287 | + align="middle"> | ||
| 288 | + <param name="allowScriptAccess" value="always"> | ||
| 289 | + <param name="allowFullScreen" value="true"> | ||
| 290 | + <param name="quality" value="high"> | ||
| 291 | + <param name="bgcolor" value="#FFF"> | ||
| 292 | + <param name="wmode" value="transparent"> | ||
| 293 | + <param name="movie" value="flash/ckplayer.swf"> | ||
| 294 | + <param name="flashvars" | ||
| 295 | + value="f=http://kls.ksyun.com/flash/m3u8.swf&a=http://com.cnlive.video.kssws.ks-cdn.com/record/live/100013/hls/100013-1463713882750.m3u8&c=0&s=4&lv=0"> | ||
| 296 | + <embed allowscriptaccess="always" allowfullscreen="true" | ||
| 297 | + quality="high" bgcolor="#FFF" wmode="transparent" | ||
| 298 | + src="flash/ckplayer.swf" | ||
| 299 | + flashvars="f=http://kls.ksyun.com/flash/m3u8.swf&a=http://com.cnlive.video.kssws.ks-cdn.com/record/live/100013/hls/100013-1463713882750.m3u8&c=0&s=4&lv=0" | ||
| 300 | + width="100%" height="400" name="ckplayer_a2" | ||
| 301 | + id="ckplayer_a2" align="middle" | ||
| 302 | + type="application/x-shockwave-flash" | ||
| 303 | + pluginspage="http://www.macromedia.com/go/getflashplayer"> | ||
| 304 | + </object> | ||
| 305 | + </div> | ||
| 306 | + </div> | ||
| 307 | + </div> | ||
| 308 | + | ||
| 309 | + <!-- <table class="table table-bordered"> | ||
| 310 | + <tr> | ||
| 311 | + <th rowspan="4"><div class="divcss"></div>活动名称</th> | ||
| 312 | + <th><div class="divcss5"></div></th> | ||
| 313 | + <th><div class="divcss5"></div></th> | ||
| 314 | + <th><div class="divcss5"></div></th> | ||
| 315 | + <th><div class="divcss5"></div></th> | ||
| 316 | + </tr> | ||
| 317 | + <tr> | ||
| 318 | + <th><div class="divcss5"></div></th> | ||
| 319 | + <th><div class="divcss5"></div></th> | ||
| 320 | + <th><div class="divcss5"></div></th> | ||
| 321 | + <th><div class="divcss5"></div></th> | ||
| 322 | + </tr> | ||
| 323 | + <tr> | ||
| 324 | + <th><div class="divcss5"></div></th> | ||
| 325 | + <th><div class="divcss5"></div></th> | ||
| 326 | + <th><div class="divcss5"></div></th> | ||
| 327 | + <th><div class="divcss5"></div></th> | ||
| 328 | + </tr> | ||
| 329 | + <tr> | ||
| 330 | + <th><div class="divcss5"></div></th> | ||
| 331 | + <th><div class="divcss5"></div></th> | ||
| 332 | + <th><div class="divcss5"></div></th> | ||
| 333 | + <th><div class="divcss5"></div></th> | ||
| 334 | + </tr> | ||
| 335 | + | ||
| 336 | + | ||
| 337 | + </table> --> | ||
| 338 | + </div> | ||
| 339 | + <!-- /.box-body --> | ||
| 340 | + | ||
| 341 | + </div> | ||
| 342 | + </div> | ||
| 343 | + </section> | ||
| 344 | + </div> | ||
| 345 | + </div> | ||
| 346 | + <%@ include file="/pages/common/bottom.jsp"%> | ||
| 347 | + <%@ include file="/pages/common/js.jsp"%> | ||
| 348 | + <script type="text/javascript"> | ||
| 349 | + function getParam(id, name, live_url, start_time, end_time) { | ||
| 350 | + | ||
| 351 | + $("#live_name").html(name); | ||
| 352 | + $("#start_time").html(start_time); | ||
| 353 | + $("#end_time").html(end_time); | ||
| 354 | + $("#live_url").html(live_url); | ||
| 355 | + alert(id); | ||
| 356 | + } | ||
| 357 | + </script> | ||
| 358 | +</body> | ||
| 359 | +</html> |
src/main/webapp/pages/check/m3u8.swf
0 → 100644
No preview for this file type
src/main/webapp/pages/live/live_edit.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 | + | ||
| 13 | +<style type="text/css"> | ||
| 14 | + span.error{ | ||
| 15 | + padding-left: 15px; | ||
| 16 | + color: red; | ||
| 17 | + } | ||
| 18 | + </style> | ||
| 19 | +<link | ||
| 20 | + href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css" | ||
| 21 | + rel="stylesheet"> | ||
| 22 | + <script type="text/javascript" charset="utf-8" src="${BASE}/static/assets/ueditor/ueditor.config.js"></script> | ||
| 23 | + <script type="text/javascript" charset="utf-8" src="${BASE}/static/assets/ueditor/ueditor.all.min.js"> </script> | ||
| 24 | + <script type="text/javascript" charset="utf-8" src="${BASE}/static/assets/ueditor/lang/zh-cn/zh-cn.js"></script> | ||
| 25 | + | ||
| 26 | +</head> | ||
| 27 | +<body class="skin-blue fixed "> | ||
| 28 | + <div class="wrapper"> | ||
| 29 | + <%@ include file="/pages/common/top.jsp"%> | ||
| 30 | + <%@ include file="/pages/common/left.jsp"%> | ||
| 31 | + <div class="content-wrapper"> | ||
| 32 | + <section class="content-header"> | ||
| 33 | + <h1>${empty tActivity.id ? '新建活动':'编辑活动'} | ||
| 34 | + <small>${tActivity.title}</small> <small class="label label-warning" | ||
| 35 | + style="display: none" id="info_tab_span"><i | ||
| 36 | + class="fa fa-bell-o"></i>保存成功</small> | ||
| 37 | + </h1> | ||
| 38 | + <ol class="breadcrumb"> | ||
| 39 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 40 | + <li class="active">修改活动</li> | ||
| 41 | + </ol> | ||
| 42 | + </section> | ||
| 43 | + <!-- Main content --> | ||
| 44 | + <section class="content"> | ||
| 45 | + <form id="create_form" enctype="multipart/form-data" method="post" > | ||
| 46 | + <div class="row"> | ||
| 47 | + <!-- right column --> | ||
| 48 | + <div class="col-md-12"> | ||
| 49 | + <!-- general form elements disabled --> | ||
| 50 | + <div class="box box-warning"> | ||
| 51 | + <div class="box-body"> | ||
| 52 | + <div class="form-group"> | ||
| 53 | + <label> 活动名称 </label> | ||
| 54 | + <div class="input-group"> | ||
| 55 | + <span class="input-group-addon"><i class="fa fa-font"></i> | ||
| 56 | + </span> <input type="text" value="${tActivity.title }" name="name" | ||
| 57 | + id="name" class="form-control"> | ||
| 58 | + <input type="text" id="activity_id" name="activity_id" value="${tActivity.id}" hidden=""> | ||
| 59 | + </div> | ||
| 60 | + </div> | ||
| 61 | + <div class="form-group"> | ||
| 62 | + <label> 直播时间 </label> | ||
| 63 | + <div class="row"> | ||
| 64 | + <div class="col-lg-6"> | ||
| 65 | + <div class="input-group"> | ||
| 66 | + <span class="input-group-addon"> 开始时间 </span> <input | ||
| 67 | + type="text" class="form-control form_datetime" | ||
| 68 | + value="<fmt:formatDate value="${tActivity.start_time}" pattern="yyyy-MM-dd HH:mm"/>" | ||
| 69 | + name="start_time" id="start_time" | ||
| 70 | + data-inputmask="'alias': 'yyyy-MM-dd HH:mm'" data-mask="" /> | ||
| 71 | + </div> | ||
| 72 | + </div> | ||
| 73 | + <div class="col-lg-6"> | ||
| 74 | + <div class="input-group"> | ||
| 75 | + <span class="input-group-addon"> 结束时间</span> <input | ||
| 76 | + type="text" class="form-control form_datetime" | ||
| 77 | + value="<fmt:formatDate value="${tActivity.end_time}" pattern="yyyy-MM-dd HH:mm"/>" | ||
| 78 | + name="end_time" id="end_time" | ||
| 79 | + data-inputmask="'alias': 'yyyy-MM-dd HH:mm'" data-mask=""> | ||
| 80 | + </div> | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + </div> | ||
| 84 | + <div class="form-group"> | ||
| 85 | + <label>海报 </label> | ||
| 86 | + <img src="E:/image/0.jpg" class="user-image" alt="User Image" /> | ||
| 87 | + <div class="input-group"> | ||
| 88 | + <span class="input-group-addon"><i | ||
| 89 | + class="fa fa-file-word-o"></i> </span> <input id="input-22" type="file" value="${tActivity.poster}"name="input-22" accept="image/*" class="file-loading"> | ||
| 90 | + </div> | ||
| 91 | + </div> | ||
| 92 | + <div class="form-group"> | ||
| 93 | + <label> 播出直播间 </label> | ||
| 94 | + <div class="box box-warning"> | ||
| 95 | + <div class="box-body"> | ||
| 96 | + <div class="form-group"> | ||
| 97 | + <select class="form-control" name="t_room_id" | ||
| 98 | + id="t_room_id"> | ||
| 99 | + <c:forEach var="item" items="${tRooms}" | ||
| 100 | + varStatus="stat"> | ||
| 101 | + <option id="t_room_id_${item.id}" ${item.id==tActivity.live_room_id ? 'selected="selected"':''} value="${item.id}">${item.name}</option> | ||
| 102 | + </c:forEach> | ||
| 103 | + </select> | ||
| 104 | + </div> | ||
| 105 | + </div> | ||
| 106 | + </div> | ||
| 107 | + </div> | ||
| 108 | + | ||
| 109 | + <div class="form-group"> | ||
| 110 | + <label>活动简述 </label> | ||
| 111 | + <div class="input-group"> | ||
| 112 | + <span class="input-group-addon"><i | ||
| 113 | + class="fa fa-file-word-o"></i> </span> <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script> | ||
| 114 | + </div> | ||
| 115 | + </div> | ||
| 116 | + <div class="box-footer"> | ||
| 117 | + <button type="submit" id="t_activity_save_btn" | ||
| 118 | + name="t_activity_save_btn" class="btn btn-success"> | ||
| 119 | + <i class="fa fa-save "></i> 保存 | ||
| 120 | + </button> | ||
| 121 | + </div> | ||
| 122 | + </div> | ||
| 123 | + </div> | ||
| 124 | + </div> | ||
| 125 | + </div> | ||
| 126 | + </form> | ||
| 127 | + </div> | ||
| 128 | + </section> | ||
| 129 | + </div> | ||
| 130 | + </div> | ||
| 131 | + <%@ include file="/pages/common/bottom.jsp"%> | ||
| 132 | +</div> | ||
| 133 | + <!-- 信号选择结束 --> | ||
| 134 | + <%@ include file="/pages/common/js.jsp"%> | ||
| 135 | + | ||
| 136 | + <script type="text/javascript"> | ||
| 137 | + | ||
| 138 | + | ||
| 139 | + $(function () { | ||
| 140 | + //Money Euro | ||
| 141 | + $("[data-mask]").inputmask(); | ||
| 142 | + }); | ||
| 143 | + | ||
| 144 | + $(function () { | ||
| 145 | + $("#datemask").inputmask("dd/mm/yyyy", {"placeholder": "dd/mm/yyyy"}); | ||
| 146 | + //Datemask2 mm/dd/yyyy | ||
| 147 | + $("#datemask2").inputmask("mm/dd/yyyy", {"placeholder": "mm/dd/yyyy"}); | ||
| 148 | + //Money Euro | ||
| 149 | + $("[data-mask]").inputmask(); | ||
| 150 | + | ||
| 151 | + //Date range picker | ||
| 152 | + $('#reservation').daterangepicker(); | ||
| 153 | + //Date range picker with time picker | ||
| 154 | + $('#reservationtime').daterangepicker({timePicker: true, timePickerIncrement: 30, format: 'MM/DD/YYYY h:mm A'}); | ||
| 155 | + //Date range as a button | ||
| 156 | + $('#daterange-btn').daterangepicker( | ||
| 157 | + { | ||
| 158 | + ranges: { | ||
| 159 | + 'Today': [moment(), moment()], | ||
| 160 | + 'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)], | ||
| 161 | + 'Last 7 Days': [moment().subtract('days', 6), moment()], | ||
| 162 | + 'Last 30 Days': [moment().subtract('days', 29), moment()], | ||
| 163 | + 'This Month': [moment().startOf('month'), moment().endOf('month')], | ||
| 164 | + 'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')] | ||
| 165 | + }, | ||
| 166 | + startDate: moment().subtract('days', 29), | ||
| 167 | + endDate: moment() | ||
| 168 | + }, | ||
| 169 | + function (start, end) { | ||
| 170 | + $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')); | ||
| 171 | + } | ||
| 172 | + ); | ||
| 173 | + }); | ||
| 174 | + </script> | ||
| 175 | + | ||
| 176 | + | ||
| 177 | + <!-- Le javascript | ||
| 178 | + ================================================== --> | ||
| 179 | + <script | ||
| 180 | + src="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script> | ||
| 181 | + | ||
| 182 | + <script type="text/javascript"> | ||
| 183 | + $(".form_datetime").datetimepicker({ | ||
| 184 | + //format: "dd MM yyyy - hh:ii", | ||
| 185 | + format: "yyyy-mm-dd hh:ii", | ||
| 186 | + autoclose: true, | ||
| 187 | + todayBtn: true, | ||
| 188 | + pickerPosition: "bottom-right" | ||
| 189 | + }); | ||
| 190 | +</script> | ||
| 191 | + | ||
| 192 | +<script type="text/javascript"> | ||
| 193 | + | ||
| 194 | + //实例化编辑器 | ||
| 195 | + //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例 | ||
| 196 | + var ue = UE.getEditor('editor',{ | ||
| 197 | + autoHeightEnabled: true, | ||
| 198 | + autoFloatEnabled: true | ||
| 199 | + }); | ||
| 200 | + | ||
| 201 | + | ||
| 202 | + function isFocus(e){ | ||
| 203 | + alert(UE.getEditor('editor').isFocus()); | ||
| 204 | + UE.dom.domUtils.preventDefault(e) | ||
| 205 | + } | ||
| 206 | + function setblur(e){ | ||
| 207 | + UE.getEditor('editor').blur(); | ||
| 208 | + UE.dom.domUtils.preventDefault(e) | ||
| 209 | + } | ||
| 210 | + function insertHtml() { | ||
| 211 | + var value = prompt('插入html代码', ''); | ||
| 212 | + UE.getEditor('editor').execCommand('insertHtml', value) | ||
| 213 | + } | ||
| 214 | + function createEditor() { | ||
| 215 | + enableBtn(); | ||
| 216 | + UE.getEditor('editor'); | ||
| 217 | + } | ||
| 218 | + function getAllHtml() { | ||
| 219 | + alert(UE.getEditor('editor').getAllHtml()) | ||
| 220 | + } | ||
| 221 | + function getContent() { | ||
| 222 | + var arr = []; | ||
| 223 | + arr.push("使用editor.getContent()方法可以获得编辑器的内容"); | ||
| 224 | + arr.push("内容为:"); | ||
| 225 | + arr.push(UE.getEditor('editor').getContent()); | ||
| 226 | + alert(arr.join("\n")); | ||
| 227 | + } | ||
| 228 | + function getPlainTxt() { | ||
| 229 | + var arr = []; | ||
| 230 | + arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容"); | ||
| 231 | + arr.push("内容为:"); | ||
| 232 | + arr.push(UE.getEditor('editor').getPlainTxt()); | ||
| 233 | + alert(arr.join('\n')) | ||
| 234 | + } | ||
| 235 | + function setContent(isAppendTo) { | ||
| 236 | + var arr = []; | ||
| 237 | + arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容"); | ||
| 238 | + UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo); | ||
| 239 | + alert(arr.join("\n")); | ||
| 240 | + } | ||
| 241 | + function setDisabled() { | ||
| 242 | + UE.getEditor('editor').setDisabled('fullscreen'); | ||
| 243 | + disableBtn("enable"); | ||
| 244 | + } | ||
| 245 | + | ||
| 246 | + function setEnabled() { | ||
| 247 | + UE.getEditor('editor').setEnabled(); | ||
| 248 | + enableBtn(); | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + function getText() { | ||
| 252 | + //当你点击按钮时编辑区域已经失去了焦点,如果直接用getText将不会得到内容,所以要在选回来,然后取得内容 | ||
| 253 | + var range = UE.getEditor('editor').selection.getRange(); | ||
| 254 | + range.select(); | ||
| 255 | + var txt = UE.getEditor('editor').selection.getText(); | ||
| 256 | + alert(txt) | ||
| 257 | + } | ||
| 258 | + | ||
| 259 | + function getContentTxt() { | ||
| 260 | + var arr = []; | ||
| 261 | + arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容"); | ||
| 262 | + arr.push("编辑器的纯文本内容为:"); | ||
| 263 | + arr.push(UE.getEditor('editor').getContentTxt()); | ||
| 264 | + alert(arr.join("\n")); | ||
| 265 | + } | ||
| 266 | + function hasContent() { | ||
| 267 | + var arr = []; | ||
| 268 | + arr.push("使用editor.hasContents()方法判断编辑器里是否有内容"); | ||
| 269 | + arr.push("判断结果为:"); | ||
| 270 | + arr.push(UE.getEditor('editor').hasContents()); | ||
| 271 | + alert(arr.join("\n")); | ||
| 272 | + } | ||
| 273 | + function setFocus() { | ||
| 274 | + UE.getEditor('editor').focus(); | ||
| 275 | + } | ||
| 276 | + function deleteEditor() { | ||
| 277 | + disableBtn(); | ||
| 278 | + UE.getEditor('editor').destroy(); | ||
| 279 | + } | ||
| 280 | + function disableBtn(str) { | ||
| 281 | + var div = document.getElementById('btns'); | ||
| 282 | + var btns = UE.dom.domUtils.getElementsByTagName(div, "button"); | ||
| 283 | + for (var i = 0, btn; btn = btns[i++];) { | ||
| 284 | + if (btn.id == str) { | ||
| 285 | + UE.dom.domUtils.removeAttributes(btn, ["disabled"]); | ||
| 286 | + } else { | ||
| 287 | + btn.setAttribute("disabled", "true"); | ||
| 288 | + } | ||
| 289 | + } | ||
| 290 | + } | ||
| 291 | + function enableBtn() { | ||
| 292 | + var div = document.getElementById('btns'); | ||
| 293 | + var btns = UE.dom.domUtils.getElementsByTagName(div, "button"); | ||
| 294 | + for (var i = 0, btn; btn = btns[i++];) { | ||
| 295 | + UE.dom.domUtils.removeAttributes(btn, ["disabled"]); | ||
| 296 | + } | ||
| 297 | + } | ||
| 298 | + | ||
| 299 | + function getLocalData () { | ||
| 300 | + alert(UE.getEditor('editor').execCommand( "getlocaldata" )); | ||
| 301 | + } | ||
| 302 | + | ||
| 303 | + function clearLocalData () { | ||
| 304 | + UE.getEditor('editor').execCommand( "clearlocaldata" ); | ||
| 305 | + alert("已清空草稿箱") | ||
| 306 | + } | ||
| 307 | + | ||
| 308 | + $(document).on('ready', function() { | ||
| 309 | + $("#input-22").fileinput({ | ||
| 310 | + previewFileType : "image", | ||
| 311 | + browseClass : "btn btn-success", | ||
| 312 | + browseLabel : "Pick Image", | ||
| 313 | + browseIcon : "<i class=\"glyphicon glyphicon-picture\"></i> ", | ||
| 314 | + removeClass : "btn btn-danger", | ||
| 315 | + removeLabel : "Delete", | ||
| 316 | + removeIcon : "<i class=\"glyphicon glyphicon-trash\"></i> ", | ||
| 317 | + uploadClass : "btn btn-info", | ||
| 318 | + uploadLabel : "Upload", | ||
| 319 | + uploadIcon : "<i class=\"glyphicon glyphicon-upload\"></i> " | ||
| 320 | + }); | ||
| 321 | + | ||
| 322 | + $(function() { | ||
| 323 | + $('#create_form').ajaxForm({ | ||
| 324 | + type : 'post', | ||
| 325 | + url : '../../live/save', | ||
| 326 | + enctype : 'multipart/form-data', | ||
| 327 | + beforeSubmit : function() { | ||
| 328 | + return true; | ||
| 329 | + }, | ||
| 330 | + error : function(XMLHttpRequest, textStatus, errorThrown) { | ||
| 331 | + alert("错误"); | ||
| 332 | + }, | ||
| 333 | + success : function(result) { | ||
| 334 | + location.href = '../../live/list/1'; | ||
| 335 | + } | ||
| 336 | + }); | ||
| 337 | + }); | ||
| 338 | + }); | ||
| 339 | + | ||
| 340 | + /* $(function() { | ||
| 341 | + $('#create_form').ajaxForm({ | ||
| 342 | + type : 'post', | ||
| 343 | + url : '../live/save', | ||
| 344 | + enctype : 'multipart/form-data', | ||
| 345 | + beforeSubmit : function() { | ||
| 346 | + var cms_column_ref_id=$("#input-22").val(); | ||
| 347 | + if(cms_column_ref_id==''){ | ||
| 348 | + alert("请输入栏目名称,点击获取,然后选择!"); | ||
| 349 | + return false; | ||
| 350 | + } | ||
| 351 | + }, | ||
| 352 | + error : function(XMLHttpRequest, textStatus, errorThrown) { | ||
| 353 | + alert("错误"); | ||
| 354 | + }, | ||
| 355 | + success : function(result) { | ||
| 356 | + location.href = '../live/list/1'; | ||
| 357 | + } | ||
| 358 | + }); | ||
| 359 | + }); | ||
| 360 | + */ | ||
| 361 | + | ||
| 362 | +</script> | ||
| 363 | +</body> | ||
| 364 | +</html> |
src/main/webapp/pages/live/live_preview.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> |
src/main/webapp/pages/room/room_edit.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 | +<link href="${BASE}/static/assets/plugins/uploadfile/css/fileinput.css" | ||
| 13 | + media="all" rel="stylesheet" type="text/css" /> | ||
| 14 | +<!--[if IE]> | ||
| 15 | + <script src="http://libs.useso.com/js/html5shiv/3.7/html5shiv.min.js"></script> | ||
| 16 | + <![endif]--> | ||
| 17 | +</head> | ||
| 18 | +<body class="skin-blue sidebar-mini"> | ||
| 19 | + <div class="wrapper"> | ||
| 20 | + <%@ include file="/pages/common/top.jsp"%> | ||
| 21 | + <%@ include file="/pages/common/left.jsp"%> | ||
| 22 | + <div class="content-wrapper"> | ||
| 23 | + <!-- Content Header (Page header) --> | ||
| 24 | + <section class="content-header"> | ||
| 25 | + <h1> | ||
| 26 | + ${empty tRoom.id ? '新建直播间':'编辑直播间'} <small>${tRoom.name}</small> <small | ||
| 27 | + class="label label-warning" style="display: none" | ||
| 28 | + id="info_tab_span"><i class="fa fa-bell-o"></i>保存成功</small> | ||
| 29 | + </h1> | ||
| 30 | + <ol class="breadcrumb"> | ||
| 31 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 32 | + <li class="active">修改直播间</li> | ||
| 33 | + </ol> | ||
| 34 | + </section> | ||
| 35 | + <!-- Main content --> | ||
| 36 | + <section class="content"> | ||
| 37 | + <div class="row"> | ||
| 38 | + <div class="col-md-12"> | ||
| 39 | + <form id="create_form" enctype="multipart/form-data" method="post"> | ||
| 40 | + <div class="box box-success"> | ||
| 41 | + <div class="box-body"> | ||
| 42 | + <div class="form-group"> | ||
| 43 | + <label>直播间名称 </label> | ||
| 44 | + <div class="input-group"> | ||
| 45 | + <span class="input-group-addon"><i class="fa fa-font"></i> | ||
| 46 | + </span> <input type="text" class="form-control" | ||
| 47 | + value="${tRoom.name}" id="name" name="name"> | ||
| 48 | + </div> | ||
| 49 | + </div> | ||
| 50 | + <div class="form-group"> | ||
| 51 | + <label>海报 </label> | ||
| 52 | + <div class="input-group"> | ||
| 53 | + <div class="input-group-addon"> | ||
| 54 | + <i class="fa fa-file-image-o"></i> | ||
| 55 | + </div> | ||
| 56 | + <input id="input-22" type="file" name="input-22" | ||
| 57 | + accept="image/*" class="file-loading"> | ||
| 58 | + </div> | ||
| 59 | + </div> | ||
| 60 | + </div> | ||
| 61 | + <input id="id" type="hidden" name="id" value="${tRoom.id}"> | ||
| 62 | + <button type="submit" id="t_channel_save_btn" | ||
| 63 | + class="btn btn-primary"> | ||
| 64 | + <i class="fa fa-save "></i> 保存 | ||
| 65 | + </button> | ||
| 66 | + </form> | ||
| 67 | + </div> | ||
| 68 | + </div> | ||
| 69 | + </section> | ||
| 70 | + </div> | ||
| 71 | + <%@ include file="/pages/common/bottom.jsp"%> | ||
| 72 | + </div> | ||
| 73 | + <%@ include file="/pages/common/js.jsp"%> | ||
| 74 | + <script src="${BASE}/static/assets/cnlive/js/Math.uuid.js"></script> | ||
| 75 | + <script src="${BASE}/static/assets/cnlive/js/ajax_rest.js"></script> | ||
| 76 | + <script | ||
| 77 | + src="${BASE}/static/assets/cnlive/js/validate/validate_channel.js" | ||
| 78 | + type="text/javascript"></script> | ||
| 79 | + <script src="${BASE}/static/assets/plugins/uploadfile/js/fileinput.js" | ||
| 80 | + type="text/javascript"></script> | ||
| 81 | + <script | ||
| 82 | + src="${BASE}/static/assets/plugins/uploadfile/js/fileinput_locale_zh.js" | ||
| 83 | + type="text/javascript"></script> | ||
| 84 | + | ||
| 85 | + <script type="text/javascript"> | ||
| 86 | + $(document).on('ready', function() { | ||
| 87 | + $("#input-22").fileinput({ | ||
| 88 | + previewFileType: "image", | ||
| 89 | + browseClass: "btn btn-success", | ||
| 90 | + browseLabel: "Pick Image", | ||
| 91 | + browseIcon: "<i class=\"glyphicon glyphicon-picture\"></i> ", | ||
| 92 | + removeClass: "btn btn-danger", | ||
| 93 | + removeLabel: "Delete", | ||
| 94 | + removeIcon: "<i class=\"glyphicon glyphicon-trash\"></i> ", | ||
| 95 | + uploadClass: "btn btn-info", | ||
| 96 | + uploadLabel: "Upload", | ||
| 97 | + uploadIcon: "<i class=\"glyphicon glyphicon-upload\"></i> " | ||
| 98 | + }); | ||
| 99 | + }); | ||
| 100 | + | ||
| 101 | + $(function() { | ||
| 102 | + $('#create_form').ajaxForm({ | ||
| 103 | + type : 'post', | ||
| 104 | + url : '../../room/editSave', | ||
| 105 | + enctype : 'multipart/form-data', | ||
| 106 | + beforeSubmit : function() { | ||
| 107 | + return true; | ||
| 108 | + }, | ||
| 109 | + error : function(XMLHttpRequest, textStatus, errorThrown) { | ||
| 110 | + alert("错误"); | ||
| 111 | + }, | ||
| 112 | + success : function(result) { | ||
| 113 | + location.href = '../../room/list/1'; | ||
| 114 | + } | ||
| 115 | + }); | ||
| 116 | + }); | ||
| 117 | + | ||
| 118 | + </script> | ||
| 119 | +</body> | ||
| 120 | +</html> |
src/main/webapp/static/assets/cnlive/js/live.js
0 → 100644
| 1 | +function toSubmit(){ | ||
| 2 | + $("#activityForm").submit(); | ||
| 3 | +} | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +//修改直播开始结束时间 | ||
| 7 | +function update_activity_time(){ | ||
| 8 | + var start_time= $('#start_time').val(); | ||
| 9 | + var end_time= $('#end_time').val(); | ||
| 10 | + var id=$('#activity_id').val(); | ||
| 11 | + $.ajax({ | ||
| 12 | + url : BASE+'/activity/update/time/', | ||
| 13 | + type : 'post', | ||
| 14 | + async : true, | ||
| 15 | + error : function() { | ||
| 16 | + alert("请求错误"); | ||
| 17 | + console.log(XMLHttpRequest.status); | ||
| 18 | + console.log(XMLHttpRequest.readyState); | ||
| 19 | + }, | ||
| 20 | + data : { | ||
| 21 | + id :id, | ||
| 22 | + start_time :start_time, | ||
| 23 | + end_time:end_time | ||
| 24 | + }, | ||
| 25 | + success : function(data) { | ||
| 26 | + $("#update_time_btn").html("保存成功"); | ||
| 27 | + $("#update_time_btn").attr("disabled", true); | ||
| 28 | + } | ||
| 29 | + }); | ||
| 30 | +} | ||
| 31 | + | ||
| 32 | +function preload_wowza(id){ | ||
| 33 | + window.location.href=BASE+ "/activity/preloadWowza/"+id; | ||
| 34 | +} | ||
| 35 | +function t_live_edit(id){ | ||
| 36 | + window.location.href=BASE+ "/live/edit/"+id; | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | + | ||
| 40 | +function to_step_before(id){ | ||
| 41 | + window.location.href=BASE+ "/activity/stepBefore/"+id; | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +function to_step_in(id){ | ||
| 45 | + window.location.href=BASE+ "/activity/stepIn/"+id; | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | +function to_step_after(id){ | ||
| 49 | + window.location.href=BASE+ "/activity/stepAfter/"+id; | ||
| 50 | +} | ||
| 51 | + | ||
| 52 | +function show_time_div(){ | ||
| 53 | + var state =$("#eidt_time_li").css('display'); | ||
| 54 | + if (state=='none') { | ||
| 55 | + $("#eidt_time_li").show(); | ||
| 56 | + }else{ | ||
| 57 | + $("#eidt_time_li").hide(); | ||
| 58 | + } | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +function to_stop(id){ | ||
| 62 | + $("#reset_btn").html("后台处理中..."); | ||
| 63 | + $("#reset_btn").attr("disabled", "disabled"); | ||
| 64 | + $.ajax({ | ||
| 65 | + url : BASE+'/activity/stop/'+id, | ||
| 66 | + type : 'get', | ||
| 67 | + datatype : "json", | ||
| 68 | + async : true, | ||
| 69 | + error : function() { | ||
| 70 | + alert("请求错误"); | ||
| 71 | + console.log(XMLHttpRequest.status); | ||
| 72 | + $("#reset_btn").html("复位中..."); | ||
| 73 | + }, | ||
| 74 | + success : function(data) { | ||
| 75 | + if (data.success) { | ||
| 76 | + $("#reset_btn").html("信号已复位"); | ||
| 77 | + $("#publish_div").html(""); | ||
| 78 | + var btn='<button type="button" id="publishreview_btn" style="width: 250px; height: 100px" class="btn btn-block btn-lg btn-warning" onclick="do_publishreview(${tActivity.id});" class="btn btn-warning">发布直播回放</button>'; | ||
| 79 | + $("#publish_div").html(""); | ||
| 80 | + }else{ | ||
| 81 | + $("#reset_btn").html("信号复位失败,或者活动已经结束"); | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + }); | ||
| 85 | + | ||
| 86 | +} | ||
| 87 | +//获取tree 所选值 | ||
| 88 | +//function select_wowza_signal(){ | ||
| 89 | +// var tree_node=$(".easy-tree").find('li.li_selected'); | ||
| 90 | +// var id=tree_node.attr('id'); | ||
| 91 | +// $("#t_wowza_stream_id_tip").val(tree_node.text()); | ||
| 92 | +// $("#t_wowza_stream_id").val(id); | ||
| 93 | +// $("#wowza_modal").modal('hide'); | ||
| 94 | +//} | ||
| 95 | + | ||
| 96 | +function copy_name(){ | ||
| 97 | + var name=$('#name').val(); | ||
| 98 | + $('#epg_name').val(name); | ||
| 99 | +} | ||
| 100 | + | ||
| 101 | + | ||
| 102 | +function save_confirm(){ | ||
| 103 | + var start_time= $('#start_time').val(); | ||
| 104 | + console.log(start_time); | ||
| 105 | + var t_wowza_stream_id_tip=$("#t_wowza_stream_id_tip").val(); | ||
| 106 | + var channel_names=""; | ||
| 107 | + $("input[name='channel_id']:checked").each(function(){ | ||
| 108 | + channel_names+=$(this).attr("title")+" 、"; | ||
| 109 | + }) | ||
| 110 | + var html="<p class=\"lead\"><h4>预计将在: <code>"+start_time+"</code></h4></p><p class=\"lead\"><h4>将信号: <code>"+t_wowza_stream_id_tip+"</code></h4></p><p class=\"lead\"><h4>切换至: <code>"+channel_names+"</code></h4></p>"; | ||
| 111 | + $("#tip_message").html(html); | ||
| 112 | + $("#save_confirm_modal").modal({backdrop: 'static', keyboard: false}); | ||
| 113 | +} | ||
| 114 | + | ||
| 115 | + | ||
| 116 | + | ||
| 117 | + | ||
| 118 | +function t_activity_save_or_update(id){ | ||
| 119 | + $("#t_activity_save_btn").html("后台处理中..."); | ||
| 120 | + //$("#t_activity_save_btn").attr("disabled", "disabled"); | ||
| 121 | + var is_free; | ||
| 122 | + $("input[name='is_free']:checked").each(function() { | ||
| 123 | + is_free = this.value; | ||
| 124 | + }); | ||
| 125 | + var is_playback; | ||
| 126 | + $("input[name='is_playback']:checked").each(function() { | ||
| 127 | + is_playback = this.value; | ||
| 128 | + }); | ||
| 129 | + | ||
| 130 | + var logo; | ||
| 131 | + $("input[name='logo']:checked").each(function() { | ||
| 132 | + logo = this.value; | ||
| 133 | + }); | ||
| 134 | + | ||
| 135 | + var channel_ids=""; | ||
| 136 | + $("input[name='channel_id']:checked").each(function(){ | ||
| 137 | + channel_ids+=$(this).val()+","; | ||
| 138 | + }) | ||
| 139 | + var is_main= $('#is_main').val(); | ||
| 140 | + var t_activity = new Object(); | ||
| 141 | + t_activity.name = $('#name').val(); | ||
| 142 | + t_activity.epg_name = $('#epg_name').val(); | ||
| 143 | + t_activity.description = $('#description').val(); | ||
| 144 | + t_activity.place = $('#place').val(); | ||
| 145 | + t_activity.start_time = $('#start_time').val(); | ||
| 146 | + t_activity.end_time = $('#end_time').val(); | ||
| 147 | + t_activity.contact_user =$('#contact_user').val(); | ||
| 148 | + t_activity.v_count = $('#v_count').val(); | ||
| 149 | + t_activity.is_free=is_free; | ||
| 150 | + t_activity.t_default_video_id=$("#t_default_video_id option:selected").val(); | ||
| 151 | + t_activity.is_playback=is_playback; | ||
| 152 | + t_activity.logo=logo; | ||
| 153 | + t_activity.uuid= $('#uuid').val(); | ||
| 154 | + t_activity.notify_user=$('#notify_user').val(); | ||
| 155 | + t_activity.chatroom_id=$('#chatroom_id').val(); | ||
| 156 | + var json = JSON.stringify(t_activity); | ||
| 157 | + $.ajax({ | ||
| 158 | + url : BASE+'/activity/add', | ||
| 159 | + type : 'post', | ||
| 160 | + datatype : "json", | ||
| 161 | + data : { | ||
| 162 | + id :id, | ||
| 163 | + json :json, | ||
| 164 | + is_main:is_main, | ||
| 165 | + channel_ids:channel_ids | ||
| 166 | + }, | ||
| 167 | + async : true, | ||
| 168 | + error : function() { | ||
| 169 | + alert("请求错误"); | ||
| 170 | + console.log(XMLHttpRequest.status); | ||
| 171 | + console.log(XMLHttpRequest.readyState); | ||
| 172 | + }, | ||
| 173 | + success : function(data) { | ||
| 174 | + $("#t_activity_save_btn").html("保存成功"); | ||
| 175 | + $("#t_activity_save_btn").attr("disabled", true); | ||
| 176 | + showTip(data.success); | ||
| 177 | + location.href = BASE+'/activity/list/1'; | ||
| 178 | + } | ||
| 179 | + }); | ||
| 180 | + $("#save_confirm_modal").modal('hide'); | ||
| 181 | +} | ||
| 182 | + | ||
| 183 | +//为活动添加wowza信号 | ||
| 184 | +function append_wowza(id){ | ||
| 185 | + $("#append_wowza_btn").html("保存中..."); | ||
| 186 | + $("#append_wowza_btn").attr("disabled", "disabled"); | ||
| 187 | + var t_wowza_stream_id; | ||
| 188 | + $("input[name='t_wowza_stream_id']:checked").each(function() { | ||
| 189 | + t_wowza_stream_id = this.value; | ||
| 190 | + }); | ||
| 191 | + if(t_wowza_stream_id==''){ | ||
| 192 | + alert("请选择对应是 wowza stream"); | ||
| 193 | + }else{ | ||
| 194 | + $.ajax({ | ||
| 195 | + url : BASE+'/activity/appendStream', | ||
| 196 | + type : 'post', | ||
| 197 | + data : { | ||
| 198 | + id :id, | ||
| 199 | + t_wowza_stream_id:t_wowza_stream_id | ||
| 200 | + }, | ||
| 201 | + async : true, | ||
| 202 | + error : function() { | ||
| 203 | + alert("请求错误"); | ||
| 204 | + console.log(XMLHttpRequest.status); | ||
| 205 | + console.log(XMLHttpRequest.readyState); | ||
| 206 | + }, | ||
| 207 | + success : function(data) { | ||
| 208 | + var fla=data.success; | ||
| 209 | + if(fla){ | ||
| 210 | + $("#append_wowza_btn").html("保存成功"); | ||
| 211 | + $("#append_wowza_btn").attr("disabled", true); | ||
| 212 | + showTip(fla); | ||
| 213 | + location.href = BASE+'/activity/list/1'; | ||
| 214 | + }else{ | ||
| 215 | + showTipWidthMsg(true,"请先为该活动指定输出频道,去修改直播活动!"); | ||
| 216 | + } | ||
| 217 | + } | ||
| 218 | + }); | ||
| 219 | + } | ||
| 220 | +} | ||
| 221 | + | ||
| 222 | +function t_activity_search(oid){ | ||
| 223 | + $("#t_activity_search_btn").html("后台处理中..."); | ||
| 224 | + $("#t_activity_search_btn").attr("disabled", "disabled"); | ||
| 225 | + var search_text= $('#search_text').val(); | ||
| 226 | + $.ajax({ | ||
| 227 | + url : BASE+'/activity/search/1', | ||
| 228 | + type : 'post', | ||
| 229 | + data : { | ||
| 230 | + name :search_text | ||
| 231 | + }, | ||
| 232 | + async : true, | ||
| 233 | + error : function() { | ||
| 234 | + alert('搜索发生错误!'); | ||
| 235 | + $("#t_activity_search_btn").attr("disabled", false); | ||
| 236 | + }, | ||
| 237 | + success : function(data) { | ||
| 238 | + | ||
| 239 | + } | ||
| 240 | + }); | ||
| 241 | +} | ||
| 242 | + | ||
| 243 | +//新建活动时选择输出频道 | ||
| 244 | +function select_channel(id){ | ||
| 245 | + var div =$("#div_channel_box_"+id); | ||
| 246 | + var div_inner_checkbox=div.find("input[type='checkbox']") | ||
| 247 | + var is_checked=div_inner_checkbox.is(':checked'); | ||
| 248 | + if (is_checked) { | ||
| 249 | + //取消选择 | ||
| 250 | + div.removeClass().addClass("small-box bg-aqua"); | ||
| 251 | + div_inner_checkbox.iCheck('uncheck'); | ||
| 252 | + }else{ | ||
| 253 | + div_inner_checkbox.iCheck('check'); | ||
| 254 | + div.removeClass().addClass("small-box bg-red"); | ||
| 255 | + } | ||
| 256 | +} | ||
| 257 | +function isMainClick(obj){ | ||
| 258 | + alert(obj); | ||
| 259 | + | ||
| 260 | +} | ||
| 261 | + | ||
| 262 | +function t_activity_delete(id) { | ||
| 263 | + if (window.confirm('您确定要删除吗!')) { | ||
| 264 | + $.ajax({ | ||
| 265 | + url : BASE+'/activity/delete/' + id, | ||
| 266 | + type : 'get', | ||
| 267 | + async : true, | ||
| 268 | + error: function(XMLHttpRequest, textStatus, errorThrown) { | ||
| 269 | + alert("请求错误"); | ||
| 270 | + console.log(XMLHttpRequest.status); | ||
| 271 | + console.log(XMLHttpRequest.readyState); | ||
| 272 | + console.log(textStatus); | ||
| 273 | + }, | ||
| 274 | + success : function(data) { | ||
| 275 | + if (data.success) { | ||
| 276 | + location.href = BASE+'/activity/list/1'; | ||
| 277 | + } else { | ||
| 278 | + showTipWidthMsg(true,"删除失败! "+data.data); | ||
| 279 | + } | ||
| 280 | + } | ||
| 281 | + }); | ||
| 282 | + } | ||
| 283 | +} | ||
| 284 | + | ||
| 285 | + | ||
| 286 | +function val_file(id){ | ||
| 287 | + $.ajax({ | ||
| 288 | + url : BASE+'/wowza/valfile/'+id, | ||
| 289 | + type : 'get', | ||
| 290 | + datatype : "json", | ||
| 291 | + async : true, | ||
| 292 | + error : function() { | ||
| 293 | + alert("请求错误"); | ||
| 294 | + console.log(XMLHttpRequest.status); | ||
| 295 | + console.log(XMLHttpRequest.readyState); | ||
| 296 | + console.log(textStatus); | ||
| 297 | + }, | ||
| 298 | + success : function(data) { | ||
| 299 | + //showTip(data.success); | ||
| 300 | + } | ||
| 301 | + }); | ||
| 302 | +} | ||
| 303 | + | ||
| 304 | +function replace_epg(id){ | ||
| 305 | + $("#btn_replace_epg").html("后台处理中..."); | ||
| 306 | + $.ajax({ | ||
| 307 | + url : BASE+'/activity/epg/'+id, | ||
| 308 | + type : 'get', | ||
| 309 | + datatype : "json", | ||
| 310 | + async : true, | ||
| 311 | + error : function() { | ||
| 312 | + alert("请求错误"); | ||
| 313 | + console.log(XMLHttpRequest.status); | ||
| 314 | + console.log(XMLHttpRequest.readyState); | ||
| 315 | + }, | ||
| 316 | + success : function(data) { | ||
| 317 | + showTip(data.success); | ||
| 318 | + $("#btn_replace_epg").attr("disabled", "disabled"); | ||
| 319 | + $("#btn_replace_epg").html("替换完成"); | ||
| 320 | + } | ||
| 321 | + }); | ||
| 322 | +} | ||
| 323 | +//详情页信号切换 | ||
| 324 | +function do_switch(id){ | ||
| 325 | + $("#switch_btn").html("后台处理中..."); | ||
| 326 | + $("#switch_btn").attr("disabled", "disabled"); | ||
| 327 | + $.ajax({ | ||
| 328 | + url : BASE+'/activity/doswitch/'+id, | ||
| 329 | + type : 'get', | ||
| 330 | + async : true, | ||
| 331 | + error : function() { | ||
| 332 | + alert('发生错误!'); | ||
| 333 | + $("#switch_btn").html("切换失败!"); | ||
| 334 | + $("#switch_btn").attr("disabled", false); | ||
| 335 | + }, | ||
| 336 | + success : function(data) { | ||
| 337 | + $("#switch_btn").html("切换成功"); | ||
| 338 | + $("#switch_btn").attr("disabled", false); | ||
| 339 | + } | ||
| 340 | + }); | ||
| 341 | +} | ||
| 342 | + | ||
| 343 | +//详情页-撤销 $("input[name='keleyicom']") | ||
| 344 | +function do_stop(id){ | ||
| 345 | + $("#reset_btn").html("后台处理中..."); | ||
| 346 | + $("#reset_btn").attr("disabled", "disabled"); | ||
| 347 | + $.ajax({ | ||
| 348 | + url : BASE+'/activity/stop/'+id, | ||
| 349 | + type : 'get', | ||
| 350 | + async : true, | ||
| 351 | + error : function() { | ||
| 352 | + alert('发生错误!'); | ||
| 353 | + $("#reset_btn").html("信号复位失败!"); | ||
| 354 | + $("#reset_btn").attr("disabled", false); | ||
| 355 | + }, | ||
| 356 | + success : function(data) { | ||
| 357 | + $("#reset_btn").html("信号复位成功"); | ||
| 358 | + $("#reset_btn").attr("disabled", false); | ||
| 359 | + } | ||
| 360 | + }); | ||
| 361 | +} | ||
| 362 | +//详情页-紧急垫片 | ||
| 363 | +function do_ad(id){ | ||
| 364 | + $("button[name='ad_btn']").html("后台处理中..."); | ||
| 365 | + $("button[name='ad_btn']").attr("disabled", "disabled"); | ||
| 366 | + $.ajax({ | ||
| 367 | + url : BASE+'/activity/advideo/'+id, | ||
| 368 | + type : 'get', | ||
| 369 | + async : true, | ||
| 370 | + error : function() { | ||
| 371 | + alert('发生错误!'); | ||
| 372 | + $("button[name='ad_btn']").html("垫片失败!"); | ||
| 373 | + $("button[name='ad_btn']").attr("disabled", false); | ||
| 374 | + }, | ||
| 375 | + success : function(data) { | ||
| 376 | + if(data.success){ | ||
| 377 | + $("button[name='ad_btn']").html("垫片成功"); | ||
| 378 | + //$("#switch_btn").attr("disabled", false); | ||
| 379 | + }else{ | ||
| 380 | + $("button[name='ad_btn']").html("垫片失败,请检查是否活动已经结束,或者当前活动是否分配直播频道"); | ||
| 381 | + $("#switch_btn").attr("disabled", false); | ||
| 382 | + } | ||
| 383 | + } | ||
| 384 | + }); | ||
| 385 | +} | ||
| 386 | + | ||
| 387 | + | ||
| 388 | +//获取录制视频文件信息 | ||
| 389 | +function do_checkfile(id){ | ||
| 390 | + $("#checkfile_btn").html("后台处理中..."); | ||
| 391 | + $("#checkfile_btn").attr("disabled", "disabled"); | ||
| 392 | + $.ajax({ | ||
| 393 | + url : BASE+'/activity/checkfile/'+id, | ||
| 394 | + type : 'get', | ||
| 395 | + async : true, | ||
| 396 | + error : function() { | ||
| 397 | + alert('发生错误!'); | ||
| 398 | + $("#checkfile_btn").html("验证文件失败!"); | ||
| 399 | + $("#checkfile_btn").attr("disabled", false); | ||
| 400 | + }, | ||
| 401 | + success : function(data) { | ||
| 402 | + var jsonData=data.data; | ||
| 403 | + if (jsonData==null) { | ||
| 404 | + $("#mp4_info").append("没有文件产生"); | ||
| 405 | + }else{ | ||
| 406 | + $.each(jsonData, function(idx, name){ | ||
| 407 | + var html='<hr><a class="btn btn-primary btn-xs">文件名:'+name+'</a>'; | ||
| 408 | + $("#mp4_info").append(html); | ||
| 409 | + }); | ||
| 410 | + | ||
| 411 | + $("#checkfile_btn").html("验证完成"); | ||
| 412 | + $("#checkfile_btn").attr("disabled", false); | ||
| 413 | + } | ||
| 414 | + } | ||
| 415 | + }); | ||
| 416 | +} | ||
| 417 | + | ||
| 418 | + | ||
| 419 | +// 发布直播回放 | ||
| 420 | +function do_publishreview(id){ | ||
| 421 | + $("#publishreview_btn").html("后台处理中..."); | ||
| 422 | + $("#publishreview_btn").attr("disabled", "disabled"); | ||
| 423 | + $.ajax({ | ||
| 424 | + url : BASE+'/activity/publishReview/'+id, | ||
| 425 | + type : 'get', | ||
| 426 | + async : true, | ||
| 427 | + error : function() { | ||
| 428 | + alert('发生错误!'); | ||
| 429 | + $("#publishreview_btn").html("信号复位失败!"); | ||
| 430 | + $("#publishreview_btn").attr("disabled", false); | ||
| 431 | + }, | ||
| 432 | + success : function(data) { | ||
| 433 | + $("#publishreview_btn").html("发布成功"); | ||
| 434 | + //$("#publishreview_btn").attr("disabled", false); | ||
| 435 | + } | ||
| 436 | + }); | ||
| 437 | +} | ||
| 438 | + | ||
| 439 | + |
src/main/webapp/static/assets/cnlive/js/room.js
0 → 100644
| 1 | +//频道 | ||
| 2 | +function t_channel_preview(id){ | ||
| 3 | + window.location.href = BASE+"/channel/preview/"+id;; | ||
| 4 | +} | ||
| 5 | + | ||
| 6 | +function to_sort(id,s){ | ||
| 7 | + $.ajax({ | ||
| 8 | + url : BASE+'/channel/sort', | ||
| 9 | + type : 'post', | ||
| 10 | + async : true, | ||
| 11 | + data : { | ||
| 12 | + id :id, | ||
| 13 | + sort:s | ||
| 14 | + }, | ||
| 15 | + error: function(XMLHttpRequest, textStatus, errorThrown) { | ||
| 16 | + alert("请求错误"); | ||
| 17 | + console.log(XMLHttpRequest.status); | ||
| 18 | + console.log(XMLHttpRequest.readyState); | ||
| 19 | + }, | ||
| 20 | + success : function(data) { | ||
| 21 | + location.href = BASE+'/channel/list/1'; | ||
| 22 | + } | ||
| 23 | + }); | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +function to_init(id){ | ||
| 27 | + if (window.confirm('您确定要初始化当前频道吗!')) { | ||
| 28 | + $.ajax({ | ||
| 29 | + url : BASE+'/channel/init/' + id, | ||
| 30 | + type : 'get', | ||
| 31 | + async : true, | ||
| 32 | + error: function(XMLHttpRequest, textStatus, errorThrown) { | ||
| 33 | + alert("请求错误"); | ||
| 34 | + console.log(XMLHttpRequest.status); | ||
| 35 | + console.log(XMLHttpRequest.readyState); | ||
| 36 | + console.log(textStatus); | ||
| 37 | + }, | ||
| 38 | + success : function(data) { | ||
| 39 | + alert(data.success); | ||
| 40 | + if (data.success) { | ||
| 41 | + location.href = BASE+'/channel/list/1'; | ||
| 42 | + } else { | ||
| 43 | + showTipWidthMsg(true,"初始化失败,请检查是否已经推 src 的流!"); | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + }); | ||
| 47 | + } | ||
| 48 | +} | ||
| 49 | +function t_room_edit(id){ | ||
| 50 | + window.location.href = BASE+ "/room/edit/"+id; | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | + | ||
| 54 | +function t_room_delete(id) { | ||
| 55 | + if (window.confirm('您确定要删除吗!')) { | ||
| 56 | + $.ajax({ | ||
| 57 | + url : BASE+'/channel/delete/' + id, | ||
| 58 | + type : 'get', | ||
| 59 | + async : true, | ||
| 60 | + error: function(XMLHttpRequest, textStatus, errorThrown) { | ||
| 61 | + alert("请求错误"); | ||
| 62 | + console.log(XMLHttpRequest.status); | ||
| 63 | + console.log(XMLHttpRequest.readyState); | ||
| 64 | + console.log(textStatus); | ||
| 65 | + }, | ||
| 66 | + success : function(data) { | ||
| 67 | + if (data.success) { | ||
| 68 | + location.href = BASE+'/channel/list/1'; | ||
| 69 | + } else { | ||
| 70 | + showTipWidthMsg(true,"禁止删除!"); | ||
| 71 | + } | ||
| 72 | + } | ||
| 73 | + }); | ||
| 74 | + } | ||
| 75 | +} | ||
| 76 | + | ||
| 77 | + | ||
| 78 | +function t_channel_add_or_update(id) { | ||
| 79 | + //构造t_channel对象 | ||
| 80 | + var type; | ||
| 81 | + $("input[name='type']:checked").each(function() { | ||
| 82 | + type = this.value; | ||
| 83 | + }); | ||
| 84 | + var t_wowza_stream_id; | ||
| 85 | + $("input[name='t_wowza_stream_id']:checked").each(function() { | ||
| 86 | + t_wowza_stream_id = this.value; | ||
| 87 | + }); | ||
| 88 | + if (t_wowza_stream_id==undefined) { | ||
| 89 | + alert("请选择对应是 stream"); | ||
| 90 | + }else{ | ||
| 91 | + $("#t_channel_save_btn").html("后台处理中..."); | ||
| 92 | + $("#t_channel_save_btn").attr("disabled", "disabled"); | ||
| 93 | + var t_channel = new Object(); | ||
| 94 | + t_channel.name_zh = $('#name_zh').val(); | ||
| 95 | + t_channel.name_en = $('#name_en').val(); | ||
| 96 | + t_channel.transcoder_ip= $('#transcoder_ip').val(); | ||
| 97 | + t_channel.default_t_wowza_stream_id=t_wowza_stream_id; | ||
| 98 | + t_channel.transcoder_id= $('#transcoder_id').val(); | ||
| 99 | + t_channel.play_url= $('#play_url').val(); | ||
| 100 | + t_channel.chatroom_id= $('#chatroom_id').val(); | ||
| 101 | + if (t_channel.chatroom_id=="") { | ||
| 102 | + t_channel.chatroom_id="0"; | ||
| 103 | + } | ||
| 104 | + t_channel.type =type; | ||
| 105 | + t_channel.poster=$('#image_name').val(); | ||
| 106 | + var json = JSON.stringify(t_channel); | ||
| 107 | + $.ajax({ | ||
| 108 | + url : BASE+'/channel/add', | ||
| 109 | + type : 'post', | ||
| 110 | + datatype : "json", | ||
| 111 | + data : { | ||
| 112 | + id :id, | ||
| 113 | + json :json | ||
| 114 | + }, | ||
| 115 | + async : true, | ||
| 116 | + error :function(XMLHttpRequest, textStatus, errorThrown) { | ||
| 117 | + alert("请求错误"); | ||
| 118 | + console.log(XMLHttpRequest.status); | ||
| 119 | + console.log(XMLHttpRequest.readyState); | ||
| 120 | + console.log(textStatus); | ||
| 121 | + }, | ||
| 122 | + success : function(data) { | ||
| 123 | + $("#t_channel_save_btn").html("保存成功"); | ||
| 124 | + showTip(data.success); | ||
| 125 | + location.href = BASE+'/channel/list/1'; | ||
| 126 | + } | ||
| 127 | + }); | ||
| 128 | + } | ||
| 129 | +} | ||
| 130 | + | ||
| 131 | + | ||
| 132 | +function open_channel(id,state){ | ||
| 133 | + $.ajax({ | ||
| 134 | + url : BASE+'/channel/close', | ||
| 135 | + type : 'post', | ||
| 136 | + async : true, | ||
| 137 | + data : { | ||
| 138 | + id :id, | ||
| 139 | + state:state | ||
| 140 | + }, | ||
| 141 | + error : function() { | ||
| 142 | + alert('error'); | ||
| 143 | + }, | ||
| 144 | + success : function(data) { | ||
| 145 | + if (data.success) { | ||
| 146 | + location.href = BASE+'/channel/list/1'; | ||
| 147 | + } else { | ||
| 148 | + showTips("操作失败!"); | ||
| 149 | + } | ||
| 150 | + } | ||
| 151 | + }); | ||
| 152 | +} | ||
| 153 | + | ||
| 154 | + | ||
| 155 | + |
src/test/java/com/cnlive/test/HttpPostArgumentTest2.java
0 → 100644
| 1 | +package com.cnlive.test; | ||
| 2 | + | ||
| 3 | +import org.apache.commons.httpclient.NameValuePair; | ||
| 4 | + | ||
| 5 | +import com.cnlive.mz.live.common.HttpRequest; | ||
| 6 | + | ||
| 7 | +public class HttpPostArgumentTest2 { | ||
| 8 | + | ||
| 9 | + private static String user_access_key = "2b1621d5f4a54c4ebf1101cff027b636"; | ||
| 10 | + private static String app_access_key = "df09616abbe04c72b5f5bbadf0e1edf6"; | ||
| 11 | + | ||
| 12 | + public static void redirect() { | ||
| 13 | + NameValuePair[] param = { new NameValuePair("video_type", "2"), | ||
| 14 | + new NameValuePair("user_access_key", user_access_key), | ||
| 15 | + new NameValuePair("app_access_key", app_access_key) }; | ||
| 16 | + String c = HttpRequest.postRequestWidthResult("http://upload02.vlog.cnlive.com/api/video/redirect", param); | ||
| 17 | + System.out.println(c); | ||
| 18 | + } | ||
| 19 | + public static void main(String[] args) { | ||
| 20 | + HttpPostArgumentTest2.redirect(); | ||
| 21 | + } | ||
| 22 | +} |
src/test/java/com/cnlive/test/Test.java
0 → 100644
| 1 | +package com.cnlive.test; | ||
| 2 | + | ||
| 3 | +import java.io.BufferedReader; | ||
| 4 | +import java.io.InputStreamReader; | ||
| 5 | +import java.net.URL; | ||
| 6 | +import java.net.URLConnection; | ||
| 7 | +import java.text.SimpleDateFormat; | ||
| 8 | +import java.util.Date; | ||
| 9 | +import java.util.Locale; | ||
| 10 | + | ||
| 11 | +import com.cnlive.mz.commons.net.HttpReq; | ||
| 12 | + | ||
| 13 | +public class Test { | ||
| 14 | + | ||
| 15 | + public static void main(String[] args) { | ||
| 16 | + String mediaId="123"; | ||
| 17 | + String title="hha"; | ||
| 18 | + String sid="234"; | ||
| 19 | + //String url = "https://mobile.cnlive.com/CnliveMobile/hd/applyChatRoomId.action?mediaId="+mediaId+"&title="+title+"&sid=?"+sid; | ||
| 20 | + String url = "https://mobile.cnlive.com/CnliveMobile/hd/applyChatRoomId.action"; | ||
| 21 | + //String chat_room_id = HttpReq.getRequestWidthResult(url); | ||
| 22 | + System.out.println(sendGet(url)); | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + public static String toGMTString(Date date) { | ||
| 26 | + SimpleDateFormat df = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z", Locale.UK); | ||
| 27 | + df.setTimeZone(new java.util.SimpleTimeZone(0, "GMT")); | ||
| 28 | + return df.format(date); | ||
| 29 | + } | ||
| 30 | + public static String sendGet(String url) { | ||
| 31 | + String result = ""; | ||
| 32 | + BufferedReader in = null; | ||
| 33 | + try { | ||
| 34 | + URL realUrl = new URL(url); | ||
| 35 | + /* | ||
| 36 | + * http header 参数 | ||
| 37 | + */ | ||
| 38 | + String content_type = "application/json"; | ||
| 39 | + String path = realUrl.getFile(); | ||
| 40 | + String date = toGMTString(new Date()); | ||
| 41 | + // 2.计算 HMAC-SHA1 | ||
| 42 | + // 打开和URL之间的连接 | ||
| 43 | + URLConnection connection = realUrl.openConnection(); | ||
| 44 | + System.out.println(connection); | ||
| 45 | + // 设置通用的请求属性 | ||
| 46 | + // 建立实际的连接 | ||
| 47 | + // 定义 BufferedReader输入流来读取URL的响应 | ||
| 48 | + in = new BufferedReader(new InputStreamReader(connection.getInputStream())); | ||
| 49 | + String line; | ||
| 50 | + while ((line = in.readLine()) != null) { | ||
| 51 | + result += line; | ||
| 52 | + } | ||
| 53 | + } catch (Exception e) { | ||
| 54 | + System.out.println("发送GET请求出现异常!" + e); | ||
| 55 | + e.printStackTrace(); | ||
| 56 | + } | ||
| 57 | + // 使用finally块来关闭输入流 | ||
| 58 | + finally { | ||
| 59 | + try { | ||
| 60 | + if (in != null) { | ||
| 61 | + in.close(); | ||
| 62 | + } | ||
| 63 | + } catch (Exception e) { | ||
| 64 | + e.printStackTrace(); | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + return result; | ||
| 68 | + } | ||
| 69 | +} |