Commit bda84d7df0e8b3fad7f0cb760b7dcbaa46a5e508
Merge branch 'master' of http://bj.gitlab.cnlive.com/liujicheng/cnlive_live_web
# Conflicts: # .settings/org.eclipse.wst.common.component # target/m2e-wtp/web-resources/META-INF/MANIFEST.MF # target/m2e-wtp/web-resources/META-INF/maven/com.cnlive.mz.live.web/cnlive_live_web/pom.properties
Showing
52 changed files
with
5921 additions
and
5561 deletions
.classpath
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | -<classpath> | |
| 3 | - <classpathentry kind="src" output="target/classes" path="src/main/java"> | |
| 4 | - <attributes> | |
| 5 | - <attribute name="optional" value="true"/> | |
| 6 | - <attribute name="maven.pomderived" value="true"/> | |
| 7 | - </attributes> | |
| 8 | - </classpathentry> | |
| 9 | - <classpathentry kind="src" output="target/test-classes" path="src/test/java"> | |
| 10 | - <attributes> | |
| 11 | - <attribute name="optional" value="true"/> | |
| 12 | - <attribute name="maven.pomderived" value="true"/> | |
| 13 | - </attributes> | |
| 14 | - </classpathentry> | |
| 15 | - <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> | |
| 16 | - <attributes> | |
| 17 | - <attribute name="maven.pomderived" value="true"/> | |
| 18 | - </attributes> | |
| 19 | - </classpathentry> | |
| 20 | - <classpathentry kind="src" path="src/main/resources/i18n"/> | |
| 21 | - <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | |
| 22 | - <attributes> | |
| 23 | - <attribute name="maven.pomderived" value="true"/> | |
| 24 | - <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> | |
| 25 | - </attributes> | |
| 26 | - </classpathentry> | |
| 27 | - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> | |
| 28 | - <attributes> | |
| 29 | - <attribute name="maven.pomderived" value="true"/> | |
| 30 | - </attributes> | |
| 31 | - </classpathentry> | |
| 32 | - <classpathentry kind="output" path="target/classes"/> | |
| 33 | -</classpath> | |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<classpath> | |
| 3 | + <classpathentry kind="src" output="target/classes" path="src/main/java"> | |
| 4 | + <attributes> | |
| 5 | + <attribute name="optional" value="true"/> | |
| 6 | + <attribute name="maven.pomderived" value="true"/> | |
| 7 | + </attributes> | |
| 8 | + </classpathentry> | |
| 9 | + <classpathentry kind="src" output="target/test-classes" path="src/test/java"> | |
| 10 | + <attributes> | |
| 11 | + <attribute name="optional" value="true"/> | |
| 12 | + <attribute name="maven.pomderived" value="true"/> | |
| 13 | + </attributes> | |
| 14 | + </classpathentry> | |
| 15 | + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> | |
| 16 | + <attributes> | |
| 17 | + <attribute name="maven.pomderived" value="true"/> | |
| 18 | + </attributes> | |
| 19 | + </classpathentry> | |
| 20 | + <classpathentry kind="src" path="src/main/resources/i18n"/> | |
| 21 | + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | |
| 22 | + <attributes> | |
| 23 | + <attribute name="maven.pomderived" value="true"/> | |
| 24 | + <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> | |
| 25 | + </attributes> | |
| 26 | + </classpathentry> | |
| 27 | + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> | |
| 28 | + <attributes> | |
| 29 | + <attribute name="owner.project.facets" value="java"/> | |
| 30 | + </attributes> | |
| 31 | + </classpathentry> | |
| 32 | + <classpathentry kind="output" path="target/classes"/> | |
| 33 | +</classpath> | ... | ... |
.settings/org.eclipse.core.resources.prefs
.settings/org.eclipse.wst.common.project.facet.core.xml
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | -<faceted-project> | |
| 3 | - <installed facet="jst.web" version="3.0"/> | |
| 4 | - <installed facet="wst.jsdt.web" version="1.0"/> | |
| 5 | - <installed facet="jst.jaxrs" version="1.1"/> | |
| 6 | - <installed facet="java" version="1.6"/> | |
| 7 | -</faceted-project> | |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<faceted-project> | |
| 3 | + <installed facet="jst.web" version="3.0"/> | |
| 4 | + <installed facet="wst.jsdt.web" version="1.0"/> | |
| 5 | + <installed facet="jst.jaxrs" version="1.1"/> | |
| 6 | + <installed facet="java" version="1.7"/> | |
| 7 | +</faceted-project> | ... | ... |
WebContent/META-INF/MANIFEST.MF
src/main/java/com/cnlive/mz/live/action/CheckAction.java
| 1 | 1 | package com.cnlive.mz.live.action; |
| 2 | 2 | |
| 3 | -import java.io.UnsupportedEncodingException; | |
| 4 | -import java.net.URLEncoder; | |
| 5 | -import java.util.List; | |
| 6 | -import java.util.Map; | |
| 7 | - | |
| 8 | 3 | import org.smart4j.framework.dao.bean.Pager; |
| 9 | 4 | import org.smart4j.framework.ioc.annotation.Inject; |
| 10 | 5 | import org.smart4j.framework.mvc.DataContext; |
| ... | ... | @@ -15,11 +10,8 @@ import org.smart4j.framework.mvc.bean.Result; |
| 15 | 10 | import org.smart4j.framework.mvc.bean.View; |
| 16 | 11 | import org.smart4j.framework.util.CastUtil; |
| 17 | 12 | |
| 18 | -import com.cnlive.mz.commons.JsonUtil; | |
| 19 | -import com.cnlive.mz.commons.net.HttpReq; | |
| 20 | 13 | import com.cnlive.mz.live.common.LiveUtils; |
| 21 | 14 | import com.cnlive.mz.live.entity.TLive; |
| 22 | -import com.cnlive.mz.live.rest.BaseUtil; | |
| 23 | 15 | import com.cnlive.mz.live.service.TCheckService; |
| 24 | 16 | import com.cnlive.mz.live.service.TLiveService; |
| 25 | 17 | import com.cnlive.mz.live.service.TRoomService; |
| ... | ... | @@ -34,89 +26,61 @@ public class CheckAction { |
| 34 | 26 | @Inject |
| 35 | 27 | private TCheckService tCheckService; |
| 36 | 28 | |
| 37 | - // @Request.Get("/check/list/{page_number}") | |
| 38 | - // public View list(int page_number) { | |
| 39 | - // int user_id = | |
| 40 | - // CastUtil.castInt(DataContext.getRequest().getSession().getAttribute(LiveUtils.SESSION_KEY_ID)); | |
| 41 | - // System.out.println(user_id); | |
| 42 | - // Pager<TLive> tLive = tCheckService.getTCheckLivePager(page_number, 9, | |
| 43 | - // user_id); | |
| 44 | - // List list = tLiveService.getLives(user_id); | |
| 45 | - // View view = new View("check/check_management.jsp"); | |
| 46 | - // view.data("tLive", tLive); | |
| 47 | - // view.data("list", list); | |
| 48 | - // return view; | |
| 49 | - // //return new View("check/demo.html"); | |
| 50 | - // } | |
| 29 | + /** | |
| 30 | + * 切断直播流 | |
| 31 | + * @param id | |
| 32 | + * @param params | |
| 33 | + * @return | |
| 34 | + */ | |
| 51 | 35 | @Request.Post("/check/close/{id}") |
| 52 | - public Result coseLive(int id, Params params) throws UnsupportedEncodingException { | |
| 53 | - String userId = params.getString("user_id"); | |
| 54 | - String streamName = userId + "_" + id; | |
| 55 | - String accesskey = BaseUtil.getAccessKey(); | |
| 56 | - accesskey = java.net.URLEncoder.encode(accesskey, "utf-8"); | |
| 57 | - String signature = BaseUtil.signature(streamName); | |
| 58 | - String del = "del"; | |
| 59 | - String delsignature = BaseUtil.signature(del, streamName); | |
| 60 | - String expire = BaseUtil.getTimestamp(); | |
| 61 | - System.out.println(expire + "---expire---"); | |
| 62 | - // ��ӵ������� | |
| 63 | - try { | |
| 64 | - addBlackList(signature, accesskey, expire, streamName); | |
| 65 | - delBlackList(delsignature, accesskey, expire, streamName); | |
| 66 | - } catch (UnsupportedEncodingException e) { | |
| 67 | - e.printStackTrace(); | |
| 68 | - } | |
| 69 | - boolean flag = tCheckService.closeLive(id); | |
| 36 | + public Result cose(int id, Params params) { | |
| 37 | + String streamName = params.getString("user_id"); | |
| 38 | + String uuid = params.getString("uuid"); | |
| 39 | + boolean flag = tCheckService.close(streamName,id,uuid); | |
| 70 | 40 | return new Result(flag); |
| 71 | 41 | } |
| 72 | 42 | |
| 73 | 43 | /** |
| 74 | - * ��ӵ����� | |
| 75 | - * | |
| 76 | - * @param signature | |
| 77 | - * @param accesskey | |
| 78 | - * @param expire | |
| 79 | - * @param streamName | |
| 44 | + * 回复黑名单 | |
| 45 | + * @param id | |
| 46 | + * @param params | |
| 80 | 47 | * @return |
| 81 | - * @throws UnsupportedEncodingException | |
| 82 | 48 | */ |
| 83 | - public String addBlackList(String signature, String accesskey, String expire, String streamName) | |
| 84 | - throws UnsupportedEncodingException { | |
| 85 | - String url = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=" + signature + "&accesskey=" + accesskey | |
| 86 | - + "&expire=" + expire + "&app=live&method=add&name=" + streamName; | |
| 87 | - System.out.println(url); | |
| 88 | - String jsonArrStr = HttpReq.getRequestWidthResult(url); | |
| 89 | - int status = HttpReq.getRequest(url); | |
| 90 | - System.out.println(status + "......and......" + jsonArrStr); | |
| 91 | - /* | |
| 92 | - * Map map = JsonUtil.getMapFromJsonObjStr(jsonArrStr); String | |
| 93 | - * chatRoomid = (String) map.get("Content-Length"); | |
| 94 | - */ | |
| 95 | - return jsonArrStr; | |
| 49 | + @Request.Post("/check/resume/{id}") | |
| 50 | + public Result resume(int id, Params params){ | |
| 51 | + String streamName = params.getString("user_id"); | |
| 52 | + boolean flag = tCheckService.resume(streamName,id); | |
| 53 | + return new Result(flag); | |
| 96 | 54 | } |
| 55 | + | |
| 97 | 56 | |
| 98 | - /** | |
| 99 | - * �Ӻ���ɾ�� | |
| 100 | - * | |
| 101 | - * @param signature | |
| 102 | - * @param accesskey | |
| 103 | - * @param expire | |
| 104 | - * @param streamName | |
| 105 | - * @return | |
| 106 | - * @throws UnsupportedEncodingException | |
| 107 | - */ | |
| 108 | - public Object delBlackList(String signature, String accesskey, String expire, String streamName) | |
| 109 | - throws UnsupportedEncodingException { | |
| 110 | - String url = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=" + signature + "&accesskey=" + accesskey | |
| 111 | - + "&expire=" + expire + "&app=live&method=del&name=" + streamName; | |
| 112 | - System.out.println("..url.." + url); | |
| 113 | - String jsonArrStr = HttpReq.getRequestWidthResult(url); | |
| 114 | - System.out.println("..jsonArrStr.." + jsonArrStr); | |
| 115 | - /* | |
| 116 | - * Map map = JsonUtil.getMapFromJsonObjStr(jsonArrStr); String | |
| 117 | - * chatRoomid = (String) map.get("Content-Length"); | |
| 118 | - */ | |
| 119 | - return jsonArrStr; | |
| 57 | + @Request.Get("/check/list/{page_number}") | |
| 58 | + public View check(int page_number) { | |
| 59 | + int user_id = CastUtil.castInt(DataContext.getRequest().getSession().getAttribute(LiveUtils.SESSION_KEY_ID)); | |
| 60 | + Pager<TLive> tLive = tLiveService.getTCheckLivePager(page_number, 12, user_id); | |
| 61 | + View view = new View("check/monitor.jsp"); | |
| 62 | + view.data("tLive", tLive); | |
| 63 | + return view; | |
| 64 | + } | |
| 65 | + | |
| 66 | + // 置顶 | |
| 67 | + @Request.Get("/check/top/{id}") | |
| 68 | + public Result top(int id) { | |
| 69 | + tLiveService.top(id); | |
| 70 | + return new Result(true); | |
| 71 | + } | |
| 72 | + | |
| 73 | + // 通过审核 | |
| 74 | + @Request.Get("/check/pass/{id}") | |
| 75 | + public Result pass(int id) { | |
| 76 | + tLiveService.pass(id); | |
| 77 | + return new Result(true); | |
| 78 | + } | |
| 79 | + | |
| 80 | + @Request.Post("/check/close/{id}/{uuid}") | |
| 81 | + public Result coseLive(int id, String uuid) { | |
| 82 | + boolean flag = tLiveService.closeLive(id, uuid); | |
| 83 | + return new Result(flag); | |
| 120 | 84 | } |
| 121 | 85 | |
| 122 | 86 | } | ... | ... |
src/main/java/com/cnlive/mz/live/action/HttpPostArgumentTest2.java
| 1 | -package com.cnlive.mz.live.action; | |
| 2 | - | |
| 3 | -import java.io.File; | |
| 4 | -import java.io.IOException; | |
| 5 | - | |
| 6 | -import org.apache.commons.httpclient.NameValuePair; | |
| 7 | -import org.apache.commons.httpclient.params.HttpMethodParams; | |
| 8 | -import org.apache.http.HttpEntity; | |
| 9 | -import org.apache.http.HttpResponse; | |
| 10 | -import org.apache.http.HttpStatus; | |
| 11 | -import org.apache.http.ParseException; | |
| 12 | -import org.apache.http.client.HttpClient; | |
| 13 | -import org.apache.http.client.methods.HttpPost; | |
| 14 | -import org.apache.http.entity.mime.MultipartEntity; | |
| 15 | -import org.apache.http.entity.mime.content.FileBody; | |
| 16 | -import org.apache.http.entity.mime.content.StringBody; | |
| 17 | -import org.apache.http.impl.client.DefaultHttpClient; | |
| 18 | -import org.apache.http.util.EntityUtils; | |
| 19 | - | |
| 20 | -import com.cnlive.mz.commons.net.HttpReq; | |
| 21 | - | |
| 22 | -public class HttpPostArgumentTest2 { | |
| 23 | - | |
| 24 | - private static String user_access_key = "cf34f28db21b46678237bfa849e239ea"; | |
| 25 | - private static String app_access_key = "7338ebf9cab441c0843e437a18d85549"; | |
| 26 | - | |
| 27 | - public void SubmitPost(String url, String filepath) { | |
| 28 | - HttpClient httpclient = new DefaultHttpClient(); | |
| 29 | - try { | |
| 30 | - HttpPost httppost = new HttpPost(url); | |
| 31 | - FileBody bin = new FileBody(new File(filepath)); | |
| 32 | - MultipartEntity reqEntity = new MultipartEntity(); | |
| 33 | - // reqEntity.addPart("file", bin); | |
| 34 | - reqEntity.addPart("app_access_key", new StringBody("7338ebf9cab441c0843e437a18d85549")); | |
| 35 | - reqEntity.addPart("user_access_key", new StringBody("cf34f28db21b46678237bfa849e239ea")); | |
| 36 | - reqEntity.addPart("direct", new StringBody("0")); | |
| 37 | - reqEntity.addPart("upload_type", new StringBody("1")); | |
| 38 | - reqEntity.addPart("md5", new StringBody("liujicheng")); | |
| 39 | - reqEntity.addPart("title", new StringBody("title")); | |
| 40 | - reqEntity.addPart("name", new StringBody("中投视频宣传片熊猫test")); | |
| 41 | - reqEntity.addPart("server_access_key", new StringBody("3830ce241dad4b9f844d131c890231ae")); | |
| 42 | - | |
| 43 | - httppost.setEntity(reqEntity); | |
| 44 | - HttpResponse response = httpclient.execute(httppost); | |
| 45 | - int statusCode = response.getStatusLine().getStatusCode(); | |
| 46 | - System.out.println(statusCode); | |
| 47 | - System.out.println("服务器正常响应....."); | |
| 48 | - HttpEntity resEntity = response.getEntity(); | |
| 49 | - System.out.println(EntityUtils.toString(resEntity)); | |
| 50 | - System.out.println(resEntity.getContent()); | |
| 51 | - EntityUtils.consume(resEntity); | |
| 52 | - | |
| 53 | - } catch (ParseException e) { | |
| 54 | - e.printStackTrace(); | |
| 55 | - } catch (IOException e) { | |
| 56 | - e.printStackTrace(); | |
| 57 | - } finally { | |
| 58 | - try { | |
| 59 | - httpclient.getConnectionManager().shutdown(); | |
| 60 | - } catch (Exception ignore) { | |
| 61 | - ignore.printStackTrace(); | |
| 62 | - } | |
| 63 | - } | |
| 64 | - } | |
| 65 | - | |
| 66 | - public static void redirect() { | |
| 67 | - NameValuePair[] param = { new NameValuePair("relation_id", "283645"), new NameValuePair("video_type", "3"), | |
| 68 | - new NameValuePair("user_access_key", user_access_key), | |
| 69 | - new NameValuePair("app_access_key", app_access_key) }; | |
| 70 | - String c = HttpReq.postRequestWidthResult("http://bc.cnlive.com/api/video/redirect", param); | |
| 71 | - System.out.println(c); | |
| 72 | - } | |
| 73 | - | |
| 74 | - public static void delete() { | |
| 75 | - NameValuePair[] param = { new NameValuePair("video_type", "2"), | |
| 76 | - new NameValuePair("app_access_key", "7338ebf9cab441c0843e437a18d85549"), | |
| 77 | - new NameValuePair("user_access_key", "cf34f28db21b46678237bfa849e239ea"), | |
| 78 | - new NameValuePair("video_uuid", "a8794762b3e92c7d6589a6157cf1ef27,7e26dee78a584f8c5ab1d93a9c878f1d") }; | |
| 79 | - String c = HttpReq.postRequestWidthResult("http://bc.cnlive.com/api/video/delete", param); | |
| 80 | - System.out.println(c); | |
| 81 | - } | |
| 82 | - | |
| 83 | - private static String md5 = "ffa699fb66750acab30b71b8ceb0172d1"; | |
| 84 | - | |
| 85 | - public static void supload() { | |
| 86 | - NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key), | |
| 87 | - new NameValuePair("user_access_key", user_access_key), new NameValuePair("video_type", "3"), | |
| 88 | - new NameValuePair("upload_type", "0"), new NameValuePair("direct", "1"), new NameValuePair("md5", md5), | |
| 89 | - new NameValuePair("title", "tit三道恩le1"), new NameValuePair("relation_id", "615207"), | |
| 90 | - new NameValuePair("custom_args", "custom_args1"), new NameValuePair("name", "VID_20151224_105421.mp4"), | |
| 91 | - new NameValuePair("server_access_key", "3830ce241dad4b9f844d131c890231ae") }; | |
| 92 | - String c = HttpReq.postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/supload", param); | |
| 93 | - System.out.println(c); | |
| 94 | - } | |
| 95 | - | |
| 96 | - public static void uploadNotify() { | |
| 97 | - NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key), | |
| 98 | - new NameValuePair("user_access_key", user_access_key), new NameValuePair("upload_type", "1"), | |
| 99 | - new NameValuePair("video_type", "2"), new NameValuePair("state", "200"), | |
| 100 | - new NameValuePair("video_uuid", md5) }; | |
| 101 | - String c = HttpReq | |
| 102 | - .postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/uploadNotify", param); | |
| 103 | - System.out.println(c); | |
| 104 | - } | |
| 105 | - | |
| 106 | - public static void all() { | |
| 107 | - NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key), | |
| 108 | - new NameValuePair("relation_id", "498122"), | |
| 109 | - | |
| 110 | - new NameValuePair("user_access_key", user_access_key), new NameValuePair("upload_type", "1"), | |
| 111 | - new NameValuePair("video_type", "2"), new NameValuePair("page_no", "1"), | |
| 112 | - new NameValuePair("video_uuid", md5) }; | |
| 113 | - String c = HttpReq.postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/all", param); | |
| 114 | - System.out.println(c); | |
| 115 | - } | |
| 116 | - | |
| 117 | - public static void main(String[] args) { | |
| 118 | - // new HttpPostArgumentTest2().delete(); | |
| 119 | - //HttpPostArgumentTest2.all(); | |
| 120 | - HttpPostArgumentTest2.redirect(); | |
| 121 | - // HttpReq.postRequestWidthResult("http://120.132.76.51:9696/cnlive_encoding_job/task", | |
| 122 | - // "json", "jsonjsonjsonjson");r | |
| 123 | - } | |
| 124 | - | |
| 125 | -} | |
| 1 | +package com.cnlive.mz.live.action; | |
| 2 | + | |
| 3 | +import java.io.File; | |
| 4 | +import java.io.IOException; | |
| 5 | + | |
| 6 | +import org.apache.commons.httpclient.NameValuePair; | |
| 7 | +import org.apache.commons.httpclient.params.HttpMethodParams; | |
| 8 | +import org.apache.http.HttpEntity; | |
| 9 | +import org.apache.http.HttpResponse; | |
| 10 | +import org.apache.http.HttpStatus; | |
| 11 | +import org.apache.http.ParseException; | |
| 12 | +import org.apache.http.client.HttpClient; | |
| 13 | +import org.apache.http.client.methods.HttpPost; | |
| 14 | +import org.apache.http.entity.mime.MultipartEntity; | |
| 15 | +import org.apache.http.entity.mime.content.FileBody; | |
| 16 | +import org.apache.http.entity.mime.content.StringBody; | |
| 17 | +import org.apache.http.impl.client.DefaultHttpClient; | |
| 18 | +import org.apache.http.util.EntityUtils; | |
| 19 | + | |
| 20 | +import com.cnlive.mz.commons.net.HttpReq; | |
| 21 | + | |
| 22 | +public class HttpPostArgumentTest2 { | |
| 23 | + | |
| 24 | + private static String user_access_key = "cf34f28db21b46678237bfa849e239ea"; | |
| 25 | + private static String app_access_key = "7338ebf9cab441c0843e437a18d85549"; | |
| 26 | + | |
| 27 | + public void SubmitPost(String url, String filepath) { | |
| 28 | + HttpClient httpclient = new DefaultHttpClient(); | |
| 29 | + try { | |
| 30 | + HttpPost httppost = new HttpPost(url); | |
| 31 | + FileBody bin = new FileBody(new File(filepath)); | |
| 32 | + MultipartEntity reqEntity = new MultipartEntity(); | |
| 33 | + // reqEntity.addPart("file", bin); | |
| 34 | + reqEntity.addPart("app_access_key", new StringBody("7338ebf9cab441c0843e437a18d85549")); | |
| 35 | + reqEntity.addPart("user_access_key", new StringBody("cf34f28db21b46678237bfa849e239ea")); | |
| 36 | + reqEntity.addPart("direct", new StringBody("0")); | |
| 37 | + reqEntity.addPart("upload_type", new StringBody("1")); | |
| 38 | + reqEntity.addPart("md5", new StringBody("liujicheng")); | |
| 39 | + reqEntity.addPart("title", new StringBody("title")); | |
| 40 | + reqEntity.addPart("name", new StringBody("中投视频宣传片熊猫test")); | |
| 41 | + reqEntity.addPart("server_access_key", new StringBody("3830ce241dad4b9f844d131c890231ae")); | |
| 42 | + | |
| 43 | + httppost.setEntity(reqEntity); | |
| 44 | + HttpResponse response = httpclient.execute(httppost); | |
| 45 | + int statusCode = response.getStatusLine().getStatusCode(); | |
| 46 | + System.out.println(statusCode); | |
| 47 | + System.out.println("服务器正常响应....."); | |
| 48 | + HttpEntity resEntity = response.getEntity(); | |
| 49 | + System.out.println(EntityUtils.toString(resEntity)); | |
| 50 | + System.out.println(resEntity.getContent()); | |
| 51 | + EntityUtils.consume(resEntity); | |
| 52 | + | |
| 53 | + } catch (ParseException e) { | |
| 54 | + e.printStackTrace(); | |
| 55 | + } catch (IOException e) { | |
| 56 | + e.printStackTrace(); | |
| 57 | + } finally { | |
| 58 | + try { | |
| 59 | + httpclient.getConnectionManager().shutdown(); | |
| 60 | + } catch (Exception ignore) { | |
| 61 | + ignore.printStackTrace(); | |
| 62 | + } | |
| 63 | + } | |
| 64 | + } | |
| 65 | + | |
| 66 | + public static void redirect() { | |
| 67 | + NameValuePair[] param = { new NameValuePair("relation_id", "283645"), new NameValuePair("video_type", "3"), | |
| 68 | + new NameValuePair("user_access_key", user_access_key), | |
| 69 | + new NameValuePair("app_access_key", app_access_key) }; | |
| 70 | + String c = HttpReq.postRequestWidthResult("http://bc.cnlive.com/api/video/redirect", param); | |
| 71 | + System.out.println(c); | |
| 72 | + } | |
| 73 | + | |
| 74 | + public static void delete() { | |
| 75 | + NameValuePair[] param = { new NameValuePair("video_type", "2"), | |
| 76 | + new NameValuePair("app_access_key", "7338ebf9cab441c0843e437a18d85549"), | |
| 77 | + new NameValuePair("user_access_key", "cf34f28db21b46678237bfa849e239ea"), | |
| 78 | + new NameValuePair("video_uuid", "a8794762b3e92c7d6589a6157cf1ef27,7e26dee78a584f8c5ab1d93a9c878f1d") }; | |
| 79 | + String c = HttpReq.postRequestWidthResult("http://bc.cnlive.com/api/video/delete", param); | |
| 80 | + System.out.println(c); | |
| 81 | + } | |
| 82 | + | |
| 83 | + private static String md5 = "ffa699fb66750acab30b71b8ceb0172d1"; | |
| 84 | + | |
| 85 | + public static void supload() { | |
| 86 | + NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key), | |
| 87 | + new NameValuePair("user_access_key", user_access_key), new NameValuePair("video_type", "3"), | |
| 88 | + new NameValuePair("upload_type", "0"), new NameValuePair("direct", "1"), new NameValuePair("md5", md5), | |
| 89 | + new NameValuePair("title", "tit三道恩le1"), new NameValuePair("relation_id", "615207"), | |
| 90 | + new NameValuePair("custom_args", "custom_args1"), new NameValuePair("name", "VID_20151224_105421.mp4"), | |
| 91 | + new NameValuePair("server_access_key", "3830ce241dad4b9f844d131c890231ae") }; | |
| 92 | + String c = HttpReq.postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/supload", param); | |
| 93 | + System.out.println(c); | |
| 94 | + } | |
| 95 | + | |
| 96 | + public static void uploadNotify() { | |
| 97 | + NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key), | |
| 98 | + new NameValuePair("user_access_key", user_access_key), new NameValuePair("upload_type", "1"), | |
| 99 | + new NameValuePair("video_type", "2"), new NameValuePair("state", "200"), | |
| 100 | + new NameValuePair("video_uuid", md5) }; | |
| 101 | + String c = HttpReq | |
| 102 | + .postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/uploadNotify", param); | |
| 103 | + System.out.println(c); | |
| 104 | + } | |
| 105 | + | |
| 106 | + public static void all() { | |
| 107 | + NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key), | |
| 108 | + new NameValuePair("relation_id", "498122"), | |
| 109 | + | |
| 110 | + new NameValuePair("user_access_key", user_access_key), new NameValuePair("upload_type", "1"), | |
| 111 | + new NameValuePair("video_type", "2"), new NameValuePair("page_no", "1"), | |
| 112 | + new NameValuePair("video_uuid", md5) }; | |
| 113 | + String c = HttpReq.postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/all", param); | |
| 114 | + System.out.println(c); | |
| 115 | + } | |
| 116 | + | |
| 117 | + public static void main(String[] args) { | |
| 118 | + // new HttpPostArgumentTest2().delete(); | |
| 119 | + //HttpPostArgumentTest2.all(); | |
| 120 | + HttpPostArgumentTest2.redirect(); | |
| 121 | + // HttpReq.postRequestWidthResult("http://120.132.76.51:9696/cnlive_encoding_job/task", | |
| 122 | + // "json", "jsonjsonjsonjson");r | |
| 123 | + } | |
| 124 | + | |
| 125 | +} | ... | ... |
src/main/java/com/cnlive/mz/live/action/LiveAction.java
| ... | ... | @@ -9,11 +9,15 @@ |
| 9 | 9 | |
| 10 | 10 | package com.cnlive.mz.live.action; |
| 11 | 11 | |
| 12 | +import java.io.IOException; | |
| 12 | 13 | import java.io.UnsupportedEncodingException; |
| 13 | 14 | import java.util.HashMap; |
| 14 | 15 | import java.util.List; |
| 15 | 16 | import java.util.Map; |
| 16 | 17 | |
| 18 | +import javax.servlet.http.HttpServletRequest; | |
| 19 | +import javax.servlet.http.HttpServletResponse; | |
| 20 | + | |
| 17 | 21 | import org.apache.commons.httpclient.NameValuePair; |
| 18 | 22 | import org.apache.commons.lang.StringUtils; |
| 19 | 23 | import org.apache.log4j.Logger; |
| ... | ... | @@ -28,12 +32,12 @@ import org.smart4j.framework.mvc.bean.Params; |
| 28 | 32 | import org.smart4j.framework.mvc.bean.Result; |
| 29 | 33 | import org.smart4j.framework.mvc.bean.ResultBean; |
| 30 | 34 | import org.smart4j.framework.mvc.bean.View; |
| 31 | -import org.smart4j.framework.orm.DataSet; | |
| 32 | 35 | import org.smart4j.framework.util.CastUtil; |
| 33 | 36 | |
| 34 | 37 | import com.cnlive.mz.commons.Constants; |
| 35 | 38 | import com.cnlive.mz.commons.net.HttpReq; |
| 36 | 39 | import com.cnlive.mz.live.common.LiveUtils; |
| 40 | +import com.cnlive.mz.live.entity.TChannel; | |
| 37 | 41 | import com.cnlive.mz.live.entity.TLive; |
| 38 | 42 | import com.cnlive.mz.live.entity.TRoom; |
| 39 | 43 | import com.cnlive.mz.live.rest.BaseUtil; |
| ... | ... | @@ -109,107 +113,6 @@ public class LiveAction { |
| 109 | 113 | return view; |
| 110 | 114 | } |
| 111 | 115 | |
| 112 | - @Request.Get("/check/list/{page_number}") | |
| 113 | - public View check(int page_number) { | |
| 114 | - int user_id = CastUtil.castInt(DataContext.getRequest().getSession().getAttribute(LiveUtils.SESSION_KEY_ID)); | |
| 115 | - Pager<TLive> tLive = tLiveService.getTCheckLivePager(page_number, 12, user_id); | |
| 116 | - View view = new View("check/monitor.jsp"); | |
| 117 | - view.data("tLive", tLive); | |
| 118 | - return view; | |
| 119 | - } | |
| 120 | - | |
| 121 | - // 置顶 | |
| 122 | - @Request.Get("/check/top/{id}") | |
| 123 | - public Result top(int id) { | |
| 124 | - tLiveService.top(id); | |
| 125 | - return new Result(true); | |
| 126 | - } | |
| 127 | - | |
| 128 | - // 切断 | |
| 129 | - @Request.Post("/check/cut/{id}") | |
| 130 | - public Result cut(int id, Params params) throws UnsupportedEncodingException { | |
| 131 | - String live_url = params.getString("live_url"); | |
| 132 | - if (live_url.isEmpty()) { | |
| 133 | - return null; | |
| 134 | - } else { | |
| 135 | - int index = live_url.lastIndexOf("/"); | |
| 136 | - String streamName = live_url.substring(index + 1); | |
| 137 | - System.out.println("streamName===" + streamName); | |
| 138 | - String accesskey = BaseUtil.getAccessKey(); | |
| 139 | - accesskey = java.net.URLEncoder.encode(accesskey, "utf-8"); | |
| 140 | - String add = "add"; | |
| 141 | - String signature = BaseUtil.signature(add, streamName); | |
| 142 | - String del = "del"; | |
| 143 | - String delsignature = BaseUtil.signature(del, streamName); | |
| 144 | - String expire = BaseUtil.getTimestamp(); | |
| 145 | - System.out.println(expire + "---expire---"); | |
| 146 | - // 断流。 | |
| 147 | - try { | |
| 148 | - addBlackList(signature, accesskey, expire, streamName); | |
| 149 | - // delBlackList(delsignature, accesskey, expire, streamName); | |
| 150 | - } catch (UnsupportedEncodingException e) { | |
| 151 | - e.printStackTrace(); | |
| 152 | - } | |
| 153 | - // 直播通知 | |
| 154 | - // tLiveService.notify(video_uuid, -1); | |
| 155 | - boolean flag = tCheckService.closeLive(id); | |
| 156 | - return new Result(flag); | |
| 157 | - } | |
| 158 | - } | |
| 159 | - | |
| 160 | - // 通过审核 | |
| 161 | - @Request.Get("/check/pass/{id}") | |
| 162 | - public Result pass(int id) { | |
| 163 | - tLiveService.pass(id); | |
| 164 | - return new Result(true); | |
| 165 | - } | |
| 166 | - | |
| 167 | - @Request.Post("/check/close/{id}/{uuid}") | |
| 168 | - public Result coseLive(int id, String uuid) { | |
| 169 | - boolean flag = tLiveService.closeLive(id, uuid); | |
| 170 | - return new Result(flag); | |
| 171 | - } | |
| 172 | - | |
| 173 | - /** | |
| 174 | - * 添加到黑名单 | |
| 175 | - * | |
| 176 | - * @param signature | |
| 177 | - * @param accesskey | |
| 178 | - * @param expire | |
| 179 | - * @param streamName | |
| 180 | - * @return | |
| 181 | - * @throws UnsupportedEncodingException | |
| 182 | - */ | |
| 183 | - public String addBlackList(String signature, String accesskey, String expire, String streamName) | |
| 184 | - throws UnsupportedEncodingException { | |
| 185 | - String url = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=" + signature + "&accesskey=" + accesskey | |
| 186 | - + "&expire=" + expire + "&app=live&method=add&name=" + streamName; | |
| 187 | - String jsonArrStr = HttpReq.getRequestWidthResult(url); | |
| 188 | - int status = HttpReq.getRequest(url); | |
| 189 | - System.out.println(status + "......and......" + jsonArrStr); | |
| 190 | - return jsonArrStr; | |
| 191 | - } | |
| 192 | - | |
| 193 | - /** | |
| 194 | - * 从黑名单删除 | |
| 195 | - * | |
| 196 | - * @param signature | |
| 197 | - * @param accesskey | |
| 198 | - * @param expire | |
| 199 | - * @param streamName | |
| 200 | - * @return | |
| 201 | - * @throws UnsupportedEncodingException | |
| 202 | - */ | |
| 203 | - public Object delBlackList(String signature, String accesskey, String expire, String streamName) | |
| 204 | - throws UnsupportedEncodingException { | |
| 205 | - String url = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=" + signature + "&accesskey=" + accesskey | |
| 206 | - + "&expire=" + expire + "&app=live&method=del&name=" + streamName; | |
| 207 | - String jsonArrStr = HttpReq.getRequestWidthResult(url); | |
| 208 | - System.out.println("..jsonArrStr.." + jsonArrStr); | |
| 209 | - return jsonArrStr; | |
| 210 | - | |
| 211 | - } | |
| 212 | - | |
| 213 | 116 | @Request.Get("/live/alllive/{page_number}") |
| 214 | 117 | public View liveList(int page_number) { |
| 215 | 118 | int user_id = CastUtil.castInt(DataContext.getRequest().getSession().getAttribute(LiveUtils.SESSION_KEY_ID)); |
| ... | ... | @@ -297,15 +200,17 @@ public class LiveAction { |
| 297 | 200 | log.error("创建活动失败,活动ID已存在"); |
| 298 | 201 | return rb; |
| 299 | 202 | } else { |
| 300 | - | |
| 301 | 203 | boolean flag = tLiveService.addAcitvity(params); |
| 302 | 204 | if (flag) { |
| 303 | 205 | Map<String, Object> map = new HashMap<String, Object>(); |
| 304 | - map.put("location", "rtmp://jsrtmp.up.cnlive.com/live/1234"); | |
| 206 | + map.put("location", | |
| 207 | + com.cnlive.mz.live.common.Constants.KS_HOST_UP_RTMP + channelID + "?vdoid=" + activityId); | |
| 305 | 208 | rb.setData(map); |
| 306 | 209 | rb.setErrorCode("0"); |
| 307 | 210 | rb.setErrorMessage("创建活动成功"); |
| 308 | 211 | log.info("创建活动成功"); |
| 212 | + // 通知cms直播 | |
| 213 | + // boolean success = tLiveService.startLive(tLive); | |
| 309 | 214 | return rb; |
| 310 | 215 | } else { |
| 311 | 216 | Map<String, Object> map = new HashMap<String, Object>(); |
| ... | ... | @@ -338,23 +243,25 @@ public class LiveAction { |
| 338 | 243 | @Request.Get("/live/epg/startActivity") |
| 339 | 244 | public ResultBean startActivity(Params params) { |
| 340 | 245 | ResultBean rb = new ResultBean(); |
| 246 | + log.info(params); | |
| 341 | 247 | String appId = params.getString("appId"); |
| 342 | 248 | String activityid = params.getString("activityId"); |
| 343 | 249 | if (StringUtils.isEmpty(appId) || StringUtils.isEmpty(activityid)) { |
| 344 | - Map<String, Object> map = new HashMap<String, Object>(); | |
| 345 | - map.put("location", ""); | |
| 346 | - rb.setData(map); | |
| 347 | 250 | rb.setErrorCode("500"); |
| 348 | - rb.setErrorMessage("启动活动失败"); | |
| 251 | + rb.setErrorMessage("启动活动失败,参数不正确"); | |
| 349 | 252 | return rb; |
| 350 | 253 | } else { |
| 351 | 254 | TLive tLive = tLiveService.selectByParams(appId, activityid); |
| 352 | - Map<String, Object> map = new HashMap<String, Object>(); | |
| 353 | - map.put("location", tLive.getLive_url()); | |
| 354 | - rb.setData(map); | |
| 355 | - rb.setErrorCode("0"); | |
| 356 | - rb.setErrorMessage("启动活动成功"); | |
| 357 | - return rb; | |
| 255 | + if (tLive == null) { | |
| 256 | + log.info("tLive为空......"); | |
| 257 | + rb.setErrorCode("500"); | |
| 258 | + rb.setErrorMessage("启动活动失败,活动对象为空"); | |
| 259 | + return rb; | |
| 260 | + } else { | |
| 261 | + rb.setErrorCode("0"); | |
| 262 | + rb.setErrorMessage("启动活动成功"); | |
| 263 | + return rb; | |
| 264 | + } | |
| 358 | 265 | } |
| 359 | 266 | } |
| 360 | 267 | |
| ... | ... | @@ -366,48 +273,41 @@ public class LiveAction { |
| 366 | 273 | */ |
| 367 | 274 | @Request.Get("/live/epg/stopActivity") |
| 368 | 275 | public ResultBean stopActivity(Params params) { |
| 276 | + log.info(params); | |
| 369 | 277 | ResultBean rb = new ResultBean(); |
| 370 | 278 | String appId = params.getString("appId"); |
| 371 | 279 | String activityid = params.getString("activityId"); |
| 280 | + TLive tLive = tLiveService.selectByParams(appId, activityid); | |
| 281 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 372 | 282 | if (StringUtils.isEmpty(appId) || StringUtils.isEmpty(activityid)) { |
| 373 | - Map<String, Object> map = new HashMap<String, Object>(); | |
| 374 | 283 | map.put("location", ""); |
| 375 | 284 | rb.setData(map); |
| 376 | 285 | rb.setErrorCode("500"); |
| 377 | 286 | rb.setErrorMessage("停止直播失败,参数不正确"); |
| 378 | 287 | return rb; |
| 379 | 288 | } else { |
| 380 | - TLive tLive = tLiveService.selectByParams(appId, activityid); | |
| 381 | - String live_url = tLive.getLive_url(); | |
| 382 | - int index = live_url.lastIndexOf("/"); | |
| 383 | - String streamName = live_url.substring(index + 1); | |
| 384 | - System.out.println("streamName===" + streamName); | |
| 385 | - String accesskey = BaseUtil.getAccessKey(); | |
| 386 | - try { | |
| 387 | - accesskey = java.net.URLEncoder.encode(accesskey, "utf-8"); | |
| 388 | - String add = "add"; | |
| 389 | - String signature = BaseUtil.signature(add, streamName); | |
| 390 | - String del = "del"; | |
| 391 | - String delsignature = BaseUtil.signature(del, streamName); | |
| 392 | - String expire = BaseUtil.getTimestamp(); | |
| 393 | - System.out.println(expire + "---expire---"); | |
| 394 | - // 断流。 | |
| 395 | - addBlackList(signature, accesskey, expire, streamName); | |
| 396 | - } catch (UnsupportedEncodingException e1) { | |
| 397 | - // TODO Auto-generated catch block | |
| 398 | - e1.printStackTrace(); | |
| 289 | + if (tLive == null) { | |
| 290 | + map.put("location", ""); | |
| 291 | + rb.setData(map); | |
| 292 | + rb.setErrorCode("500"); | |
| 293 | + rb.setErrorMessage("停止直播失败,活动对象为空"); | |
| 294 | + return rb; | |
| 295 | + } else { | |
| 296 | + String live_url = tLive.getLive_url(); | |
| 297 | + int index = live_url.lastIndexOf("/"); | |
| 298 | + String streamName = live_url.substring(index + 1); | |
| 299 | + System.out.println("streamName===" + streamName); | |
| 300 | + // 直播断流。 | |
| 301 | + tCheckService.close(streamName, tLive.getId(), tLive.getUuid()); | |
| 399 | 302 | } |
| 400 | 303 | // 直播通知 |
| 401 | 304 | // tLiveService.notify(video_uuid, -1); |
| 402 | - boolean flag = tCheckService.closeLive(Integer.parseInt(activityid)); | |
| 403 | - Map<String, Object> map = new HashMap<String, Object>(); | |
| 404 | 305 | map.put("location", tLive.getLive_url()); |
| 405 | 306 | rb.setData(map); |
| 406 | 307 | rb.setErrorCode("0"); |
| 407 | 308 | rb.setErrorMessage("停止直播成功"); |
| 408 | 309 | return rb; |
| 409 | 310 | } |
| 410 | - | |
| 411 | 311 | } |
| 412 | 312 | |
| 413 | 313 | /** |
| ... | ... | @@ -427,14 +327,21 @@ public class LiveAction { |
| 427 | 327 | map.put("location", ""); |
| 428 | 328 | rb.setData(map); |
| 429 | 329 | rb.setErrorCode("500"); |
| 430 | - rb.setErrorMessage("获取活动列表失败,字段不正确"); | |
| 330 | + rb.setErrorMessage("获取活动列表失败,参数不正确"); | |
| 431 | 331 | return rb; |
| 432 | 332 | } else { |
| 433 | 333 | Pager<TLive> tLive = tLiveService.getActivityPager(pageNo, pageSize, appId); |
| 434 | - rb.setData(tLive); | |
| 435 | - rb.setErrorCode("0"); | |
| 436 | - rb.setErrorMessage("获取活动列表成功"); | |
| 437 | - return rb; | |
| 334 | + if (tLive == null) { | |
| 335 | + rb.setData(""); | |
| 336 | + rb.setErrorCode("500"); | |
| 337 | + rb.setErrorMessage("获取活动列表失败,活动对象为空"); | |
| 338 | + return rb; | |
| 339 | + } else { | |
| 340 | + rb.setData(tLive); | |
| 341 | + rb.setErrorCode("0"); | |
| 342 | + rb.setErrorMessage("获取活动列表成功"); | |
| 343 | + return rb; | |
| 344 | + } | |
| 438 | 345 | |
| 439 | 346 | } |
| 440 | 347 | } |
| ... | ... | @@ -449,21 +356,28 @@ public class LiveAction { |
| 449 | 356 | ResultBean rb = new ResultBean(); |
| 450 | 357 | String appId = params.getString("appId"); |
| 451 | 358 | String activityid = params.getString("activityId"); |
| 359 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 452 | 360 | if (StringUtils.isEmpty(appId) || StringUtils.isEmpty(activityid)) { |
| 453 | - Map<String, Object> map = new HashMap<String, Object>(); | |
| 454 | 361 | map.put("location", ""); |
| 455 | 362 | rb.setData(map); |
| 456 | 363 | rb.setErrorCode("500"); |
| 457 | - rb.setErrorMessage("获取直播回放失败"); | |
| 364 | + rb.setErrorMessage("获取直播回放失败,参数不正确"); | |
| 458 | 365 | return rb; |
| 459 | 366 | } else { |
| 460 | 367 | TLive tLive = tLiveService.selectByParams(appId, activityid); |
| 461 | - Map<String, Object> map = new HashMap<String, Object>(); | |
| 462 | - map.put("location", tLive.getPlayback_url()); | |
| 463 | - rb.setData(map); | |
| 464 | - rb.setErrorCode("0"); | |
| 465 | - rb.setErrorMessage("获取直播回放成功"); | |
| 466 | - return rb; | |
| 368 | + if (tLive == null) { | |
| 369 | + map.put("location", ""); | |
| 370 | + rb.setData(map); | |
| 371 | + rb.setErrorCode("500"); | |
| 372 | + rb.setErrorMessage("获取直播回放失败,活动对象为空"); | |
| 373 | + return rb; | |
| 374 | + } else { | |
| 375 | + map.put("location", tLive.getPlayback_url()); | |
| 376 | + rb.setData(map); | |
| 377 | + rb.setErrorCode("0"); | |
| 378 | + rb.setErrorMessage("获取直播回放成功"); | |
| 379 | + return rb; | |
| 380 | + } | |
| 467 | 381 | } |
| 468 | 382 | } |
| 469 | 383 | |
| ... | ... | @@ -474,6 +388,192 @@ public class LiveAction { |
| 474 | 388 | */ |
| 475 | 389 | @Request.Get("/live/epg/liveplayByAPP") |
| 476 | 390 | public ResultBean liveplayByAPP(Params params) { |
| 391 | + log.info(params); | |
| 392 | + ResultBean rb = new ResultBean(); | |
| 393 | + String appId = params.getString("appId"); | |
| 394 | + String activityid = params.getString("activityId"); | |
| 395 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 396 | + if (StringUtils.isEmpty(appId) || StringUtils.isEmpty(activityid)) { | |
| 397 | + map.put("location", ""); | |
| 398 | + rb.setData(map); | |
| 399 | + rb.setErrorCode("500"); | |
| 400 | + rb.setErrorMessage("获取直播回放失败,参数不正确"); | |
| 401 | + return rb; | |
| 402 | + } else { | |
| 403 | + TLive tLive = tLiveService.selectByParams(appId, activityid); | |
| 404 | + if (tLive == null) { | |
| 405 | + map.put("location", ""); | |
| 406 | + rb.setData(map); | |
| 407 | + rb.setErrorCode("500"); | |
| 408 | + rb.setErrorMessage("获取直播回放失败,活动对象为空"); | |
| 409 | + return rb; | |
| 410 | + } else { | |
| 411 | + map.put("location", tLive.getPlayback_url()); | |
| 412 | + rb.setData(map); | |
| 413 | + rb.setErrorCode("0"); | |
| 414 | + rb.setErrorMessage("获取直播回放成功"); | |
| 415 | + return rb; | |
| 416 | + } | |
| 417 | + } | |
| 418 | + } | |
| 419 | + | |
| 420 | + /** | |
| 421 | + * 1.8 获取APP直播URL接口.md | |
| 422 | + * | |
| 423 | + * @param params | |
| 424 | + * @return | |
| 425 | + */ | |
| 426 | + @Request.Get("/live/epg/play/app") | |
| 427 | + public ResultBean appURL(Params params) throws IOException { | |
| 428 | + HttpServletResponse response = DataContext.getResponse(); | |
| 429 | + ResultBean rb = new ResultBean(); | |
| 430 | + String appId = params.getString("appId"); | |
| 431 | + String activityid = params.getString("activityId"); | |
| 432 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 433 | + if (StringUtils.isEmpty(appId) || StringUtils.isEmpty(activityid)) { | |
| 434 | + map.put("location", ""); | |
| 435 | + rb.setData(map); | |
| 436 | + rb.setErrorCode("500"); | |
| 437 | + rb.setErrorMessage("启动app活动失败"); | |
| 438 | + return rb; | |
| 439 | + } else { | |
| 440 | + TLive tLive = tLiveService.selectByParams(appId, activityid); | |
| 441 | + if (tLive == null) { | |
| 442 | + map.put("location", ""); | |
| 443 | + rb.setData(map); | |
| 444 | + rb.setErrorCode("500"); | |
| 445 | + rb.setErrorMessage("启动app活动失败,活动对象为空"); | |
| 446 | + return rb; | |
| 447 | + } else { | |
| 448 | + TChannel tchannel = tLiveService.selectChannel(tLive.getRelation_id()); | |
| 449 | + if (tchannel != null) { | |
| 450 | + // 请求到app....... | |
| 451 | + redirect(response, "http://ips.cnlive.com/IPS/liveplayByAPP.action?appId=" + appId + "&channelID=" | |
| 452 | + + tLive.getRelation_id()); | |
| 453 | + map.put("location", ""); | |
| 454 | + rb.setData(map); | |
| 455 | + rb.setErrorCode("0"); | |
| 456 | + rb.setErrorMessage("302重定向到app"); | |
| 457 | + return rb; | |
| 458 | + } else { | |
| 459 | + map.put("location", tLive.getLive_url()); | |
| 460 | + rb.setData(map); | |
| 461 | + rb.setErrorCode("0"); | |
| 462 | + rb.setErrorMessage("启动app活动成功"); | |
| 463 | + return rb; | |
| 464 | + } | |
| 465 | + } | |
| 466 | + } | |
| 467 | + | |
| 468 | + } | |
| 469 | + | |
| 470 | + /** | |
| 471 | + * 1.9 获取H5直播URL接口.md | |
| 472 | + * | |
| 473 | + * @param params | |
| 474 | + * @return | |
| 475 | + */ | |
| 476 | + @Request.Get("/live/epg/play/h5") | |
| 477 | + public ResultBean h5URL(Params params) { | |
| 478 | + HttpServletResponse response = DataContext.getResponse(); | |
| 479 | + ResultBean rb = new ResultBean(); | |
| 480 | + String appId = params.getString("appId"); | |
| 481 | + String activityid = params.getString("activityId"); | |
| 482 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 483 | + if (StringUtils.isEmpty(appId) || StringUtils.isEmpty(activityid)) { | |
| 484 | + map.put("location", ""); | |
| 485 | + rb.setData(map); | |
| 486 | + rb.setErrorCode("500"); | |
| 487 | + rb.setErrorMessage("启动h5活动失败"); | |
| 488 | + return rb; | |
| 489 | + } else { | |
| 490 | + TLive tLive = tLiveService.selectByParams(appId, activityid); | |
| 491 | + if (tLive == null) { | |
| 492 | + map.put("location", ""); | |
| 493 | + rb.setData(map); | |
| 494 | + rb.setErrorCode("500"); | |
| 495 | + rb.setErrorMessage("启动h5活动失败,活动对象为空"); | |
| 496 | + return rb; | |
| 497 | + } else { | |
| 498 | + TChannel tchannel = tLiveService.selectChannel(tLive.getRelation_id()); | |
| 499 | + if (tchannel != null) { | |
| 500 | + // 重定向到h5....... | |
| 501 | + redirect(response, "http://ips.cnlive.com/IPS/liveplayByH5?appId=" + appId + "&channelID=" | |
| 502 | + + tLive.getRelation_id()); | |
| 503 | + map.put("location", ""); | |
| 504 | + rb.setData(map); | |
| 505 | + rb.setErrorCode("0"); | |
| 506 | + rb.setErrorMessage("302重定向到h5"); | |
| 507 | + return rb; | |
| 508 | + } else { | |
| 509 | + map.put("location", tLive.getLive_url()); | |
| 510 | + rb.setData(map); | |
| 511 | + rb.setErrorCode("0"); | |
| 512 | + rb.setErrorMessage("启动h5活动成功"); | |
| 513 | + return rb; | |
| 514 | + } | |
| 515 | + } | |
| 516 | + } | |
| 517 | + | |
| 518 | + } | |
| 519 | + | |
| 520 | + /** | |
| 521 | + * 2.0 获取SWF直播URL接口.md | |
| 522 | + * | |
| 523 | + * @param params | |
| 524 | + * @return | |
| 525 | + */ | |
| 526 | + @Request.Get("/live/epg/play/swf") | |
| 527 | + public ResultBean swfURL(Params params) { | |
| 528 | + HttpServletResponse response = DataContext.getResponse(); | |
| 529 | + ResultBean rb = new ResultBean(); | |
| 530 | + String appId = params.getString("appId"); | |
| 531 | + String activityid = params.getString("activityId"); | |
| 532 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 533 | + if (StringUtils.isEmpty(appId) || StringUtils.isEmpty(activityid)) { | |
| 534 | + map.put("location", ""); | |
| 535 | + rb.setData(map); | |
| 536 | + rb.setErrorCode("500"); | |
| 537 | + rb.setErrorMessage("启动swf活动失败"); | |
| 538 | + return rb; | |
| 539 | + } else { | |
| 540 | + TLive tLive = tLiveService.selectByParams(appId, activityid); | |
| 541 | + if (tLive == null) { | |
| 542 | + map.put("location", ""); | |
| 543 | + rb.setData(map); | |
| 544 | + rb.setErrorCode("500"); | |
| 545 | + rb.setErrorMessage("启动swf活动失败,活动对象为空"); | |
| 546 | + return rb; | |
| 547 | + } else { | |
| 548 | + TChannel tchannel = tLiveService.selectChannel(tLive.getRelation_id()); | |
| 549 | + rb.setData(map); | |
| 550 | + rb.setErrorCode("0"); | |
| 551 | + if (tchannel != null) { | |
| 552 | + // 302重定向到swf....... | |
| 553 | + redirect(response, "http://ips.cnlive.com/IPS/liveplayBySWF.action?appId=" + appId + "&channelID=" | |
| 554 | + + tLive.getRelation_id()); | |
| 555 | + map.put("location", ""); | |
| 556 | + rb.setErrorMessage("302重定向到swf"); | |
| 557 | + return rb; | |
| 558 | + } else { | |
| 559 | + | |
| 560 | + map.put("location", tLive.getLive_url()); | |
| 561 | + rb.setErrorMessage("启动swf活动成功"); | |
| 562 | + return rb; | |
| 563 | + } | |
| 564 | + } | |
| 565 | + } | |
| 566 | + | |
| 567 | + } | |
| 568 | + | |
| 569 | + /** | |
| 570 | + * 2.1 获取推流直播播放地址.md | |
| 571 | + * | |
| 572 | + * @param params | |
| 573 | + * @return | |
| 574 | + */ | |
| 575 | + @Request.Get("/live/epg/play") | |
| 576 | + public ResultBean startLiveActivity(Params params) { | |
| 477 | 577 | ResultBean rb = new ResultBean(); |
| 478 | 578 | String appId = params.getString("appId"); |
| 479 | 579 | String activityid = params.getString("activityId"); |
| ... | ... | @@ -482,15 +582,15 @@ public class LiveAction { |
| 482 | 582 | map.put("location", ""); |
| 483 | 583 | rb.setData(map); |
| 484 | 584 | rb.setErrorCode("500"); |
| 485 | - rb.setErrorMessage("获取直播回放失败"); | |
| 585 | + rb.setErrorMessage("启动活动失败"); | |
| 486 | 586 | return rb; |
| 487 | 587 | } else { |
| 488 | 588 | TLive tLive = tLiveService.selectByParams(appId, activityid); |
| 489 | 589 | Map<String, Object> map = new HashMap<String, Object>(); |
| 490 | - map.put("location", tLive.getPlayback_url()); | |
| 590 | + map.put("location", tLive.getLive_url()); | |
| 491 | 591 | rb.setData(map); |
| 492 | 592 | rb.setErrorCode("0"); |
| 493 | - rb.setErrorMessage("获取直播回放成功"); | |
| 593 | + rb.setErrorMessage("启动活动成功"); | |
| 494 | 594 | return rb; |
| 495 | 595 | } |
| 496 | 596 | } |
| ... | ... | @@ -505,49 +605,45 @@ public class LiveAction { |
| 505 | 605 | rb.setErrorMessage("失败"); |
| 506 | 606 | return rb; |
| 507 | 607 | } |
| 608 | + | |
| 609 | + public static void redirect(HttpServletResponse response, String redirectUrl) { | |
| 610 | + try { | |
| 611 | + response.setContentType("application/mpegurl"); | |
| 612 | + response.setStatus(302); | |
| 613 | + response.setHeader("Location", redirectUrl); | |
| 614 | + response.setHeader("Connection", "close"); | |
| 615 | + } catch (Exception e) { | |
| 616 | + throw new RuntimeException(e); | |
| 617 | + } | |
| 618 | + } | |
| 619 | + | |
| 620 | + @Request.Get("/live/epg/302") | |
| 621 | + public void red302() { | |
| 622 | + HttpServletResponse response = DataContext.getResponse(); | |
| 623 | + redirect(response, "http://ips.cnlive.com/IPS/liveplayBySWF.action?activityId=12345"); | |
| 624 | + } | |
| 625 | + | |
| 508 | 626 | public static void main(String[] args) { |
| 627 | + | |
| 509 | 628 | /* |
| 510 | - * Map<String, Object> mapFiles = new HashMap<String, Object>(); | |
| 511 | - * mapFiles.put("app_id", null); mapFiles.put("start_time", ""); | |
| 512 | - * mapFiles.put("end_time",""); // TODO 活动id mapFiles.put("category", | |
| 513 | - * ""); boolean flag = DataSet.insert(TLive.class, mapFiles); | |
| 514 | - * System.out.println(flag); | |
| 629 | + * NameValuePair[] nvp = new NameValuePair[6]; NameValuePair nv1 = new | |
| 630 | + * NameValuePair(); nv1.setName("appId"); nv1.setValue("123"); nvp[0] = | |
| 631 | + * nv1; NameValuePair nv2 = new NameValuePair(); | |
| 632 | + * nv2.setName("activityId"); nv2.setValue("234e"); nvp[1] = nv2; | |
| 633 | + * NameValuePair nv3 = new NameValuePair(); nv3.setName("activityName"); | |
| 634 | + * nv3.setValue("ee"); nvp[2] = nv3; NameValuePair nv4 = new | |
| 635 | + * NameValuePair(); nv4.setName("activityStatus"); nv4.setValue("11"); | |
| 636 | + * nvp[3] = nv4; NameValuePair nv5 = new NameValuePair(); | |
| 637 | + * nv5.setName("isHorizontalScreen"); nv5.setValue("321"); nvp[4] = nv5; | |
| 638 | + * NameValuePair nv6 = new NameValuePair(); nv6.setName("channelId"); | |
| 639 | + * nv6.setValue("ww"); nvp[5] = nv6; String ss = | |
| 640 | + * HttpReq.postRequestWidthResult( | |
| 641 | + * "http://bc.cnlive.com/live/epg/createActivity", nvp); | |
| 642 | + * System.out.println(ss); <<<<<<< HEAD String aa = HttpReq | |
| 643 | + * .getRequestWidthResult( | |
| 644 | + * "http://bc.cnlive.com/live/epg/startActivity?appId=123&activityId=234" | |
| 645 | + * ); System.out.println(aa); | |
| 515 | 646 | */ |
| 516 | - // String appId = params.getString("appId"); | |
| 517 | - // String activityid = params.getString("activityid"); | |
| 518 | - // String activityname = params.getString("activityname"); | |
| 519 | - // int activitystatus = params.getInt("activitystatus"); | |
| 520 | - // int isHorizontalScreen = params.getInt("isHorizontalScreen"); | |
| 521 | - // String channelID = params.getString("channelID"); | |
| 522 | - // NameValuePair nv1 = new NameValuePair("appId", "123"); | |
| 523 | - // NameValuePair nv2 = new NameValuePair("activityid", "234"); | |
| 524 | - NameValuePair[] nvp = new NameValuePair[6]; | |
| 525 | - NameValuePair nv1 = new NameValuePair(); | |
| 526 | - nv1.setName("appId"); | |
| 527 | - nv1.setValue("123"); | |
| 528 | - nvp[0] = nv1; | |
| 529 | - NameValuePair nv2 = new NameValuePair(); | |
| 530 | - nv2.setName("activityId"); | |
| 531 | - nv2.setValue("234e"); | |
| 532 | - nvp[1] = nv2; | |
| 533 | - NameValuePair nv3 = new NameValuePair(); | |
| 534 | - nv3.setName("activityName"); | |
| 535 | - nv3.setValue("ee"); | |
| 536 | - nvp[2] = nv3; | |
| 537 | - NameValuePair nv4 = new NameValuePair(); | |
| 538 | - nv4.setName("activityStatus"); | |
| 539 | - nv4.setValue("11"); | |
| 540 | - nvp[3] = nv4; | |
| 541 | - NameValuePair nv5 = new NameValuePair(); | |
| 542 | - nv5.setName("isHorizontalScreen"); | |
| 543 | - nv5.setValue("321"); | |
| 544 | - nvp[4] = nv5; | |
| 545 | - NameValuePair nv6 = new NameValuePair(); | |
| 546 | - nv6.setName("channelId"); | |
| 547 | - nv6.setValue("ww"); | |
| 548 | - nvp[5] = nv6; | |
| 549 | - String ss = HttpReq.postRequestWidthResult("http://bc.cnlive.com/live/epg/createActivity", nvp); | |
| 550 | - System.out.println(ss); | |
| 551 | 647 | String aa = HttpReq |
| 552 | 648 | .getRequestWidthResult("http://bc.cnlive.com/live/epg/startActivity?appId=123&activityId=234"); |
| 553 | 649 | System.out.println(aa); | ... | ... |
src/main/java/com/cnlive/mz/live/action/UserAction.java
| 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.annotation.Action; | |
| 6 | -import org.smart4j.framework.mvc.annotation.Request; | |
| 7 | -import org.smart4j.framework.mvc.bean.Result; | |
| 8 | -import org.smart4j.framework.mvc.bean.View; | |
| 9 | - | |
| 10 | -import com.cnlive.mz.live.entity.TLive; | |
| 11 | -import com.cnlive.mz.live.entity.TUser; | |
| 12 | -import com.cnlive.mz.live.service.TUserService; | |
| 13 | - | |
| 14 | -@Action | |
| 15 | -public class UserAction { | |
| 16 | - | |
| 17 | - @Inject | |
| 18 | - private TUserService tUserService; | |
| 19 | - | |
| 20 | - /** | |
| 21 | - * 获取用户列表页 | |
| 22 | - * | |
| 23 | - * @param pageNumber | |
| 24 | - * @return | |
| 25 | - */ | |
| 26 | - @Request.Get("/user/list/{pageNumber}") | |
| 27 | - public View list(int pageNumber) { | |
| 28 | - Pager<TUser> userPage = tUserService.getTUserPage(pageNumber); | |
| 29 | - return new View("user/user_list.jsp").data("userPage", userPage); | |
| 30 | - } | |
| 31 | - | |
| 32 | - @Request.Get("/user/live/{userId}/{pageNumber}") | |
| 33 | - public View livelist(int userId, int pageNumber) { | |
| 34 | - Pager<TLive> userPage = tUserService.getTLivePage(userId, pageNumber); | |
| 35 | - return new View("user/user_live_list.jsp").data("userPage", userPage); | |
| 36 | - } | |
| 37 | - | |
| 38 | - @Request.Get("/user/report/{userId}/{type}") | |
| 39 | - public Result report(int userId,String type) { | |
| 40 | - return new Result(tUserService.addReport(userId,type)); | |
| 41 | - } | |
| 42 | -} | |
| 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.annotation.Action; | |
| 6 | +import org.smart4j.framework.mvc.annotation.Request; | |
| 7 | +import org.smart4j.framework.mvc.bean.Result; | |
| 8 | +import org.smart4j.framework.mvc.bean.View; | |
| 9 | + | |
| 10 | +import com.cnlive.mz.live.entity.TLive; | |
| 11 | +import com.cnlive.mz.live.entity.TUser; | |
| 12 | +import com.cnlive.mz.live.service.TUserService; | |
| 13 | + | |
| 14 | +@Action | |
| 15 | +public class UserAction { | |
| 16 | + | |
| 17 | + @Inject | |
| 18 | + private TUserService tUserService; | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * 获取用户列表页 | |
| 22 | + * | |
| 23 | + * @param pageNumber | |
| 24 | + * @return | |
| 25 | + */ | |
| 26 | + @Request.Get("/user/list/{pageNumber}") | |
| 27 | + public View list(int pageNumber) { | |
| 28 | + Pager<TUser> userPage = tUserService.getTUserPage(pageNumber); | |
| 29 | + return new View("user/user_list.jsp").data("userPage", userPage); | |
| 30 | + } | |
| 31 | + | |
| 32 | + @Request.Get("/user/live/{userId}/{pageNumber}") | |
| 33 | + public View livelist(int userId, int pageNumber) { | |
| 34 | + Pager<TLive> userPage = tUserService.getTLivePage(userId, pageNumber); | |
| 35 | + return new View("user/user_live_list.jsp").data("userPage", userPage); | |
| 36 | + } | |
| 37 | + | |
| 38 | + @Request.Get("/user/report/{userId}/{type}") | |
| 39 | + public Result report(int userId,String type) { | |
| 40 | + return new Result(tUserService.addReport(userId,type)); | |
| 41 | + } | |
| 42 | +} | ... | ... |
src/main/java/com/cnlive/mz/live/action/VideoAction.java
| ... | ... | @@ -115,7 +115,7 @@ public class VideoAction { |
| 115 | 115 | } else { |
| 116 | 116 | tLive.setDirect(Integer.parseInt(direct)); |
| 117 | 117 | } |
| 118 | - tLive.setLive_url(Constants.KS_HOST_RTMP + tLive.getT_user_id() + "_" + uuid); | |
| 118 | + tLive.setLive_url(Constants.KS_HOST_RTMP + tLive.getT_user_id() ); | |
| 119 | 119 | success = tLiveService.startLive(tLive); |
| 120 | 120 | } |
| 121 | 121 | data.put("video_uuid", uuid); | ... | ... |
src/main/java/com/cnlive/mz/live/action/VodIpsAction.java
| ... | ... | @@ -4,41 +4,56 @@ import java.util.HashMap; |
| 4 | 4 | import java.util.Map; |
| 5 | 5 | |
| 6 | 6 | import org.apache.log4j.Logger; |
| 7 | +import org.smart4j.framework.ioc.annotation.Inject; | |
| 7 | 8 | import org.smart4j.framework.mvc.annotation.Action; |
| 8 | 9 | import org.smart4j.framework.mvc.annotation.Request; |
| 9 | 10 | import org.smart4j.framework.mvc.bean.Params; |
| 10 | 11 | import org.smart4j.framework.mvc.bean.Redirect; |
| 11 | 12 | import org.smart4j.framework.mvc.bean.ResultBean; |
| 12 | 13 | |
| 14 | +import com.cnlive.mz.live.service.VodIpsServer; | |
| 15 | + | |
| 13 | 16 | /** |
| 14 | 17 | * 点播调度 |
| 18 | + * | |
| 15 | 19 | * @author adm |
| 16 | 20 | * |
| 17 | 21 | */ |
| 18 | 22 | @Action |
| 19 | 23 | public class VodIpsAction { |
| 24 | + @Inject | |
| 25 | + VodIpsServer vodIpsServer; | |
| 20 | 26 | |
| 21 | 27 | private Logger log = Logger.getLogger("VodIpsAction"); |
| 22 | - | |
| 28 | + | |
| 23 | 29 | @Request.Get("/vodips/h5/{id}") |
| 24 | - public Redirect h5(int id,Params params) { | |
| 25 | - Redirect r=new Redirect(); | |
| 26 | - r.setRedirectUrl("http://wideo03.cnlive.com/video/data1/2016/0808/141118/1500/878e13fc40754c2caf1476f7cad5f7b9_141118_1500.m3u8"); | |
| 30 | + public Redirect h5(int id, Params params) { | |
| 31 | + String vId=params.getString("vId"); | |
| 32 | + int rate=params.getInt("rate"); | |
| 33 | + Redirect r = new Redirect(); | |
| 34 | + String url=vodIpsServer.getH5PlayUrl(vId, rate); | |
| 35 | + r.setRedirectUrl(url); | |
| 27 | 36 | return r; |
| 28 | 37 | } |
| 29 | - | |
| 38 | + | |
| 30 | 39 | @Request.Get("/vodips/app/{id}") |
| 31 | - public Redirect app(int id,Params params) { | |
| 32 | - Redirect r=new Redirect(); | |
| 33 | - r.setRedirectUrl("http://wideo03.cnlive.com/video/data1/2016/0808/141118/1500/878e13fc40754c2caf1476f7cad5f7b9_141118_1500.m3u8"); | |
| 40 | + public Redirect app(int id, Params params) { | |
| 41 | + String vId=params.getString("vId"); | |
| 42 | + int rate=params.getInt("rate"); | |
| 43 | + String url=vodIpsServer.getAppPlayUrl(vId, rate); | |
| 44 | + Redirect r = new Redirect(); | |
| 45 | + r.setRedirectUrl(url); | |
| 34 | 46 | return r; |
| 35 | 47 | } |
| 36 | - | |
| 48 | + | |
| 37 | 49 | @Request.Get("/vodips/flash/{id}") |
| 38 | - public ResultBean flash(int id,Params params) { | |
| 39 | - ResultBean rb =new ResultBean(); | |
| 40 | - Map map =new HashMap(); | |
| 41 | - map.put("\"location\"", "http://wideo01.cnlive.com/video/data1/2016/0524/124025/800/b7e34cfee140449f9e04c5e85b66aa56_124025_800.mp4"); | |
| 50 | + public ResultBean flash(int id, Params params) { | |
| 51 | + String vId=params.getString("vId"); | |
| 52 | + int rate=params.getInt("rate"); | |
| 53 | + String url=vodIpsServer.getFlashPlayUrl(vId, rate); | |
| 54 | + ResultBean rb = new ResultBean(); | |
| 55 | + Map map = new HashMap(); | |
| 56 | + map.put("location",url); | |
| 42 | 57 | rb.setData(map); |
| 43 | 58 | rb.setErrorCode("0"); |
| 44 | 59 | rb.setErrorMessage("成功"); | ... | ... |
src/main/java/com/cnlive/mz/live/action/WordAction.java
| 1 | -package com.cnlive.mz.live.action; | |
| 2 | - | |
| 3 | -import java.util.List; | |
| 4 | -import java.util.Map; | |
| 5 | -import java.util.Map.Entry; | |
| 6 | - | |
| 7 | -import org.smart4j.framework.ioc.annotation.Inject; | |
| 8 | -import org.smart4j.framework.mvc.annotation.Action; | |
| 9 | -import org.smart4j.framework.mvc.annotation.Request; | |
| 10 | -import org.smart4j.framework.mvc.bean.Params; | |
| 11 | -import org.smart4j.framework.mvc.bean.Result; | |
| 12 | -import org.smart4j.framework.mvc.bean.View; | |
| 13 | - | |
| 14 | -import com.cnlive.mz.live.entity.TRoom; | |
| 15 | -import com.cnlive.mz.live.service.SensitiveWordService; | |
| 16 | - | |
| 17 | -@Action | |
| 18 | -public class WordAction { | |
| 19 | - | |
| 20 | - @Inject | |
| 21 | - private SensitiveWordService sensitiveWord; | |
| 22 | - | |
| 23 | - @Request.Post("/word/add") | |
| 24 | - public Result add(Params params){ | |
| 25 | - Map map = params.getFieldMap(); | |
| 26 | - String str = (String) map.get("words"); | |
| 27 | - str=str.replace(",", ",3."); | |
| 28 | - str=str+",3."; | |
| 29 | - return new Result(sensitiveWord.add(str)); | |
| 30 | - } | |
| 31 | - | |
| 32 | - @Request.Get("/word/list") | |
| 33 | - public View list(){ | |
| 34 | - View view = new View("word/word_management.jsp"); | |
| 35 | - List<String> str = sensitiveWord.list(); | |
| 36 | - view.data("str", str); | |
| 37 | - return view; | |
| 38 | - } | |
| 39 | -} | |
| 1 | +package com.cnlive.mz.live.action; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | +import java.util.Map; | |
| 5 | +import java.util.Map.Entry; | |
| 6 | + | |
| 7 | +import org.smart4j.framework.ioc.annotation.Inject; | |
| 8 | +import org.smart4j.framework.mvc.annotation.Action; | |
| 9 | +import org.smart4j.framework.mvc.annotation.Request; | |
| 10 | +import org.smart4j.framework.mvc.bean.Params; | |
| 11 | +import org.smart4j.framework.mvc.bean.Result; | |
| 12 | +import org.smart4j.framework.mvc.bean.View; | |
| 13 | + | |
| 14 | +import com.cnlive.mz.live.entity.TRoom; | |
| 15 | +import com.cnlive.mz.live.service.SensitiveWordService; | |
| 16 | + | |
| 17 | +@Action | |
| 18 | +public class WordAction { | |
| 19 | + | |
| 20 | + @Inject | |
| 21 | + private SensitiveWordService sensitiveWord; | |
| 22 | + | |
| 23 | + @Request.Post("/word/add") | |
| 24 | + public Result add(Params params){ | |
| 25 | + Map map = params.getFieldMap(); | |
| 26 | + String str = (String) map.get("words"); | |
| 27 | + str=str.replace(",", ",3."); | |
| 28 | + str=str+",3."; | |
| 29 | + return new Result(sensitiveWord.add(str)); | |
| 30 | + } | |
| 31 | + | |
| 32 | + @Request.Get("/word/list") | |
| 33 | + public View list(){ | |
| 34 | + View view = new View("word/word_management.jsp"); | |
| 35 | + List<String> str = sensitiveWord.list(); | |
| 36 | + view.data("str", str); | |
| 37 | + return view; | |
| 38 | + } | |
| 39 | +} | ... | ... |
src/main/java/com/cnlive/mz/live/aspect/AuthFilter.java
| 1 | -package com.cnlive.mz.live.aspect; | |
| 2 | - | |
| 3 | -import java.io.IOException; | |
| 4 | - | |
| 5 | -import javax.servlet.Filter; | |
| 6 | -import javax.servlet.FilterChain; | |
| 7 | -import javax.servlet.FilterConfig; | |
| 8 | -import javax.servlet.ServletException; | |
| 9 | -import javax.servlet.ServletRequest; | |
| 10 | -import javax.servlet.ServletResponse; | |
| 11 | -import javax.servlet.annotation.WebFilter; | |
| 12 | -import javax.servlet.http.HttpServletRequest; | |
| 13 | -import javax.servlet.http.HttpServletResponse; | |
| 14 | -import javax.servlet.http.HttpSession; | |
| 15 | - | |
| 16 | -import org.smart4j.framework.core.ConfigHelper; | |
| 17 | - | |
| 18 | -import com.cnlive.mz.live.common.LiveUtils; | |
| 19 | - | |
| 20 | -/* | |
| 21 | - * | |
| 22 | - | |
| 23 | - 属性 是否必须 说明 | |
| 24 | - asyncSupported 否 该Filter是否支持异步操作模式 | |
| 25 | - dispatcherType 否 指定Filter对那种dispatcher模式进行过滤 该属性支持 Async,Error Forward,include,request | |
| 26 | - displayName 否 File 显示的名称 | |
| 27 | - filterName 是 Filter的名称 | |
| 28 | - initParams 否 Filter的配置参数 | |
| 29 | - servletNames 否 可以指定多个,表示对这几个特定的的serlet 进行过滤 | |
| 30 | - urlPatterns/value 否 指定 Filter拦截的 URL | |
| 31 | - | |
| 32 | - | |
| 33 | - | |
| 34 | - | |
| 35 | - @WebFilter(filterName="log",urlPatterns={"/*"})*/ | |
| 36 | -@WebFilter(filterName = "AuthFilter", urlPatterns = { "/activity/*", "/channel/*", "/signal/*", "/index/*", | |
| 37 | - "/switch/*", "/doswitch/*", "/wowza/*" }) | |
| 38 | -public class AuthFilter implements Filter { | |
| 39 | - | |
| 40 | - private FilterConfig config; | |
| 41 | - | |
| 42 | - @Override | |
| 43 | - public void destroy() { | |
| 44 | - this.config = null; | |
| 45 | - } | |
| 46 | - | |
| 47 | - @Override | |
| 48 | - public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain chain) throws IOException, | |
| 49 | - ServletException { | |
| 50 | - HttpServletRequest request = (HttpServletRequest) arg0; | |
| 51 | - HttpServletResponse response = (HttpServletResponse) arg1; | |
| 52 | - String requestUrl = request.getRequestURI(); | |
| 53 | - HttpSession session = request.getSession(); | |
| 54 | - String webUrl = ConfigHelper.getString("website.url"); | |
| 55 | - String a=(String) session.getAttribute(LiveUtils.SESSION_KEY_NAME) ; | |
| 56 | - if (a== null) { | |
| 57 | - boolean authEnable = ConfigHelper.getBoolean("auth.enable"); | |
| 58 | - String loginUrl = ConfigHelper.getString("auth.login.url"); | |
| 59 | - if (authEnable) { | |
| 60 | - //去登录认证 | |
| 61 | - String url=loginUrl + webUrl+"/login/success"; | |
| 62 | - response.sendRedirect(url); | |
| 63 | - return; | |
| 64 | - } else { | |
| 65 | - String userName = "liujicheng"; | |
| 66 | - request.getSession().setAttribute(LiveUtils.SESSION_KEY_NAME, userName); | |
| 67 | - request.getSession().setAttribute(LiveUtils.SESSION_KEY_ID, 1); | |
| 68 | - } | |
| 69 | - } else { | |
| 70 | - chain.doFilter(arg0, arg1); | |
| 71 | - } | |
| 72 | - // 验证用户是否是退出,进行sessioin销毁 | |
| 73 | - if (requestUrl.contains("logout")) { | |
| 74 | - String logoutUrl = ConfigHelper.getString("auth.logout.url"); | |
| 75 | - session.removeAttribute(LiveUtils.SESSION_KEY_NAME); | |
| 76 | - session.removeAttribute(LiveUtils.SESSION_KEY_ID); | |
| 77 | - session.invalidate(); | |
| 78 | - response.sendRedirect(logoutUrl); | |
| 79 | - } | |
| 80 | - } | |
| 81 | - | |
| 82 | - @Override | |
| 83 | - public void init(FilterConfig config) throws ServletException { | |
| 84 | - this.config = config; | |
| 85 | - } | |
| 86 | - | |
| 87 | -} | |
| 1 | +package com.cnlive.mz.live.aspect; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | + | |
| 5 | +import javax.servlet.Filter; | |
| 6 | +import javax.servlet.FilterChain; | |
| 7 | +import javax.servlet.FilterConfig; | |
| 8 | +import javax.servlet.ServletException; | |
| 9 | +import javax.servlet.ServletRequest; | |
| 10 | +import javax.servlet.ServletResponse; | |
| 11 | +import javax.servlet.annotation.WebFilter; | |
| 12 | +import javax.servlet.http.HttpServletRequest; | |
| 13 | +import javax.servlet.http.HttpServletResponse; | |
| 14 | +import javax.servlet.http.HttpSession; | |
| 15 | + | |
| 16 | +import org.smart4j.framework.core.ConfigHelper; | |
| 17 | + | |
| 18 | +import com.cnlive.mz.live.common.LiveUtils; | |
| 19 | + | |
| 20 | +/* | |
| 21 | + * | |
| 22 | + | |
| 23 | + 属性 是否必须 说明 | |
| 24 | + asyncSupported 否 该Filter是否支持异步操作模式 | |
| 25 | + dispatcherType 否 指定Filter对那种dispatcher模式进行过滤 该属性支持 Async,Error Forward,include,request | |
| 26 | + displayName 否 File 显示的名称 | |
| 27 | + filterName 是 Filter的名称 | |
| 28 | + initParams 否 Filter的配置参数 | |
| 29 | + servletNames 否 可以指定多个,表示对这几个特定的的serlet 进行过滤 | |
| 30 | + urlPatterns/value 否 指定 Filter拦截的 URL | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + @WebFilter(filterName="log",urlPatterns={"/*"})*/ | |
| 36 | +@WebFilter(filterName = "AuthFilter", urlPatterns = { "/activity/*", "/channel/*", "/signal/*", "/index/*", | |
| 37 | + "/switch/*", "/doswitch/*", "/wowza/*" }) | |
| 38 | +public class AuthFilter implements Filter { | |
| 39 | + | |
| 40 | + private FilterConfig config; | |
| 41 | + | |
| 42 | + @Override | |
| 43 | + public void destroy() { | |
| 44 | + this.config = null; | |
| 45 | + } | |
| 46 | + | |
| 47 | + @Override | |
| 48 | + public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain chain) throws IOException, | |
| 49 | + ServletException { | |
| 50 | + HttpServletRequest request = (HttpServletRequest) arg0; | |
| 51 | + HttpServletResponse response = (HttpServletResponse) arg1; | |
| 52 | + String requestUrl = request.getRequestURI(); | |
| 53 | + HttpSession session = request.getSession(); | |
| 54 | + String webUrl = ConfigHelper.getString("website.url"); | |
| 55 | + String a=(String) session.getAttribute(LiveUtils.SESSION_KEY_NAME) ; | |
| 56 | + if (a== null) { | |
| 57 | + boolean authEnable = ConfigHelper.getBoolean("auth.enable"); | |
| 58 | + String loginUrl = ConfigHelper.getString("auth.login.url"); | |
| 59 | + if (authEnable) { | |
| 60 | + //去登录认证 | |
| 61 | + String url=loginUrl + webUrl+"/login/success"; | |
| 62 | + response.sendRedirect(url); | |
| 63 | + return; | |
| 64 | + } else { | |
| 65 | + String userName = "liujicheng"; | |
| 66 | + request.getSession().setAttribute(LiveUtils.SESSION_KEY_NAME, userName); | |
| 67 | + request.getSession().setAttribute(LiveUtils.SESSION_KEY_ID, 1); | |
| 68 | + } | |
| 69 | + } else { | |
| 70 | + chain.doFilter(arg0, arg1); | |
| 71 | + } | |
| 72 | + // 验证用户是否是退出,进行sessioin销毁 | |
| 73 | + if (requestUrl.contains("logout")) { | |
| 74 | + String logoutUrl = ConfigHelper.getString("auth.logout.url"); | |
| 75 | + session.removeAttribute(LiveUtils.SESSION_KEY_NAME); | |
| 76 | + session.removeAttribute(LiveUtils.SESSION_KEY_ID); | |
| 77 | + session.invalidate(); | |
| 78 | + response.sendRedirect(logoutUrl); | |
| 79 | + } | |
| 80 | + } | |
| 81 | + | |
| 82 | + @Override | |
| 83 | + public void init(FilterConfig config) throws ServletException { | |
| 84 | + this.config = config; | |
| 85 | + } | |
| 86 | + | |
| 87 | +} | ... | ... |
src/main/java/com/cnlive/mz/live/rest/BaseUtil.java
| 1 | -package com.cnlive.mz.live.rest; | |
| 2 | - | |
| 3 | -import java.io.BufferedReader; | |
| 4 | -import java.io.IOException; | |
| 5 | -import java.io.InputStreamReader; | |
| 6 | -import java.io.PrintWriter; | |
| 7 | -import java.io.UnsupportedEncodingException; | |
| 8 | -import java.net.URL; | |
| 9 | -import java.net.URLConnection; | |
| 10 | -import java.security.MessageDigest; | |
| 11 | -import java.text.DateFormat; | |
| 12 | -import java.text.ParseException; | |
| 13 | -import java.text.SimpleDateFormat; | |
| 14 | -import java.util.Calendar; | |
| 15 | -import java.util.Date; | |
| 16 | -import java.util.Locale; | |
| 17 | -import java.util.UUID; | |
| 18 | - | |
| 19 | -import javax.crypto.Mac; | |
| 20 | -import javax.crypto.spec.SecretKeySpec; | |
| 21 | - | |
| 22 | -import org.apache.commons.codec.binary.Base64; | |
| 23 | - | |
| 24 | -import com.cnlive.mz.commons.net.HttpReq; | |
| 25 | - | |
| 26 | -import sun.misc.BASE64Encoder; | |
| 27 | - | |
| 28 | -public class BaseUtil { | |
| 29 | - | |
| 30 | - private static final String ENCODING = "UTF-8"; | |
| 31 | - | |
| 32 | - // AccessKey、SecretKey | |
| 33 | - private static final String SECRET_KEY = "UIWPYVeaV8kq2vWImDkLBvWs/pwmTJVF9MCNHDsC"; | |
| 34 | - private static final String ACCESS_KEY = "fWUN8KDtJZJGo0ArQ4qo"; | |
| 35 | - | |
| 36 | - /* | |
| 37 | - * 计算MD5+BASE64 | |
| 38 | - */ | |
| 39 | - public static String MD5Base64(String s) { | |
| 40 | - if (s == null) | |
| 41 | - return null; | |
| 42 | - String encodeStr = ""; | |
| 43 | - byte[] utfBytes = s.getBytes(); | |
| 44 | - MessageDigest mdTemp; | |
| 45 | - try { | |
| 46 | - mdTemp = MessageDigest.getInstance("MD5"); | |
| 47 | - mdTemp.update(utfBytes); | |
| 48 | - byte[] md5Bytes = mdTemp.digest(); | |
| 49 | - BASE64Encoder b64Encoder = new BASE64Encoder(); | |
| 50 | - encodeStr = b64Encoder.encode(md5Bytes); | |
| 51 | - } catch (Exception e) { | |
| 52 | - throw new Error("Failed to generate MD5 : " + e.getMessage()); | |
| 53 | - } | |
| 54 | - return encodeStr; | |
| 55 | - } | |
| 56 | - | |
| 57 | - /* | |
| 58 | - * 哈希计算 HMAC-SHA1 base64 | |
| 59 | - */ | |
| 60 | - public static String HMACSha1(String data, String key) { | |
| 61 | - String result; | |
| 62 | - try { | |
| 63 | - SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), "HmacSHA1"); | |
| 64 | - Mac mac = Mac.getInstance("HmacSHA1"); | |
| 65 | - mac.init(signingKey); | |
| 66 | - byte[] rawHmac = mac.doFinal(data.getBytes()); | |
| 67 | - // result = new String(Base64.encodeBase64(rawHmac, false), ENCODING); | |
| 68 | - // result = (new BASE64Encoder()).encode(rawHmac); | |
| 69 | - result = new String(Base64.encodeBase64(rawHmac), ENCODING); | |
| 70 | - } catch (Exception e) { | |
| 71 | - throw new Error("Failed to generate HMAC : " + e.getMessage()); | |
| 72 | - } | |
| 73 | - return result; | |
| 74 | - } | |
| 75 | - | |
| 76 | - /** | |
| 77 | - * 获取当前前一天的时间戳 | |
| 78 | - * | |
| 79 | - * @return | |
| 80 | - */ | |
| 81 | - public static String getTimestamp() { | |
| 82 | - DateFormat df = new SimpleDateFormat("yyyyMMdd"); | |
| 83 | - Date date = null; | |
| 84 | - try { | |
| 85 | - Calendar calendar = Calendar.getInstance(); | |
| 86 | - calendar.add(Calendar.DATE, +1); | |
| 87 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); | |
| 88 | - String motoday = sdf.format(calendar.getTime()); | |
| 89 | - date = df.parse(motoday); | |
| 90 | - } catch (ParseException e) { | |
| 91 | - e.printStackTrace(); | |
| 92 | - } | |
| 93 | - Calendar cal = Calendar.getInstance(); | |
| 94 | - cal.setTime(date); | |
| 95 | - long timestamp = cal.getTimeInMillis(); | |
| 96 | - System.out.println("------timestamp-----" + timestamp); | |
| 97 | - return String.valueOf(timestamp); | |
| 98 | - | |
| 99 | - } | |
| 100 | - | |
| 101 | - /** | |
| 102 | - * 签名算法:signature 字符串格式,由三部分组成:GET+”\n”+Expire+”\n”+Resource 2016 0602171212 | |
| 103 | - * | |
| 104 | - * @return | |
| 105 | - * @throws UnsupportedEncodingException | |
| 106 | - */ | |
| 107 | - public static String signature(String streamName) throws UnsupportedEncodingException { | |
| 108 | - | |
| 109 | - String method = "GET"; | |
| 110 | - String expire = BaseUtil.getTimestamp(); | |
| 111 | - String app = "live"; | |
| 112 | - String methodadd = "add"; | |
| 113 | - String name = streamName; | |
| 114 | - app = java.net.URLEncoder.encode(app, "utf-8"); | |
| 115 | - methodadd = java.net.URLEncoder.encode(methodadd, "utf-8"); | |
| 116 | - name = java.net.URLEncoder.encode(name, "utf-8"); | |
| 117 | - System.out.println(expire + "---expire----"); | |
| 118 | - String Resource = "app=" + app + "&method=" + methodadd + "&name=" + name; | |
| 119 | - // Resource = java.net.URLEncoder.encode(Resource, "utf-8"); | |
| 120 | - String stringToSign = method + "\n" + expire + "\n" + Resource; | |
| 121 | - System.out.println("--stringToSign--" + stringToSign); | |
| 122 | - // 2.计算 HMAC-SHA1 | |
| 123 | - String signature = HMACSha1(stringToSign, SECRET_KEY); | |
| 124 | - System.out.println("---signature---" + signature); | |
| 125 | - signature = java.net.URLEncoder.encode(signature, "utf-8"); | |
| 126 | - return signature; | |
| 127 | - } | |
| 128 | - | |
| 129 | - public static String signature(String methodName, String streamName) throws UnsupportedEncodingException { | |
| 130 | - | |
| 131 | - String method = "GET"; | |
| 132 | - String expire = BaseUtil.getTimestamp(); | |
| 133 | - String app = "live"; | |
| 134 | - app = java.net.URLEncoder.encode(app, "utf-8"); | |
| 135 | - methodName = java.net.URLEncoder.encode(methodName, "utf-8"); | |
| 136 | - streamName = java.net.URLEncoder.encode(streamName, "utf-8"); | |
| 137 | - System.out.println(expire + "---expire----"); | |
| 138 | - String Resource = "app=" + app + "&method=" + methodName + "&name=" + streamName; | |
| 139 | - // Resource = java.net.URLEncoder.encode(Resource, "utf-8"); | |
| 140 | - String stringToSign = method + "\n" + expire + "\n" + Resource; | |
| 141 | - System.out.println("--stringToSign--" + stringToSign); | |
| 142 | - // 2.计算 HMAC-SHA1 | |
| 143 | - String signature = HMACSha1(stringToSign, SECRET_KEY); | |
| 144 | - System.out.println("---signature---" + signature); | |
| 145 | - signature = java.net.URLEncoder.encode(signature, "utf-8"); | |
| 146 | - return signature; | |
| 147 | - } | |
| 148 | - | |
| 149 | - public static String UUid() { | |
| 150 | - | |
| 151 | - String uuid = UUID.randomUUID().toString(); | |
| 152 | - uuid = uuid.replaceAll("-", ""); | |
| 153 | - return uuid; | |
| 154 | - } | |
| 155 | - | |
| 156 | - public static String getAccessKey() { | |
| 157 | - return ACCESS_KEY; | |
| 158 | - } | |
| 159 | - | |
| 160 | - public static int random_7(int number) { | |
| 161 | - int x = (int) (Math.random() * 10); | |
| 162 | - for (int i = 0; i < number; i++) { | |
| 163 | - String num = Math.random() * 10 + ""; | |
| 164 | - } | |
| 165 | - return x; | |
| 166 | - } | |
| 167 | - | |
| 168 | - /* | |
| 169 | - * 等同于javaScript中的 new Date().toUTCString(); | |
| 170 | - */ | |
| 171 | - public static String toGMTString(Date date) { | |
| 172 | - SimpleDateFormat df = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z", Locale.UK); | |
| 173 | - df.setTimeZone(new java.util.SimpleTimeZone(0, "GMT")); | |
| 174 | - return df.format(date); | |
| 175 | - } | |
| 176 | - | |
| 177 | - /* | |
| 178 | - * 发送POST请求 | |
| 179 | - */ | |
| 180 | - public static String sendPost(String url, String body, String ak_id, String ak_secret) { | |
| 181 | - PrintWriter out = null; | |
| 182 | - BufferedReader in = null; | |
| 183 | - String result = ""; | |
| 184 | - try { | |
| 185 | - URL realUrl = new URL(url); | |
| 186 | - | |
| 187 | - /* | |
| 188 | - * http header 参数 | |
| 189 | - */ | |
| 190 | - String method = "POST"; | |
| 191 | - String accept = "json"; | |
| 192 | - String content_type = "application/json"; | |
| 193 | - String path = realUrl.getFile(); | |
| 194 | - String date = toGMTString(new Date()); | |
| 195 | - | |
| 196 | - // 1.对body做MD5+BASE64加密 | |
| 197 | - String bodyMd5 = MD5Base64(body); | |
| 198 | - String stringToSign = method + "\n" + accept + "\n" + bodyMd5 + "\n" + content_type + "\n" + date + "\n" | |
| 199 | - + path; | |
| 200 | - // 2.计算 HMAC-SHA1 | |
| 201 | - String signature = HMACSha1(stringToSign, ak_secret); | |
| 202 | - // 3.得到 authorization header | |
| 203 | - String authHeader = "Dataplus " + ak_id + ":" + signature; | |
| 204 | - | |
| 205 | - // 打开和URL之间的连接 | |
| 206 | - URLConnection conn = realUrl.openConnection(); | |
| 207 | - // 设置通用的请求属性 | |
| 208 | - conn.setRequestProperty("accept", accept); | |
| 209 | - conn.setRequestProperty("content-type", content_type); | |
| 210 | - conn.setRequestProperty("date", date); | |
| 211 | - conn.setRequestProperty("Authorization", authHeader); | |
| 212 | - // 发送POST请求必须设置如下两行 | |
| 213 | - conn.setDoOutput(true); | |
| 214 | - conn.setDoInput(true); | |
| 215 | - // 获取URLConnection对象对应的输出流 | |
| 216 | - out = new PrintWriter(conn.getOutputStream()); | |
| 217 | - // 发送请求参数 | |
| 218 | - out.print(body); | |
| 219 | - // flush输出流的缓冲 | |
| 220 | - out.flush(); | |
| 221 | - // 定义BufferedReader输入流来读取URL的响应 | |
| 222 | - in = new BufferedReader(new InputStreamReader(conn.getInputStream())); | |
| 223 | - String line; | |
| 224 | - while ((line = in.readLine()) != null) { | |
| 225 | - result += line; | |
| 226 | - } | |
| 227 | - } catch (Exception e) { | |
| 228 | - System.out.println("发送 POST 请求出现异常!" + e); | |
| 229 | - e.printStackTrace(); | |
| 230 | - } | |
| 231 | - // 使用finally块来关闭输出流、输入流 | |
| 232 | - finally { | |
| 233 | - try { | |
| 234 | - if (out != null) { | |
| 235 | - out.close(); | |
| 236 | - } | |
| 237 | - if (in != null) { | |
| 238 | - in.close(); | |
| 239 | - } | |
| 240 | - } catch (IOException ex) { | |
| 241 | - ex.printStackTrace(); | |
| 242 | - } | |
| 243 | - } | |
| 244 | - return result; | |
| 245 | - } | |
| 246 | - | |
| 247 | - /* | |
| 248 | - * GET请求 | |
| 249 | - */ | |
| 250 | - | |
| 251 | - public static String sendGet(String url, String ak_id, String ak_secret) { | |
| 252 | - String result = ""; | |
| 253 | - BufferedReader in = null; | |
| 254 | - try { | |
| 255 | - URL realUrl = new URL(url); | |
| 256 | - /* | |
| 257 | - * http header 参数 | |
| 258 | - */ | |
| 259 | - // String method = "GET"; | |
| 260 | - // String Expire = "1436976000"; | |
| 261 | - // String Resource = | |
| 262 | - // "nonce=4e1f2519c626cbfbab1520c255830c26&public=0&vdoid=12345"; | |
| 263 | - // String content_type = "application/json"; | |
| 264 | - // String path = realUrl.getFile(); | |
| 265 | - // String date = toGMTString(new Date()); | |
| 266 | - // // 1.对body做MD5+BASE64加密 | |
| 267 | - // // String bodyMd5 = MD5Base64(body); | |
| 268 | - // String stringToSign = method + "\n" + Expire + "\n" + Resource; | |
| 269 | - // // 2.计算 HMAC-SHA1 | |
| 270 | - // String signature = HMACSha1(stringToSign, ak_secret); | |
| 271 | - // // 3.得到 authorization header | |
| 272 | - // String authHeader = "Dataplus " + ak_id + ":" + signature; | |
| 273 | - // 打开和URL之间的连接 | |
| 274 | - URLConnection connection = realUrl.openConnection(); | |
| 275 | - // 设置通用的请求属性 | |
| 276 | - // connection.setRequestProperty("accept", "json"); | |
| 277 | - // connection.setRequestProperty("content-type", content_type); | |
| 278 | - // connection.setRequestProperty("date", date); | |
| 279 | - // connection.setRequestProperty("Authorization", authHeader); | |
| 280 | - // 建立实际的连接 | |
| 281 | - connection.connect(); | |
| 282 | - // 定义 BufferedReader输入流来读取URL的响应 | |
| 283 | - in = new BufferedReader(new InputStreamReader(connection.getInputStream())); | |
| 284 | - String line; | |
| 285 | - while ((line = in.readLine()) != null) { | |
| 286 | - result += line; | |
| 287 | - } | |
| 288 | - } catch (Exception e) { | |
| 289 | - System.out.println("发送GET请求出现异常!" + e); | |
| 290 | - e.printStackTrace(); | |
| 291 | - } | |
| 292 | - // 使用finally块来关闭输入流 | |
| 293 | - finally { | |
| 294 | - try { | |
| 295 | - if (in != null) { | |
| 296 | - in.close(); | |
| 297 | - } | |
| 298 | - } catch (Exception e) { | |
| 299 | - e.printStackTrace(); | |
| 300 | - } | |
| 301 | - } | |
| 302 | - return result; | |
| 303 | - } | |
| 304 | - | |
| 305 | - public static void main(String[] args) throws Exception { | |
| 306 | - // 发送POST请求示例 | |
| 307 | - /* | |
| 308 | - * String ak_id = "fWUN8KDtJZJGo0ArQ4qo"; // 用户ak String ak_secret = | |
| 309 | - * "UIWPYVeaV8kq2vWImDkLBvWs/pwmTJVF9MCNHDsC"; // 用户ak_secret String url | |
| 310 | - * = "https://kmr-cn-beijing.ksyun.com"; String body = | |
| 311 | - * "{\"param1\": \"GET\n1436976000\nnonce=4e1f2519c626cbfbab1520c255830c26&public=0&vdoid=12345\", \"param2\":\"fWUN8KDtJZJGo0ArQ4qo\"}" | |
| 312 | - * ; System.out.println("response body:" + sendPost(url, body, AK_ID, | |
| 313 | - * AK_SECRET)); | |
| 314 | - */ | |
| 315 | - | |
| 316 | - Date date = new Date(); | |
| 317 | - System.out.println(toGMTString(date)); | |
| 318 | - String hh = HMACSha1("GET\n1436976124\nnonce=4e1f2519c626cbfbab1520c255830c26&public=1&vdoid=1", | |
| 319 | - "fWUN8KDtJZJGo0ArQ4qo"); | |
| 320 | - String hhhh = MD5Base64(hh); | |
| 321 | - System.out.println(hh); | |
| 322 | - System.out.println(".............."); | |
| 323 | - | |
| 324 | - // String str = signature(); | |
| 325 | - // System.out.println(str);//L2muBoImPzyvwyzfBtGXEu+wRNE= | |
| 326 | - | |
| 327 | - // 发送GET请求 | |
| 328 | - String url1 = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=iDPKaesXXW3A26CScNyjpNkzxZs%3D&accesskey=I3TC8a4xboPUMe5xlp22&expire=1483200000&app=live&method=add&stream=310166_863"; | |
| 329 | - System.out.println("response body:" + sendGet(url1, ACCESS_KEY, SECRET_KEY)); | |
| 330 | - | |
| 331 | - // long d = getTimestamp(); | |
| 332 | - // System.out.println(d); | |
| 333 | - | |
| 334 | - // String str = signature(); | |
| 335 | - // System.out.println(str);//L2muBoImPzyvwyzfBtGXEu+wRNE= | |
| 336 | - /* | |
| 337 | - * // 发送GET请求 String ak_id1 = "fWUN8KDtJZJGo0ArQ4qo"; //用户ak String | |
| 338 | - * ak_secret1 = "UIWPYVeaV8kq2vWImDkLBvWs/pwmTJVF9MCNHDsC"; // | |
| 339 | - * 用户ak_secret String url1 = | |
| 340 | - * "http://cnlive.uplive.ks-cdn.com?signature=L2muBoImPzyvwyzfBtGXEu+wRNE=&accesskey=fWUN8KDtJZJGo0ArQ4qo&expire=1436976000&method=add&app=live&name=498122_57"; | |
| 341 | - * System.out.println("response body:" +sendGet(url1, ak_id1, | |
| 342 | - * ak_secret1)); | |
| 343 | - */ | |
| 344 | - // long d = getTimestamp(); | |
| 345 | - // System.out.println(d); | |
| 346 | - | |
| 347 | - } | |
| 348 | -} | |
| 1 | +package com.cnlive.mz.live.rest; | |
| 2 | + | |
| 3 | +import java.io.BufferedReader; | |
| 4 | +import java.io.IOException; | |
| 5 | +import java.io.InputStreamReader; | |
| 6 | +import java.io.PrintWriter; | |
| 7 | +import java.io.UnsupportedEncodingException; | |
| 8 | +import java.net.URL; | |
| 9 | +import java.net.URLConnection; | |
| 10 | +import java.security.MessageDigest; | |
| 11 | +import java.text.DateFormat; | |
| 12 | +import java.text.ParseException; | |
| 13 | +import java.text.SimpleDateFormat; | |
| 14 | +import java.util.Calendar; | |
| 15 | +import java.util.Date; | |
| 16 | +import java.util.Locale; | |
| 17 | +import java.util.UUID; | |
| 18 | + | |
| 19 | +import javax.crypto.Mac; | |
| 20 | +import javax.crypto.spec.SecretKeySpec; | |
| 21 | + | |
| 22 | +import org.apache.commons.codec.binary.Base64; | |
| 23 | + | |
| 24 | +import com.cnlive.mz.commons.net.HttpReq; | |
| 25 | + | |
| 26 | +import sun.misc.BASE64Encoder; | |
| 27 | + | |
| 28 | +public class BaseUtil { | |
| 29 | + | |
| 30 | + private static final String ENCODING = "UTF-8"; | |
| 31 | + | |
| 32 | + // AccessKey、SecretKey | |
| 33 | + private static final String SECRET_KEY = "UIWPYVeaV8kq2vWImDkLBvWs/pwmTJVF9MCNHDsC"; | |
| 34 | + private static final String ACCESS_KEY = "fWUN8KDtJZJGo0ArQ4qo"; | |
| 35 | + | |
| 36 | + /* | |
| 37 | + * 计算MD5+BASE64 | |
| 38 | + */ | |
| 39 | + public static String MD5Base64(String s) { | |
| 40 | + if (s == null) | |
| 41 | + return null; | |
| 42 | + String encodeStr = ""; | |
| 43 | + byte[] utfBytes = s.getBytes(); | |
| 44 | + MessageDigest mdTemp; | |
| 45 | + try { | |
| 46 | + mdTemp = MessageDigest.getInstance("MD5"); | |
| 47 | + mdTemp.update(utfBytes); | |
| 48 | + byte[] md5Bytes = mdTemp.digest(); | |
| 49 | + BASE64Encoder b64Encoder = new BASE64Encoder(); | |
| 50 | + encodeStr = b64Encoder.encode(md5Bytes); | |
| 51 | + } catch (Exception e) { | |
| 52 | + throw new Error("Failed to generate MD5 : " + e.getMessage()); | |
| 53 | + } | |
| 54 | + return encodeStr; | |
| 55 | + } | |
| 56 | + | |
| 57 | + /* | |
| 58 | + * 哈希计算 HMAC-SHA1 base64 | |
| 59 | + */ | |
| 60 | + public static String HMACSha1(String data, String key) { | |
| 61 | + String result; | |
| 62 | + try { | |
| 63 | + SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), "HmacSHA1"); | |
| 64 | + Mac mac = Mac.getInstance("HmacSHA1"); | |
| 65 | + mac.init(signingKey); | |
| 66 | + byte[] rawHmac = mac.doFinal(data.getBytes()); | |
| 67 | + // result = new String(Base64.encodeBase64(rawHmac, false), ENCODING); | |
| 68 | + // result = (new BASE64Encoder()).encode(rawHmac); | |
| 69 | + result = new String(Base64.encodeBase64(rawHmac), ENCODING); | |
| 70 | + } catch (Exception e) { | |
| 71 | + throw new Error("Failed to generate HMAC : " + e.getMessage()); | |
| 72 | + } | |
| 73 | + return result; | |
| 74 | + } | |
| 75 | + | |
| 76 | + /** | |
| 77 | + * 获取当前前一天的时间戳 | |
| 78 | + * | |
| 79 | + * @return | |
| 80 | + */ | |
| 81 | + public static String getTimestamp() { | |
| 82 | + DateFormat df = new SimpleDateFormat("yyyyMMdd"); | |
| 83 | + Date date = null; | |
| 84 | + try { | |
| 85 | + Calendar calendar = Calendar.getInstance(); | |
| 86 | + calendar.add(Calendar.DATE, +1); | |
| 87 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); | |
| 88 | + String motoday = sdf.format(calendar.getTime()); | |
| 89 | + date = df.parse(motoday); | |
| 90 | + } catch (ParseException e) { | |
| 91 | + e.printStackTrace(); | |
| 92 | + } | |
| 93 | + Calendar cal = Calendar.getInstance(); | |
| 94 | + cal.setTime(date); | |
| 95 | + long timestamp = cal.getTimeInMillis(); | |
| 96 | + System.out.println("------timestamp-----" + timestamp); | |
| 97 | + return String.valueOf(timestamp); | |
| 98 | + | |
| 99 | + } | |
| 100 | + | |
| 101 | + /** | |
| 102 | + * 签名算法:signature 字符串格式,由三部分组成:GET+”\n”+Expire+”\n”+Resource 2016 0602171212 | |
| 103 | + * | |
| 104 | + * @return | |
| 105 | + * @throws UnsupportedEncodingException | |
| 106 | + */ | |
| 107 | + public static String signature(String streamName) throws UnsupportedEncodingException { | |
| 108 | + | |
| 109 | + String method = "GET"; | |
| 110 | + String expire = BaseUtil.getTimestamp(); | |
| 111 | + String app = "live"; | |
| 112 | + String methodadd = "add"; | |
| 113 | + String name = streamName; | |
| 114 | + app = java.net.URLEncoder.encode(app, "utf-8"); | |
| 115 | + methodadd = java.net.URLEncoder.encode(methodadd, "utf-8"); | |
| 116 | + name = java.net.URLEncoder.encode(name, "utf-8"); | |
| 117 | + System.out.println(expire + "---expire----"); | |
| 118 | + String Resource = "app=" + app + "&method=" + methodadd + "&name=" + name; | |
| 119 | + // Resource = java.net.URLEncoder.encode(Resource, "utf-8"); | |
| 120 | + String stringToSign = method + "\n" + expire + "\n" + Resource; | |
| 121 | + System.out.println("--stringToSign--" + stringToSign); | |
| 122 | + // 2.计算 HMAC-SHA1 | |
| 123 | + String signature = HMACSha1(stringToSign, SECRET_KEY); | |
| 124 | + System.out.println("---signature---" + signature); | |
| 125 | + signature = java.net.URLEncoder.encode(signature, "utf-8"); | |
| 126 | + return signature; | |
| 127 | + } | |
| 128 | + | |
| 129 | + public static String signature(String methodName, String streamName) throws UnsupportedEncodingException { | |
| 130 | + | |
| 131 | + String method = "GET"; | |
| 132 | + String expire = BaseUtil.getTimestamp(); | |
| 133 | + String app = "live"; | |
| 134 | + app = java.net.URLEncoder.encode(app, "utf-8"); | |
| 135 | + methodName = java.net.URLEncoder.encode(methodName, "utf-8"); | |
| 136 | + streamName = java.net.URLEncoder.encode(streamName, "utf-8"); | |
| 137 | + System.out.println(expire + "---expire----"); | |
| 138 | + String Resource = "app=" + app + "&method=" + methodName + "&name=" + streamName; | |
| 139 | + // Resource = java.net.URLEncoder.encode(Resource, "utf-8"); | |
| 140 | + String stringToSign = method + "\n" + expire + "\n" + Resource; | |
| 141 | + System.out.println("--stringToSign--" + stringToSign); | |
| 142 | + // 2.计算 HMAC-SHA1 | |
| 143 | + String signature = HMACSha1(stringToSign, SECRET_KEY); | |
| 144 | + System.out.println("---signature---" + signature); | |
| 145 | + signature = java.net.URLEncoder.encode(signature, "utf-8"); | |
| 146 | + return signature; | |
| 147 | + } | |
| 148 | + | |
| 149 | + public static String UUid() { | |
| 150 | + | |
| 151 | + String uuid = UUID.randomUUID().toString(); | |
| 152 | + uuid = uuid.replaceAll("-", ""); | |
| 153 | + return uuid; | |
| 154 | + } | |
| 155 | + | |
| 156 | + public static String getAccessKey() { | |
| 157 | + return ACCESS_KEY; | |
| 158 | + } | |
| 159 | + | |
| 160 | + public static int random_7(int number) { | |
| 161 | + int x = (int) (Math.random() * 10); | |
| 162 | + for (int i = 0; i < number; i++) { | |
| 163 | + String num = Math.random() * 10 + ""; | |
| 164 | + } | |
| 165 | + return x; | |
| 166 | + } | |
| 167 | + | |
| 168 | + /* | |
| 169 | + * 等同于javaScript中的 new Date().toUTCString(); | |
| 170 | + */ | |
| 171 | + public static String toGMTString(Date date) { | |
| 172 | + SimpleDateFormat df = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z", Locale.UK); | |
| 173 | + df.setTimeZone(new java.util.SimpleTimeZone(0, "GMT")); | |
| 174 | + return df.format(date); | |
| 175 | + } | |
| 176 | + | |
| 177 | + /* | |
| 178 | + * 发送POST请求 | |
| 179 | + */ | |
| 180 | + public static String sendPost(String url, String body, String ak_id, String ak_secret) { | |
| 181 | + PrintWriter out = null; | |
| 182 | + BufferedReader in = null; | |
| 183 | + String result = ""; | |
| 184 | + try { | |
| 185 | + URL realUrl = new URL(url); | |
| 186 | + | |
| 187 | + /* | |
| 188 | + * http header 参数 | |
| 189 | + */ | |
| 190 | + String method = "POST"; | |
| 191 | + String accept = "json"; | |
| 192 | + String content_type = "application/json"; | |
| 193 | + String path = realUrl.getFile(); | |
| 194 | + String date = toGMTString(new Date()); | |
| 195 | + | |
| 196 | + // 1.对body做MD5+BASE64加密 | |
| 197 | + String bodyMd5 = MD5Base64(body); | |
| 198 | + String stringToSign = method + "\n" + accept + "\n" + bodyMd5 + "\n" + content_type + "\n" + date + "\n" | |
| 199 | + + path; | |
| 200 | + // 2.计算 HMAC-SHA1 | |
| 201 | + String signature = HMACSha1(stringToSign, ak_secret); | |
| 202 | + // 3.得到 authorization header | |
| 203 | + String authHeader = "Dataplus " + ak_id + ":" + signature; | |
| 204 | + | |
| 205 | + // 打开和URL之间的连接 | |
| 206 | + URLConnection conn = realUrl.openConnection(); | |
| 207 | + // 设置通用的请求属性 | |
| 208 | + conn.setRequestProperty("accept", accept); | |
| 209 | + conn.setRequestProperty("content-type", content_type); | |
| 210 | + conn.setRequestProperty("date", date); | |
| 211 | + conn.setRequestProperty("Authorization", authHeader); | |
| 212 | + // 发送POST请求必须设置如下两行 | |
| 213 | + conn.setDoOutput(true); | |
| 214 | + conn.setDoInput(true); | |
| 215 | + // 获取URLConnection对象对应的输出流 | |
| 216 | + out = new PrintWriter(conn.getOutputStream()); | |
| 217 | + // 发送请求参数 | |
| 218 | + out.print(body); | |
| 219 | + // flush输出流的缓冲 | |
| 220 | + out.flush(); | |
| 221 | + // 定义BufferedReader输入流来读取URL的响应 | |
| 222 | + in = new BufferedReader(new InputStreamReader(conn.getInputStream())); | |
| 223 | + String line; | |
| 224 | + while ((line = in.readLine()) != null) { | |
| 225 | + result += line; | |
| 226 | + } | |
| 227 | + } catch (Exception e) { | |
| 228 | + System.out.println("发送 POST 请求出现异常!" + e); | |
| 229 | + e.printStackTrace(); | |
| 230 | + } | |
| 231 | + // 使用finally块来关闭输出流、输入流 | |
| 232 | + finally { | |
| 233 | + try { | |
| 234 | + if (out != null) { | |
| 235 | + out.close(); | |
| 236 | + } | |
| 237 | + if (in != null) { | |
| 238 | + in.close(); | |
| 239 | + } | |
| 240 | + } catch (IOException ex) { | |
| 241 | + ex.printStackTrace(); | |
| 242 | + } | |
| 243 | + } | |
| 244 | + return result; | |
| 245 | + } | |
| 246 | + | |
| 247 | + /* | |
| 248 | + * GET请求 | |
| 249 | + */ | |
| 250 | + | |
| 251 | + public static String sendGet(String url, String ak_id, String ak_secret) { | |
| 252 | + String result = ""; | |
| 253 | + BufferedReader in = null; | |
| 254 | + try { | |
| 255 | + URL realUrl = new URL(url); | |
| 256 | + /* | |
| 257 | + * http header 参数 | |
| 258 | + */ | |
| 259 | + // String method = "GET"; | |
| 260 | + // String Expire = "1436976000"; | |
| 261 | + // String Resource = | |
| 262 | + // "nonce=4e1f2519c626cbfbab1520c255830c26&public=0&vdoid=12345"; | |
| 263 | + // String content_type = "application/json"; | |
| 264 | + // String path = realUrl.getFile(); | |
| 265 | + // String date = toGMTString(new Date()); | |
| 266 | + // // 1.对body做MD5+BASE64加密 | |
| 267 | + // // String bodyMd5 = MD5Base64(body); | |
| 268 | + // String stringToSign = method + "\n" + Expire + "\n" + Resource; | |
| 269 | + // // 2.计算 HMAC-SHA1 | |
| 270 | + // String signature = HMACSha1(stringToSign, ak_secret); | |
| 271 | + // // 3.得到 authorization header | |
| 272 | + // String authHeader = "Dataplus " + ak_id + ":" + signature; | |
| 273 | + // 打开和URL之间的连接 | |
| 274 | + URLConnection connection = realUrl.openConnection(); | |
| 275 | + // 设置通用的请求属性 | |
| 276 | + // connection.setRequestProperty("accept", "json"); | |
| 277 | + // connection.setRequestProperty("content-type", content_type); | |
| 278 | + // connection.setRequestProperty("date", date); | |
| 279 | + // connection.setRequestProperty("Authorization", authHeader); | |
| 280 | + // 建立实际的连接 | |
| 281 | + connection.connect(); | |
| 282 | + // 定义 BufferedReader输入流来读取URL的响应 | |
| 283 | + in = new BufferedReader(new InputStreamReader(connection.getInputStream())); | |
| 284 | + String line; | |
| 285 | + while ((line = in.readLine()) != null) { | |
| 286 | + result += line; | |
| 287 | + } | |
| 288 | + } catch (Exception e) { | |
| 289 | + System.out.println("发送GET请求出现异常!" + e); | |
| 290 | + e.printStackTrace(); | |
| 291 | + } | |
| 292 | + // 使用finally块来关闭输入流 | |
| 293 | + finally { | |
| 294 | + try { | |
| 295 | + if (in != null) { | |
| 296 | + in.close(); | |
| 297 | + } | |
| 298 | + } catch (Exception e) { | |
| 299 | + e.printStackTrace(); | |
| 300 | + } | |
| 301 | + } | |
| 302 | + return result; | |
| 303 | + } | |
| 304 | + | |
| 305 | + public static void main(String[] args) throws Exception { | |
| 306 | + // 发送POST请求示例 | |
| 307 | + /* | |
| 308 | + * String ak_id = "fWUN8KDtJZJGo0ArQ4qo"; // 用户ak String ak_secret = | |
| 309 | + * "UIWPYVeaV8kq2vWImDkLBvWs/pwmTJVF9MCNHDsC"; // 用户ak_secret String url | |
| 310 | + * = "https://kmr-cn-beijing.ksyun.com"; String body = | |
| 311 | + * "{\"param1\": \"GET\n1436976000\nnonce=4e1f2519c626cbfbab1520c255830c26&public=0&vdoid=12345\", \"param2\":\"fWUN8KDtJZJGo0ArQ4qo\"}" | |
| 312 | + * ; System.out.println("response body:" + sendPost(url, body, AK_ID, | |
| 313 | + * AK_SECRET)); | |
| 314 | + */ | |
| 315 | + | |
| 316 | + Date date = new Date(); | |
| 317 | + System.out.println(toGMTString(date)); | |
| 318 | + String hh = HMACSha1("GET\n1436976124\nnonce=4e1f2519c626cbfbab1520c255830c26&public=1&vdoid=1", | |
| 319 | + "fWUN8KDtJZJGo0ArQ4qo"); | |
| 320 | + String hhhh = MD5Base64(hh); | |
| 321 | + System.out.println(hh); | |
| 322 | + System.out.println(".............."); | |
| 323 | + | |
| 324 | + // String str = signature(); | |
| 325 | + // System.out.println(str);//L2muBoImPzyvwyzfBtGXEu+wRNE= | |
| 326 | + | |
| 327 | + // 发送GET请求 | |
| 328 | + String url1 = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=iDPKaesXXW3A26CScNyjpNkzxZs%3D&accesskey=I3TC8a4xboPUMe5xlp22&expire=1483200000&app=live&method=add&stream=310166_863"; | |
| 329 | + System.out.println("response body:" + sendGet(url1, ACCESS_KEY, SECRET_KEY)); | |
| 330 | + | |
| 331 | + // long d = getTimestamp(); | |
| 332 | + // System.out.println(d); | |
| 333 | + | |
| 334 | + // String str = signature(); | |
| 335 | + // System.out.println(str);//L2muBoImPzyvwyzfBtGXEu+wRNE= | |
| 336 | + /* | |
| 337 | + * // 发送GET请求 String ak_id1 = "fWUN8KDtJZJGo0ArQ4qo"; //用户ak String | |
| 338 | + * ak_secret1 = "UIWPYVeaV8kq2vWImDkLBvWs/pwmTJVF9MCNHDsC"; // | |
| 339 | + * 用户ak_secret String url1 = | |
| 340 | + * "http://cnlive.uplive.ks-cdn.com?signature=L2muBoImPzyvwyzfBtGXEu+wRNE=&accesskey=fWUN8KDtJZJGo0ArQ4qo&expire=1436976000&method=add&app=live&name=498122_57"; | |
| 341 | + * System.out.println("response body:" +sendGet(url1, ak_id1, | |
| 342 | + * ak_secret1)); | |
| 343 | + */ | |
| 344 | + // long d = getTimestamp(); | |
| 345 | + // System.out.println(d); | |
| 346 | + | |
| 347 | + } | |
| 348 | +} | ... | ... |
src/main/java/com/cnlive/mz/live/servlet/InitServlet.java
0 → 100644
| 1 | +package com.cnlive.mz.live.servlet; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | + | |
| 5 | +import javax.servlet.Servlet; | |
| 6 | +import javax.servlet.ServletConfig; | |
| 7 | +import javax.servlet.ServletException; | |
| 8 | +import javax.servlet.annotation.WebServlet; | |
| 9 | +import javax.servlet.http.HttpServlet; | |
| 10 | +import javax.servlet.http.HttpServletRequest; | |
| 11 | +import javax.servlet.http.HttpServletResponse; | |
| 12 | + | |
| 13 | +import com.cnlive.socket.SocketServer; | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * Servlet implementation class InitServlet | |
| 17 | + */ | |
| 18 | +@WebServlet(name = "initServlet", urlPatterns = { "/initServlet" }) | |
| 19 | +public class InitServlet extends HttpServlet { | |
| 20 | + private static final long serialVersionUID = 1L; | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * @see HttpServlet#HttpServlet() | |
| 24 | + */ | |
| 25 | + public InitServlet() { | |
| 26 | + super(); | |
| 27 | + // TODO Auto-generated constructor stub | |
| 28 | + } | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * @see Servlet#init(ServletConfig) | |
| 32 | + */ | |
| 33 | + public void init(ServletConfig config) throws ServletException { | |
| 34 | + System.out.println("kaishi.......init"); | |
| 35 | + int port = 65432; | |
| 36 | + SocketServer server = new SocketServer(port); | |
| 37 | + server.start(); | |
| 38 | + } | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) | |
| 42 | + */ | |
| 43 | + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | |
| 44 | + // TODO Auto-generated method stub | |
| 45 | + response.getWriter().append("Served at: ").append(request.getContextPath()); | |
| 46 | + } | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) | |
| 50 | + */ | |
| 51 | + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | |
| 52 | + // TODO Auto-generated method stub | |
| 53 | + doGet(request, response); | |
| 54 | + } | |
| 55 | + | |
| 56 | +} | ... | ... |
src/main/java/com/cnlive/socket/SocketServer.java
0 → 100644
| 1 | +package com.cnlive.socket; | |
| 2 | + | |
| 3 | +import java.io.BufferedReader; | |
| 4 | +import java.io.IOException; | |
| 5 | +import java.io.InputStream; | |
| 6 | +import java.io.InputStreamReader; | |
| 7 | +import java.io.ObjectInputStream; | |
| 8 | +import java.io.ObjectOutputStream; | |
| 9 | +import java.io.OutputStream; | |
| 10 | +import java.net.ServerSocket; | |
| 11 | +import java.net.Socket; | |
| 12 | +import java.util.concurrent.ConcurrentHashMap; | |
| 13 | + | |
| 14 | +public class SocketServer { | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * 要处理客户端发来的对象,并返回一个对象,可实现该接口。 | |
| 18 | + */ | |
| 19 | + public interface ObjectAction{ | |
| 20 | + Object doAction(Object rev); | |
| 21 | + } | |
| 22 | + | |
| 23 | + /*public static final class DefaultObjectAction implements ObjectAction{ | |
| 24 | + public Object doAction(Object rev) { | |
| 25 | + System.out.println("处理并返回:"+rev); | |
| 26 | + return rev; | |
| 27 | + } | |
| 28 | + } */ | |
| 29 | + | |
| 30 | + public static void main(String[] args) { | |
| 31 | + int port = 65432; | |
| 32 | + SocketServer server = new SocketServer(port); | |
| 33 | + server.start(); | |
| 34 | + } | |
| 35 | + | |
| 36 | + private int port; | |
| 37 | + private volatile boolean running=false; | |
| 38 | + private long receiveTimeDelay=7000; | |
| 39 | + private ConcurrentHashMap<Class, ObjectAction> actionMapping = new ConcurrentHashMap<Class,ObjectAction>(); | |
| 40 | + private Thread connWatchDog; | |
| 41 | + | |
| 42 | + public SocketServer(int port) { | |
| 43 | + this.port = port; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public void start(){ | |
| 47 | + if(running)return; | |
| 48 | + running=true; | |
| 49 | + connWatchDog = new Thread(new ConnWatchDog()); | |
| 50 | + connWatchDog.start(); | |
| 51 | + } | |
| 52 | + | |
| 53 | + @SuppressWarnings("deprecation") | |
| 54 | + public void stop(){ | |
| 55 | + if(running)running=false; | |
| 56 | + if(connWatchDog!=null)connWatchDog.stop(); | |
| 57 | + } | |
| 58 | + | |
| 59 | + public void addActionMap(Class<Object> cls,ObjectAction action){ | |
| 60 | + actionMapping.put(cls, action); | |
| 61 | + } | |
| 62 | + | |
| 63 | + class ConnWatchDog implements Runnable{ | |
| 64 | + public void run(){ | |
| 65 | + try { | |
| 66 | + ServerSocket ss = new ServerSocket(port,5); | |
| 67 | + while(running){ | |
| 68 | + System.out.println("等待客服端。。。"); | |
| 69 | + Socket s = ss.accept(); | |
| 70 | + new Thread(new SocketAction(s)).start(); | |
| 71 | + } | |
| 72 | + } catch (IOException e) { | |
| 73 | + e.printStackTrace(); | |
| 74 | + SocketServer.this.stop(); | |
| 75 | + } | |
| 76 | + | |
| 77 | + } | |
| 78 | + } | |
| 79 | + | |
| 80 | + class SocketAction implements Runnable{ | |
| 81 | + Socket s; | |
| 82 | + boolean run=true; | |
| 83 | + long lastReceiveTime = System.currentTimeMillis(); | |
| 84 | + public SocketAction(Socket s) { | |
| 85 | + this.s = s; | |
| 86 | + } | |
| 87 | + public void run() { | |
| 88 | + while(running && run){ | |
| 89 | + try { | |
| 90 | + Thread.sleep(3000); | |
| 91 | + } catch (InterruptedException e1) { | |
| 92 | + // TODO Auto-generated catch block | |
| 93 | + e1.printStackTrace(); | |
| 94 | + } | |
| 95 | + try { | |
| 96 | + InputStream in = s.getInputStream(); | |
| 97 | + OutputStream out = s.getOutputStream(); | |
| 98 | + byte[] recData = null; | |
| 99 | + while(true) { | |
| 100 | + recData = new byte[1024]; | |
| 101 | + int r = in.read(recData); | |
| 102 | + if(r>-1) { | |
| 103 | + String data = new String(recData); | |
| 104 | + /* if(data.trim().equals("over")) { | |
| 105 | + s.close(); | |
| 106 | + break; | |
| 107 | + }*/ | |
| 108 | + System.out.println("读取到客户端发送的来数据:"+data); | |
| 109 | + } | |
| 110 | + } | |
| 111 | + /* if(in.available()>0){ | |
| 112 | + BufferedReader br = new BufferedReader(new InputStreamReader(in)); | |
| 113 | + //out = new PrintWriter(socket.getOutputStream(), true); | |
| 114 | + String line = br.readLine(); | |
| 115 | + System.out.println("you input is : " + line); | |
| 116 | + //out.println("you input is :" + line); | |
| 117 | + //out.close(); | |
| 118 | + // in.close(); | |
| 119 | + }*/ | |
| 120 | + /*ObjectInputStream ois = new ObjectInputStream(in); | |
| 121 | + Object obj = ois.readObject(); | |
| 122 | + lastReceiveTime = System.currentTimeMillis(); | |
| 123 | + System.out.println("接收:\t"+obj); | |
| 124 | + ObjectAction oa = actionMapping.get(obj.getClass()); | |
| 125 | + oa = oa==null?new DefaultObjectAction():oa; | |
| 126 | + Object out = oa.doAction(obj); | |
| 127 | + if(out!=null){ | |
| 128 | + ObjectOutputStream oos = new ObjectOutputStream(s.getOutputStream()); | |
| 129 | + oos.writeObject(out); | |
| 130 | + oos.flush(); | |
| 131 | + } */ | |
| 132 | + } catch (Exception e) { | |
| 133 | + System.out.println(System.currentTimeMillis()-lastReceiveTime); | |
| 134 | + e.printStackTrace(); | |
| 135 | + overThis(); | |
| 136 | + } | |
| 137 | + } | |
| 138 | + } | |
| 139 | + | |
| 140 | + private void overThis() { | |
| 141 | + if(run)run=false; | |
| 142 | + if(s!=null){ | |
| 143 | + try { | |
| 144 | + s.close(); | |
| 145 | + } catch (IOException e) { | |
| 146 | + e.printStackTrace(); | |
| 147 | + } | |
| 148 | + } | |
| 149 | + System.out.println("关闭:"+s.getRemoteSocketAddress()); | |
| 150 | + } | |
| 151 | + | |
| 152 | + } | |
| 153 | +} | ... | ... |
src/main/resources/log4j.properties
| 1 | -log4j.rootLogger=INFO,console,file,action,content,video,httpreq | |
| 2 | -#Console | |
| 3 | -log4j.appender.console.Target=System.out | |
| 4 | -log4j.appender.console=org.apache.log4j.ConsoleAppender | |
| 5 | -log4j.appender.console.layout=org.apache.log4j.PatternLayout | |
| 6 | -log4j.appender.console.layout.ConversionPattern=%m%n | |
| 7 | - | |
| 8 | - | |
| 9 | -log4j.appender.file=org.apache.log4j.DailyRollingFileAppender | |
| 10 | -log4j.appender.file.File=${catalina.home}/logs/cnlive_live_web/log | |
| 11 | -log4j.appender.file.DatePattern='_'yyyyMMdd | |
| 12 | -log4j.appender.file.encoding=UTF-8 | |
| 13 | -log4j.appender.file.layout=org.apache.log4j.PatternLayout | |
| 14 | -log4j.appender.file.layout.ConversionPattern=%d{HH:mm:ss,SSS} %p %c (%L) - %m%n | |
| 15 | - | |
| 16 | -#log4j.logger.org.apache=ERROR | |
| 17 | -log4j.logger.org.smart4j=DEBUG | |
| 18 | - | |
| 19 | - | |
| 20 | -#action | |
| 21 | - | |
| 22 | -log4j.appender.action=org.apache.log4j.DailyRollingFileAppender | |
| 23 | -log4j.appender.action.File=${catalina.home}/logs/action.log | |
| 24 | -log4j.appender.action.layout=org.apache.log4j.PatternLayout | |
| 25 | -log4j.appender.action.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | |
| 26 | -log4j.appender.action.DatePattern='.'yyyy-MM-dd | |
| 27 | -log4j.appender.action.Encoding=UTF-8 | |
| 28 | - | |
| 29 | -#content | |
| 30 | -log4j.appender.content=org.apache.log4j.DailyRollingFileAppender | |
| 31 | -log4j.appender.content.File=${catalina.home}/logs/content.log | |
| 32 | -log4j.appender.content.layout=org.apache.log4j.PatternLayout | |
| 33 | -log4j.appender.content.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | |
| 34 | -log4j.appender.content.DatePattern='.'yyyy-MM-dd | |
| 35 | -log4j.appender.content.Encoding=UTF-8 | |
| 36 | - | |
| 37 | - | |
| 38 | - | |
| 39 | -#video | |
| 40 | -log4j.appender.video=org.apache.log4j.DailyRollingFileAppender | |
| 41 | -log4j.appender.video.File=${catalina.home}/logs/video.log | |
| 42 | -log4j.appender.video.layout=org.apache.log4j.PatternLayout | |
| 43 | -log4j.appender.video.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | |
| 44 | -log4j.appender.video.DatePattern='.'yyyy-MM-dd | |
| 45 | -log4j.appender.video.Encoding=UTF-8 | |
| 46 | - | |
| 47 | - | |
| 48 | - | |
| 49 | -#httpreq | |
| 50 | -log4j.appender.httpreq=org.apache.log4j.DailyRollingFileAppender | |
| 51 | -log4j.appender.httpreq.File=${catalina.home}/logs/httpreq.log | |
| 52 | -log4j.appender.httpreq.layout=org.apache.log4j.PatternLayout | |
| 53 | -log4j.appender.httpreq.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | |
| 54 | -log4j.appender.httpreq.DatePattern='.'yyyy-MM-dd | |
| 55 | -log4j.appender.httpreq.Encoding=UTF-8 | |
| 56 | - | |
| 57 | - | |
| 58 | -#log4j.logger.com.ksyun.ks3=DEBUG,stdout | |
| 59 | -#log4j.logger.org.apache.http=DEBUG,stdout | |
| 60 | -#log4j.logger.org.apache.http.wire=ERROR,stdout | |
| 61 | - | |
| 62 | -#log4j.addivity.org.apache=true | |
| 63 | -#log4j.appender.stdout=org.apache.log4j.ConsoleAppender | |
| 64 | -#log4j.appender.stdout.Target=System.out | |
| 65 | -#log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | |
| 1 | +log4j.rootLogger=INFO,console,file,action,content,video,httpreq | |
| 2 | +#Console | |
| 3 | +log4j.appender.console.Target=System.out | |
| 4 | +log4j.appender.console=org.apache.log4j.ConsoleAppender | |
| 5 | +log4j.appender.console.layout=org.apache.log4j.PatternLayout | |
| 6 | +log4j.appender.console.layout.ConversionPattern=%m%n | |
| 7 | + | |
| 8 | + | |
| 9 | +log4j.appender.file=org.apache.log4j.DailyRollingFileAppender | |
| 10 | +log4j.appender.file.File=${catalina.home}/logs/cnlive_live_web/log | |
| 11 | +log4j.appender.file.DatePattern='_'yyyyMMdd | |
| 12 | +log4j.appender.file.encoding=UTF-8 | |
| 13 | +log4j.appender.file.layout=org.apache.log4j.PatternLayout | |
| 14 | +log4j.appender.file.layout.ConversionPattern=%d{HH:mm:ss,SSS} %p %c (%L) - %m%n | |
| 15 | + | |
| 16 | +#log4j.logger.org.apache=ERROR | |
| 17 | +log4j.logger.org.smart4j=DEBUG | |
| 18 | + | |
| 19 | + | |
| 20 | +#action | |
| 21 | + | |
| 22 | +log4j.appender.action=org.apache.log4j.DailyRollingFileAppender | |
| 23 | +log4j.appender.action.File=${catalina.home}/logs/action.log | |
| 24 | +log4j.appender.action.layout=org.apache.log4j.PatternLayout | |
| 25 | +log4j.appender.action.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | |
| 26 | +log4j.appender.action.DatePattern='.'yyyy-MM-dd | |
| 27 | +log4j.appender.action.Encoding=UTF-8 | |
| 28 | + | |
| 29 | +#content | |
| 30 | +log4j.appender.content=org.apache.log4j.DailyRollingFileAppender | |
| 31 | +log4j.appender.content.File=${catalina.home}/logs/content.log | |
| 32 | +log4j.appender.content.layout=org.apache.log4j.PatternLayout | |
| 33 | +log4j.appender.content.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | |
| 34 | +log4j.appender.content.DatePattern='.'yyyy-MM-dd | |
| 35 | +log4j.appender.content.Encoding=UTF-8 | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | +#video | |
| 40 | +log4j.appender.video=org.apache.log4j.DailyRollingFileAppender | |
| 41 | +log4j.appender.video.File=${catalina.home}/logs/video.log | |
| 42 | +log4j.appender.video.layout=org.apache.log4j.PatternLayout | |
| 43 | +log4j.appender.video.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | |
| 44 | +log4j.appender.video.DatePattern='.'yyyy-MM-dd | |
| 45 | +log4j.appender.video.Encoding=UTF-8 | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | +#httpreq | |
| 50 | +log4j.appender.httpreq=org.apache.log4j.DailyRollingFileAppender | |
| 51 | +log4j.appender.httpreq.File=${catalina.home}/logs/httpreq.log | |
| 52 | +log4j.appender.httpreq.layout=org.apache.log4j.PatternLayout | |
| 53 | +log4j.appender.httpreq.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | |
| 54 | +log4j.appender.httpreq.DatePattern='.'yyyy-MM-dd | |
| 55 | +log4j.appender.httpreq.Encoding=UTF-8 | |
| 56 | + | |
| 57 | + | |
| 58 | +#log4j.logger.com.ksyun.ks3=DEBUG,stdout | |
| 59 | +#log4j.logger.org.apache.http=DEBUG,stdout | |
| 60 | +#log4j.logger.org.apache.http.wire=ERROR,stdout | |
| 61 | + | |
| 62 | +#log4j.addivity.org.apache=true | |
| 63 | +#log4j.appender.stdout=org.apache.log4j.ConsoleAppender | |
| 64 | +#log4j.appender.stdout.Target=System.out | |
| 65 | +#log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | |
| 66 | 66 | #log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS} %-5p [%t]%C{1}.%M(%L) - %m%n |
| 67 | 67 | \ No newline at end of file | ... | ... |
src/main/resources/smart.properties
| 1 | -smart.framework.app.base_package=com.cnlive.mz.live | |
| 2 | -smart.framework.app.home_page=/index | |
| 3 | -smart.framework.app.www_path=/static/ | |
| 4 | -smart.framework.app.jsp_path=/pages/ | |
| 5 | -smart.framework.custom.ds_factory=org.smart4j.plugin.dbcp.DbcpDataSourceFactory | |
| 6 | - | |
| 7 | - | |
| 8 | -smart.framework.jdbc.type=mysql | |
| 9 | -smart.framework.jdbc.driver=com.mysql.jdbc.Driver | |
| 10 | -#smart.framework.jdbc.url=jdbc:mysql://124.193.218.90:3306/cnlive_live?autoReconnect=true&failOverReadOnly=false | |
| 11 | -#smart.framework.jdbc.username=cnlive_oa | |
| 12 | -#smart.framework.jdbc.password=H8rf#_3@ccx9( | |
| 13 | - | |
| 14 | -smart.framework.jdbc.url=jdbc:mysql://123.59.27.186:23306/cnlive_live?autoReconnect=true&failOverReadOnly=false | |
| 15 | -smart.framework.jdbc.username=ugc | |
| 16 | -smart.framework.jdbc.password=liujicheng@cnlive.COM | |
| 17 | - | |
| 18 | - | |
| 19 | -#smart.framework.jdbc.url=jdbc:mysql://localhost:3306/cnlive_live?autoReconnect=true&failOverReadOnly=false | |
| 20 | -#smart.framework.jdbc.username=root | |
| 21 | -#smart.framework.jdbc.password=root | |
| 22 | - | |
| 23 | -# | |
| 24 | -smart.plugin.i18n.reloadable=true | |
| 25 | -smart.plugin.rest.log=true | |
| 26 | -smart.plugin.rest.jsonp=true | |
| 27 | -smart.plugin.rest.jsonp.function=callback | |
| 28 | - | |
| 29 | -#smart.plugin.security.realms=custom | |
| 30 | -#smart.plugin.security.custom.class=org.smart4j.sample.CustomSmartSecurity | |
| 31 | -#smart.plugin.security.cacheable=true | |
| 32 | - | |
| 33 | -sample.upload_path=/www/upload/ | |
| 34 | - | |
| 35 | -mail.template_path=D:/apache-tomcat-7.0.61/webapps/cnlive_live_web/pages/mail.html | |
| 36 | -website.url=http://localhost:8080/cnlive_live_web/ | |
| 37 | -auth.enable=true | |
| 38 | -auth.login.url=http://sso.staff.cnlive.com/CnliveSSO/login?from=mam-live&callbackUrl= | |
| 39 | -auth.logout.url=http://sso.staff.cnlive.com/CnliveSSO/logOut?from=mam-live&callbackUrl= | |
| 40 | -auth.userinfo.url=http://sso.staff.cnlive.com/CnliveSSO/getUserInfo?username= | |
| 41 | - | |
| 1 | +smart.framework.app.base_package=com.cnlive.mz.live | |
| 2 | +smart.framework.app.home_page=/index | |
| 3 | +smart.framework.app.www_path=/static/ | |
| 4 | +smart.framework.app.jsp_path=/pages/ | |
| 5 | +smart.framework.custom.ds_factory=org.smart4j.plugin.dbcp.DbcpDataSourceFactory | |
| 6 | + | |
| 7 | + | |
| 8 | +smart.framework.jdbc.type=mysql | |
| 9 | +smart.framework.jdbc.driver=com.mysql.jdbc.Driver | |
| 10 | +#smart.framework.jdbc.url=jdbc:mysql://124.193.218.90:3306/cnlive_live?autoReconnect=true&failOverReadOnly=false | |
| 11 | +#smart.framework.jdbc.username=cnlive_oa | |
| 12 | +#smart.framework.jdbc.password=H8rf#_3@ccx9( | |
| 13 | + | |
| 14 | +smart.framework.jdbc.url=jdbc:mysql://123.59.27.186:23306/cnlive_live?autoReconnect=true&failOverReadOnly=false | |
| 15 | +smart.framework.jdbc.username=ugc | |
| 16 | +smart.framework.jdbc.password=liujicheng@cnlive.COM | |
| 17 | + | |
| 18 | + | |
| 19 | +#smart.framework.jdbc.url=jdbc:mysql://localhost:3306/cnlive_live?autoReconnect=true&failOverReadOnly=false | |
| 20 | +#smart.framework.jdbc.username=root | |
| 21 | +#smart.framework.jdbc.password=root | |
| 22 | + | |
| 23 | +# | |
| 24 | +smart.plugin.i18n.reloadable=true | |
| 25 | +smart.plugin.rest.log=true | |
| 26 | +smart.plugin.rest.jsonp=true | |
| 27 | +smart.plugin.rest.jsonp.function=callback | |
| 28 | + | |
| 29 | +#smart.plugin.security.realms=custom | |
| 30 | +#smart.plugin.security.custom.class=org.smart4j.sample.CustomSmartSecurity | |
| 31 | +#smart.plugin.security.cacheable=true | |
| 32 | + | |
| 33 | +sample.upload_path=/www/upload/ | |
| 34 | + | |
| 35 | +mail.template_path=D:/apache-tomcat-7.0.61/webapps/cnlive_live_web/pages/mail.html | |
| 36 | +website.url=http://localhost:8080/cnlive_live_web/ | |
| 37 | +auth.enable=true | |
| 38 | +auth.login.url=http://sso.staff.cnlive.com/CnliveSSO/login?from=mam-live&callbackUrl= | |
| 39 | +auth.logout.url=http://sso.staff.cnlive.com/CnliveSSO/logOut?from=mam-live&callbackUrl= | |
| 40 | +auth.userinfo.url=http://sso.staff.cnlive.com/CnliveSSO/getUserInfo?username= | |
| 41 | + | |
| 42 | 42 | |
| 43 | 43 | \ No newline at end of file | ... | ... |
src/main/resources/stream-config.properties
0 → 100644
| 1 | +# file stored repository (Chinese words need ASCII, help tool @http://tool.oschina.net/encode?type=3) | |
| 2 | +STREAM_FILE_REPOSITORY= | |
| 3 | + | |
| 4 | +# when the file has uploaded, whether delete it. | |
| 5 | +STREAM_DELETE_FINISH=false | |
| 6 | + | |
| 7 | +# this server whether allow other different domain[s] upload file to this server | |
| 8 | +STREAM_IS_CROSS=false | |
| 9 | + | |
| 10 | +# allowed domain (PS: flash method need modifying the `crossdomain.xml`) | |
| 11 | +STREAM_CROSS_ORIGIN=* | |
| 12 | + | |
| 13 | +# when Browser @http:www.A.com, the file will upload to @STREAM_CROSS_SERVER | |
| 14 | +STREAM_CROSS_SERVER=http://customers.duapp.com | ... | ... |
src/main/webapp/WEB-INF/tags/pager3.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_pager(1);" data-pn="1">|第一页</button> | |
| 19 | + <button class="btn btn-xs btn-danger" type="button" onclick="next_pager(${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 | + <span class="green middle bolder">${pageNumber}/${totalPage}</span> | |
| 27 | + <c:choose> | |
| 28 | + <c:when test="${pageNumber < totalPage}"> | |
| 29 | + <button class="btn btn-xs btn-danger" type="button" onclick="next_pager(${pageNumber + 1});" data-pn="${pageNumber + 1}">下一页></button> | |
| 30 | + <button class="btn btn-xs btn-danger" type="button" onclick="next_pager(${totalPage});" data-pn="${totalPage}">最后一页>|</button> | |
| 31 | + </c:when> | |
| 32 | + <c:otherwise> | |
| 33 | + <button class="btn btn-xs btn-danger" type="button" disabled>下一页></button> | |
| 34 | + <button class="btn btn-xs btn-danger" type="button" disabled>最后一页>|</button> | |
| 35 | + </c:otherwise> | |
| 36 | + </c:choose> | |
| 37 | + <span class="green middle bolder">总记录数:${totalRecord}</span> | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + </div> | |
| 41 | +</div> | |
| 0 | 42 | \ No newline at end of file | ... | ... |
src/main/webapp/WEB-INF/web.xml
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | -<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> | |
| 3 | - <servlet> | |
| 4 | - <servlet-name>init_job</servlet-name> | |
| 5 | - <servlet-class>com.cnlive.mz.live.servlet.InitServlet</servlet-class> | |
| 6 | - <init-param> | |
| 7 | - <param-name>shutdown-on-unload</param-name> | |
| 8 | - <param-value>true</param-value> | |
| 9 | - </init-param> | |
| 10 | - <load-on-startup>2</load-on-startup> | |
| 11 | - </servlet> | |
| 12 | - <error-page> | |
| 13 | - <error-code>500</error-code> | |
| 14 | - <location>/live/epg/error500</location> | |
| 15 | - </error-page> | |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> | |
| 3 | + <servlet> | |
| 4 | + <servlet-name>init_job</servlet-name> | |
| 5 | + <servlet-class>com.cnlive.mz.live.servlet.InitServlet</servlet-class> | |
| 6 | + <init-param> | |
| 7 | + <param-name>shutdown-on-unload</param-name> | |
| 8 | + <param-value>true</param-value> | |
| 9 | + </init-param> | |
| 10 | + <load-on-startup>2</load-on-startup> | |
| 11 | + </servlet> | |
| 12 | + <error-page> | |
| 13 | + <error-code>500</error-code> | |
| 14 | + <location>/live/epg/error500</location> | |
| 15 | + </error-page> | |
| 16 | 16 | </web-app> |
| 17 | 17 | \ No newline at end of file | ... | ... |
src/main/webapp/pages/check/check_management.jsp
| 1 | -<%@ page language="java" pageEncoding="UTF-8" | |
| 2 | - deferredSyntaxAllowedAsLiteral="true"%> | |
| 3 | -<%@ include file="/pages/common/taglib.jsp"%> | |
| 4 | -<!DOCTYPE html> | |
| 5 | -<html> | |
| 6 | -<head> | |
| 7 | -<meta charset="UTF-8"> | |
| 8 | -<title>监审管理 | <f:message key="common.title" /></title> | |
| 9 | -<meta 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 | -body { | |
| 14 | - font-family: Verdana, Arial, Helvetica, sans-serif; | |
| 15 | - font-size: 12px; | |
| 16 | - line-height: 20px; | |
| 17 | - color: #000000; | |
| 18 | -} | |
| 19 | - | |
| 20 | -#main_box { | |
| 21 | - /*正文区大容器*/ | |
| 22 | - width: 770px; | |
| 23 | - margin-right: auto; | |
| 24 | - margin-left: auto; | |
| 25 | -} | |
| 26 | - | |
| 27 | -.row { | |
| 28 | - /*定义每行*/ | |
| 29 | - width: 100%; | |
| 30 | - clear: both; | |
| 31 | -} | |
| 32 | - | |
| 33 | -.left3 { | |
| 34 | - /*用在五列布局上*/ | |
| 35 | - border: 1px solid #00ff00; | |
| 36 | - width: 25%; | |
| 37 | - height: 150px; | |
| 38 | - float: left; | |
| 39 | -} | |
| 40 | - | |
| 41 | -.divleft { | |
| 42 | - width: 24%; | |
| 43 | - height: 600px; | |
| 44 | - float: left; | |
| 45 | -} | |
| 46 | - | |
| 47 | -.divright { | |
| 48 | - width: 74%; | |
| 49 | - height: 600px; | |
| 50 | - float: right; | |
| 51 | -} | |
| 52 | - | |
| 53 | -.leftTop { | |
| 54 | - width: 100%; | |
| 55 | - height: 340px; | |
| 56 | - float: right; | |
| 57 | -} | |
| 58 | - | |
| 59 | -.leftBootom { | |
| 60 | - width: 100%; | |
| 61 | - height: 250px; | |
| 62 | - float: right; | |
| 63 | -} | |
| 64 | -</style> | |
| 65 | -</head> | |
| 66 | -<body class="skin-blue fixed "> | |
| 67 | - <div class="wrapper"> | |
| 68 | - <%@ include file="/pages/common/top.jsp"%> | |
| 69 | - <%@ include file="/pages/common/left.jsp"%> | |
| 70 | - <div class="content-wrapper"> | |
| 71 | - <!-- Content Header (Page header) --> | |
| 72 | - <section class="content-header"> | |
| 73 | - <h1> | |
| 74 | - 监审管理<small><a href="../../live/preload"><i | |
| 75 | - class="fa fa-plus"></i>直播监审</a> </small> <small class="label label-warning" | |
| 76 | - style="display: none" id="info_tab_span"><i | |
| 77 | - class="fa fa-bell-o"></i></small> | |
| 78 | - </h1> | |
| 79 | - | |
| 80 | - <ol class="breadcrumb"> | |
| 81 | - <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 82 | - <li class="active">监审管理</li> | |
| 83 | - </ol> | |
| 84 | - </section> | |
| 85 | - <!-- Main content --> | |
| 86 | - <section class="content"> | |
| 87 | - <div class="row"> | |
| 88 | - <div class="col-xs-12"> | |
| 89 | - <div class="box box-warning"> | |
| 90 | - <div class="box-header with-border"> | |
| 91 | - <h3 class="box-title"></h3> | |
| 92 | - <div class="box-tools"> | |
| 93 | - <div class="input-group"> | |
| 94 | - <div class="box-footer clearfix"> | |
| 95 | - <center> | |
| 96 | - <tag:pager3 id="product_pager" pager="${tLive}" /> | |
| 97 | - </center> | |
| 98 | - </div> | |
| 99 | - </div> | |
| 100 | - </div> | |
| 101 | - </div> | |
| 102 | - <!-- /.box-header --> | |
| 103 | - <div class="box-body"> | |
| 104 | - | |
| 105 | - <div class="divleft"> | |
| 106 | - <div class="leftTop" id="leftTopPlay"></div> | |
| 107 | - <div class="leftBootom"> | |
| 108 | - | |
| 109 | - <table class="table table-bordered"> | |
| 110 | - | |
| 111 | - <h4>直播活动详情:</h4> | |
| 112 | - | |
| 113 | - <tr> | |
| 114 | - <th width="30%">活动名称</th> | |
| 115 | - <th id="live_name"></th> | |
| 116 | - | |
| 117 | - </tr> | |
| 118 | - <tr> | |
| 119 | - <th width="30%">开始时间</th> | |
| 120 | - <th id="start_time"></th> | |
| 121 | - </tr> | |
| 122 | - <tr> | |
| 123 | - <th width="30%">结束时间</th> | |
| 124 | - <th id="end_time"></th> | |
| 125 | - </tr> | |
| 126 | - <tr> | |
| 127 | - <th width="30%">活动简述</th> | |
| 128 | - <th id="live_desper"></th> | |
| 129 | - </tr> | |
| 130 | - <tr> | |
| 131 | - <th width="30%">live_url</th> | |
| 132 | - <th id="live_url"></th> | |
| 133 | - </tr> | |
| 134 | - <tr> | |
| 135 | - <th width="30%">活动简述</th> | |
| 136 | - <th id=""></th> | |
| 137 | - </tr> | |
| 138 | - | |
| 139 | - </table> | |
| 140 | - </div> | |
| 141 | - </div> | |
| 142 | - <div class="divright"> | |
| 143 | - <!--五列开始--> | |
| 144 | - <div class="row"> | |
| 145 | - <c:forEach var="item" items="${tLive.recordList}" | |
| 146 | - varStatus="stat"> | |
| 147 | - <!-- <div style="border: 1px solid #00ff00; width: 33%; height: 200px; background: #888; float: left;"> --> | |
| 148 | - <div class="warp" | |
| 149 | - style="border: 1px solid #00ff00; width: 33%; height: 203px; float: left;" | |
| 150 | - id="divShow_${item.id}" | |
| 151 | - onclick="getParam('${item.id}','${item.title}','${item.live_url}','${item.start_time}','${item.end_time}')"> | |
| 152 | - <!-- <div class="warp" style="height: 24px; background: #;"> --> | |
| 153 | - <button type="button" class="close" data-dismiss="modal" | |
| 154 | - id="colseLive" onclick="coseLive(event,'${item.id}','${item.t_user_id}')"> | |
| 155 | - <span aria-hidden="true">×</span><span | |
| 156 | - class="sr-only">Close</span> | |
| 157 | - </button> | |
| 158 | - <h5 class="modal-title" id="myModalLabel">正在直播:${item.title}</h5> | |
| 159 | - <!-- </div> --> | |
| 160 | - <div id="a1_${item.id}" class="a1_class" | |
| 161 | - style="height: 150px"> | |
| 162 | - <input type="hidden" value='${item.id}' name="liveid" | |
| 163 | - id="liveid"> | |
| 164 | - <input type="hidden"value='${item.title}' name="title" id="title"> | |
| 165 | - <input type="hidden" value='${item.live_url}' name="live_url" | |
| 166 | - id="live_url_${item.id}"> | |
| 167 | - <input type="hidden"value='${item.start_time}' name="start_time" | |
| 168 | - id="start_time"> | |
| 169 | - <input type="hidden"value='${item.end_time}' name="end_time" id="end_time"> | |
| 170 | - <input type="hidden"value='${item.t_user_id}' name="t_user_id" id="t_user_${item.id}"> | |
| 171 | - <%-- <h4 class="blue smaller"> | |
| 172 | - <i class="icon-picture orange"></i>视频源 : ${item.title} | |
| 173 | - </h4> --%> | |
| 174 | - </div> | |
| 175 | - <div class="" style="height: 30px;"> | |
| 176 | - <input type="button" value="置顶" id="makeTop" | |
| 177 | - onclick="makeTop(event,'${item.id}',this)"> <input | |
| 178 | - type="button" value="关闭活动" id="closeLive" | |
| 179 | - onclick="coseLive(event,'${item.id}','${item.t_user_id}')"> | |
| 180 | - </div> | |
| 181 | - </div> | |
| 182 | - <!-- </div> --> | |
| 183 | - </c:forEach> | |
| 184 | - </div> | |
| 185 | - </div> | |
| 186 | - </div> | |
| 187 | - | |
| 188 | - </div> | |
| 189 | - <!-- /.box-body --> | |
| 190 | - </div> | |
| 191 | - </div> | |
| 192 | - </section> | |
| 193 | - </div> | |
| 194 | - </div> | |
| 195 | - <%@ include file="/pages/common/bottom.jsp"%> | |
| 196 | - <%@ include file="/pages/common/js.jsp"%> | |
| 197 | - <script type="text/javascript" src="../../pages/check/js/ckplayer.js" charset="utf-8"></script> | |
| 198 | - <script type="text/javascript" src="../../pages/check/js/offlights.js" charset="utf-8"></script> | |
| 199 | - <script type="text/javascript"> | |
| 200 | - var flashvars = { | |
| 201 | - p : 1, | |
| 202 | - e : 1, | |
| 203 | - hl : '', | |
| 204 | - ht : '20', | |
| 205 | - }; | |
| 206 | - var video = [ '' ]; | |
| 207 | - var support = [ 'all' ]; | |
| 208 | - CKobject.embedHTML5('leftTopPlay', 'ckplayer_leftTopPlay', 250, 290, | |
| 209 | - video, flashvars, support); | |
| 210 | - | |
| 211 | - $(".a1_class #liveid").each(function() { | |
| 212 | - var id = $(this).val(); | |
| 213 | - var live_url = $('#live_url_' + id).val(); | |
| 214 | - var t_user_id = $('#t_user_'+id).val(); | |
| 215 | - | |
| 216 | - var flashvars = { | |
| 217 | - p : 1, | |
| 218 | - e : 1, | |
| 219 | - hl : live_url, | |
| 220 | - ht : '20' | |
| 221 | - }; | |
| 222 | - var video = [live_url ]; | |
| 223 | - var support = [ 'all' ]; | |
| 224 | - CKobject.embedHTML5('a1_' + id, 'ckplayer_' + id,250, 153, video, flashvars, support); | |
| 225 | - | |
| 226 | - //m3u8 文件播放 | |
| 227 | - /* var flashvars={ | |
| 228 | - f:'http://localhost:8080/cnlive_live_web/static/assets/ckplayer/m3u8.swf', | |
| 229 | - a:live_url, | |
| 230 | - s:4, | |
| 231 | - c:0, | |
| 232 | - p:1 | |
| 233 | - }; | |
| 234 | - var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent'}; | |
| 235 | - var video=[live_url]; | |
| 236 | - CKobject.embed('http://localhost:8080/cnlive_live_web/static/assets/ckplayer/ckplayer.swf', 'a1_' + id, 'ckplayer_' + id, 250, 153,false,flashvars,video,params); */ | |
| 237 | - // rtmp 直播流播放。 | |
| 238 | - /* var flashvars = { | |
| 239 | - // f:'rtmp://localhost/live/livestreame', | |
| 240 | - f :'http://cnlive.uplive.ks-cdn.com/live/'+t_user_id+'_'+id, | |
| 241 | - c : 0 | |
| 242 | - }; | |
| 243 | - var video = [ 'http://cnlive.hlslive.ks-cdn.com/live/'+t_user_id+'_'+id+'/index.m3u8']; | |
| 244 | - CKobject.embed('../../static/assets/ckplayer/ckplayer.swf','a1_' + id, 'ckplayer_' + id, 250, | |
| 245 | - 153, false, flashvars, video); */ | |
| 246 | - | |
| 247 | - }); | |
| 248 | - | |
| 249 | - function getParam(id, name, live_url, start_time, end_time) { | |
| 250 | - | |
| 251 | - $("#live_name").html(name); | |
| 252 | - $("#start_time").html(start_time); | |
| 253 | - $("#end_time").html(end_time); | |
| 254 | - $("#live_url").html(live_url); | |
| 255 | - var flashvars = { | |
| 256 | - p : 1, | |
| 257 | - e : 1, | |
| 258 | - hl : 'http://movie.ks.js.cn/flv/other/1_0.mp4', | |
| 259 | - }; | |
| 260 | - var video = [ live_url ]; | |
| 261 | - var support = [ 'all' ]; | |
| 262 | - CKobject.embedHTML5('leftTopPlay', 'ckplayer_leftTopPlay', 250, | |
| 263 | - 290, video, flashvars, support); | |
| 264 | - } | |
| 265 | - function coseLive(e, id,user_id) { | |
| 266 | - e.cancelBubble = true; | |
| 267 | - $.ajax({ | |
| 268 | - url : '../../check/close/' + id, | |
| 269 | - type : 'post', | |
| 270 | - datatype : "json", | |
| 271 | - async : true, | |
| 272 | - data:{"user_id":user_id}, | |
| 273 | - error : function() { | |
| 274 | - alert('关闭时发生错误!'); | |
| 275 | - }, | |
| 276 | - success : function(data) { | |
| 277 | - location.href = '../../check/list/1'; | |
| 278 | - alert("关闭成功"); | |
| 279 | - } | |
| 280 | - }); | |
| 281 | - } | |
| 282 | - /** | |
| 283 | - 置顶 。。。 | |
| 284 | - */ | |
| 285 | - | |
| 286 | - function makeTop(event, id, obj) { | |
| 287 | - event.cancelBubble = true; | |
| 288 | - $(obj.parentElement.parentElement).insertBefore($('.warp').first()) | |
| 289 | - alert(obj.parentElement.parentElement); | |
| 290 | - }; | |
| 291 | - </script> | |
| 292 | -</body> | |
| 293 | -</html> | |
| 1 | +<%@ page language="java" pageEncoding="UTF-8" | |
| 2 | + deferredSyntaxAllowedAsLiteral="true"%> | |
| 3 | +<%@ include file="/pages/common/taglib.jsp"%> | |
| 4 | +<!DOCTYPE html> | |
| 5 | +<html> | |
| 6 | +<head> | |
| 7 | +<meta charset="UTF-8"> | |
| 8 | +<title>监审管理 | <f:message key="common.title" /></title> | |
| 9 | +<meta 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 | +body { | |
| 14 | + font-family: Verdana, Arial, Helvetica, sans-serif; | |
| 15 | + font-size: 12px; | |
| 16 | + line-height: 20px; | |
| 17 | + color: #000000; | |
| 18 | +} | |
| 19 | + | |
| 20 | +#main_box { | |
| 21 | + /*正文区大容器*/ | |
| 22 | + width: 770px; | |
| 23 | + margin-right: auto; | |
| 24 | + margin-left: auto; | |
| 25 | +} | |
| 26 | + | |
| 27 | +.row { | |
| 28 | + /*定义每行*/ | |
| 29 | + width: 100%; | |
| 30 | + clear: both; | |
| 31 | +} | |
| 32 | + | |
| 33 | +.left3 { | |
| 34 | + /*用在五列布局上*/ | |
| 35 | + border: 1px solid #00ff00; | |
| 36 | + width: 25%; | |
| 37 | + height: 150px; | |
| 38 | + float: left; | |
| 39 | +} | |
| 40 | + | |
| 41 | +.divleft { | |
| 42 | + width: 24%; | |
| 43 | + height: 600px; | |
| 44 | + float: left; | |
| 45 | +} | |
| 46 | + | |
| 47 | +.divright { | |
| 48 | + width: 74%; | |
| 49 | + height: 600px; | |
| 50 | + float: right; | |
| 51 | +} | |
| 52 | + | |
| 53 | +.leftTop { | |
| 54 | + width: 100%; | |
| 55 | + height: 340px; | |
| 56 | + float: right; | |
| 57 | +} | |
| 58 | + | |
| 59 | +.leftBootom { | |
| 60 | + width: 100%; | |
| 61 | + height: 250px; | |
| 62 | + float: right; | |
| 63 | +} | |
| 64 | +</style> | |
| 65 | +</head> | |
| 66 | +<body class="skin-blue fixed "> | |
| 67 | + <div class="wrapper"> | |
| 68 | + <%@ include file="/pages/common/top.jsp"%> | |
| 69 | + <%@ include file="/pages/common/left.jsp"%> | |
| 70 | + <div class="content-wrapper"> | |
| 71 | + <!-- Content Header (Page header) --> | |
| 72 | + <section class="content-header"> | |
| 73 | + <h1> | |
| 74 | + 监审管理<small><a href="../../live/preload"><i | |
| 75 | + class="fa fa-plus"></i>直播监审</a> </small> <small class="label label-warning" | |
| 76 | + style="display: none" id="info_tab_span"><i | |
| 77 | + class="fa fa-bell-o"></i></small> | |
| 78 | + </h1> | |
| 79 | + | |
| 80 | + <ol class="breadcrumb"> | |
| 81 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 82 | + <li class="active">监审管理</li> | |
| 83 | + </ol> | |
| 84 | + </section> | |
| 85 | + <!-- Main content --> | |
| 86 | + <section class="content"> | |
| 87 | + <div class="row"> | |
| 88 | + <div class="col-xs-12"> | |
| 89 | + <div class="box box-warning"> | |
| 90 | + <div class="box-header with-border"> | |
| 91 | + <h3 class="box-title"></h3> | |
| 92 | + <div class="box-tools"> | |
| 93 | + <div class="input-group"> | |
| 94 | + <div class="box-footer clearfix"> | |
| 95 | + <center> | |
| 96 | + <tag:pager3 id="product_pager" pager="${tLive}" /> | |
| 97 | + </center> | |
| 98 | + </div> | |
| 99 | + </div> | |
| 100 | + </div> | |
| 101 | + </div> | |
| 102 | + <!-- /.box-header --> | |
| 103 | + <div class="box-body"> | |
| 104 | + | |
| 105 | + <div class="divleft"> | |
| 106 | + <div class="leftTop" id="leftTopPlay"></div> | |
| 107 | + <div class="leftBootom"> | |
| 108 | + | |
| 109 | + <table class="table table-bordered"> | |
| 110 | + | |
| 111 | + <h4>直播活动详情:</h4> | |
| 112 | + | |
| 113 | + <tr> | |
| 114 | + <th width="30%">活动名称</th> | |
| 115 | + <th id="live_name"></th> | |
| 116 | + | |
| 117 | + </tr> | |
| 118 | + <tr> | |
| 119 | + <th width="30%">开始时间</th> | |
| 120 | + <th id="start_time"></th> | |
| 121 | + </tr> | |
| 122 | + <tr> | |
| 123 | + <th width="30%">结束时间</th> | |
| 124 | + <th id="end_time"></th> | |
| 125 | + </tr> | |
| 126 | + <tr> | |
| 127 | + <th width="30%">活动简述</th> | |
| 128 | + <th id="live_desper"></th> | |
| 129 | + </tr> | |
| 130 | + <tr> | |
| 131 | + <th width="30%">live_url</th> | |
| 132 | + <th id="live_url"></th> | |
| 133 | + </tr> | |
| 134 | + <tr> | |
| 135 | + <th width="30%">活动简述</th> | |
| 136 | + <th id=""></th> | |
| 137 | + </tr> | |
| 138 | + | |
| 139 | + </table> | |
| 140 | + </div> | |
| 141 | + </div> | |
| 142 | + <div class="divright"> | |
| 143 | + <!--五列开始--> | |
| 144 | + <div class="row"> | |
| 145 | + <c:forEach var="item" items="${tLive.recordList}" | |
| 146 | + varStatus="stat"> | |
| 147 | + <!-- <div style="border: 1px solid #00ff00; width: 33%; height: 200px; background: #888; float: left;"> --> | |
| 148 | + <div class="warp" | |
| 149 | + style="border: 1px solid #00ff00; width: 33%; height: 203px; float: left;" | |
| 150 | + id="divShow_${item.id}" | |
| 151 | + onclick="getParam('${item.id}','${item.title}','${item.live_url}','${item.start_time}','${item.end_time}')"> | |
| 152 | + <!-- <div class="warp" style="height: 24px; background: #;"> --> | |
| 153 | + <button type="button" class="close" data-dismiss="modal" | |
| 154 | + id="colseLive" onclick="coseLive(event,'${item.id}','${item.t_user_id}')"> | |
| 155 | + <span aria-hidden="true">×</span><span | |
| 156 | + class="sr-only">Close</span> | |
| 157 | + </button> | |
| 158 | + <h5 class="modal-title" id="myModalLabel">正在直播:${item.title}</h5> | |
| 159 | + <!-- </div> --> | |
| 160 | + <div id="a1_${item.id}" class="a1_class" | |
| 161 | + style="height: 150px"> | |
| 162 | + <input type="hidden" value='${item.id}' name="liveid" | |
| 163 | + id="liveid"> | |
| 164 | + <input type="hidden"value='${item.title}' name="title" id="title"> | |
| 165 | + <input type="hidden" value='${item.live_url}' name="live_url" | |
| 166 | + id="live_url_${item.id}"> | |
| 167 | + <input type="hidden"value='${item.start_time}' name="start_time" | |
| 168 | + id="start_time"> | |
| 169 | + <input type="hidden"value='${item.end_time}' name="end_time" id="end_time"> | |
| 170 | + <input type="hidden"value='${item.t_user_id}' name="t_user_id" id="t_user_${item.id}"> | |
| 171 | + <%-- <h4 class="blue smaller"> | |
| 172 | + <i class="icon-picture orange"></i>视频源 : ${item.title} | |
| 173 | + </h4> --%> | |
| 174 | + </div> | |
| 175 | + <div class="" style="height: 30px;"> | |
| 176 | + <input type="button" value="置顶" id="makeTop" | |
| 177 | + onclick="makeTop(event,'${item.id}',this)"> <input | |
| 178 | + type="button" value="关闭活动" id="closeLive" | |
| 179 | + onclick="coseLive(event,'${item.id}','${item.t_user_id}')"> | |
| 180 | + </div> | |
| 181 | + </div> | |
| 182 | + <!-- </div> --> | |
| 183 | + </c:forEach> | |
| 184 | + </div> | |
| 185 | + </div> | |
| 186 | + </div> | |
| 187 | + | |
| 188 | + </div> | |
| 189 | + <!-- /.box-body --> | |
| 190 | + </div> | |
| 191 | + </div> | |
| 192 | + </section> | |
| 193 | + </div> | |
| 194 | + </div> | |
| 195 | + <%@ include file="/pages/common/bottom.jsp"%> | |
| 196 | + <%@ include file="/pages/common/js.jsp"%> | |
| 197 | + <script type="text/javascript" src="../../pages/check/js/ckplayer.js" charset="utf-8"></script> | |
| 198 | + <script type="text/javascript" src="../../pages/check/js/offlights.js" charset="utf-8"></script> | |
| 199 | + <script type="text/javascript"> | |
| 200 | + var flashvars = { | |
| 201 | + p : 1, | |
| 202 | + e : 1, | |
| 203 | + hl : '', | |
| 204 | + ht : '20', | |
| 205 | + }; | |
| 206 | + var video = [ '' ]; | |
| 207 | + var support = [ 'all' ]; | |
| 208 | + CKobject.embedHTML5('leftTopPlay', 'ckplayer_leftTopPlay', 250, 290, | |
| 209 | + video, flashvars, support); | |
| 210 | + | |
| 211 | + $(".a1_class #liveid").each(function() { | |
| 212 | + var id = $(this).val(); | |
| 213 | + var live_url = $('#live_url_' + id).val(); | |
| 214 | + var t_user_id = $('#t_user_'+id).val(); | |
| 215 | + | |
| 216 | + var flashvars = { | |
| 217 | + p : 1, | |
| 218 | + e : 1, | |
| 219 | + hl : live_url, | |
| 220 | + ht : '20' | |
| 221 | + }; | |
| 222 | + var video = [live_url ]; | |
| 223 | + var support = [ 'all' ]; | |
| 224 | + CKobject.embedHTML5('a1_' + id, 'ckplayer_' + id,250, 153, video, flashvars, support); | |
| 225 | + | |
| 226 | + //m3u8 文件播放 | |
| 227 | + /* var flashvars={ | |
| 228 | + f:'http://localhost:8080/cnlive_live_web/static/assets/ckplayer/m3u8.swf', | |
| 229 | + a:live_url, | |
| 230 | + s:4, | |
| 231 | + c:0, | |
| 232 | + p:1 | |
| 233 | + }; | |
| 234 | + var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent'}; | |
| 235 | + var video=[live_url]; | |
| 236 | + CKobject.embed('http://localhost:8080/cnlive_live_web/static/assets/ckplayer/ckplayer.swf', 'a1_' + id, 'ckplayer_' + id, 250, 153,false,flashvars,video,params); */ | |
| 237 | + // rtmp 直播流播放。 | |
| 238 | + /* var flashvars = { | |
| 239 | + // f:'rtmp://localhost/live/livestreame', | |
| 240 | + f :'http://cnlive.uplive.ks-cdn.com/live/'+t_user_id+'_'+id, | |
| 241 | + c : 0 | |
| 242 | + }; | |
| 243 | + var video = [ 'http://cnlive.hlslive.ks-cdn.com/live/'+t_user_id+'_'+id+'/index.m3u8']; | |
| 244 | + CKobject.embed('../../static/assets/ckplayer/ckplayer.swf','a1_' + id, 'ckplayer_' + id, 250, | |
| 245 | + 153, false, flashvars, video); */ | |
| 246 | + | |
| 247 | + }); | |
| 248 | + | |
| 249 | + function getParam(id, name, live_url, start_time, end_time) { | |
| 250 | + | |
| 251 | + $("#live_name").html(name); | |
| 252 | + $("#start_time").html(start_time); | |
| 253 | + $("#end_time").html(end_time); | |
| 254 | + $("#live_url").html(live_url); | |
| 255 | + var flashvars = { | |
| 256 | + p : 1, | |
| 257 | + e : 1, | |
| 258 | + hl : 'http://movie.ks.js.cn/flv/other/1_0.mp4', | |
| 259 | + }; | |
| 260 | + var video = [ live_url ]; | |
| 261 | + var support = [ 'all' ]; | |
| 262 | + CKobject.embedHTML5('leftTopPlay', 'ckplayer_leftTopPlay', 250, | |
| 263 | + 290, video, flashvars, support); | |
| 264 | + } | |
| 265 | + function coseLive(e, id,user_id) { | |
| 266 | + e.cancelBubble = true; | |
| 267 | + $.ajax({ | |
| 268 | + url : '../../check/close/' + id, | |
| 269 | + type : 'post', | |
| 270 | + datatype : "json", | |
| 271 | + async : true, | |
| 272 | + data:{"user_id":user_id}, | |
| 273 | + error : function() { | |
| 274 | + alert('关闭时发生错误!'); | |
| 275 | + }, | |
| 276 | + success : function(data) { | |
| 277 | + location.href = '../../check/list/1'; | |
| 278 | + alert("关闭成功"); | |
| 279 | + } | |
| 280 | + }); | |
| 281 | + } | |
| 282 | + /** | |
| 283 | + 置顶 。。。 | |
| 284 | + */ | |
| 285 | + | |
| 286 | + function makeTop(event, id, obj) { | |
| 287 | + event.cancelBubble = true; | |
| 288 | + $(obj.parentElement.parentElement).insertBefore($('.warp').first()) | |
| 289 | + alert(obj.parentElement.parentElement); | |
| 290 | + }; | |
| 291 | + </script> | |
| 292 | +</body> | |
| 293 | +</html> | ... | ... |
src/main/webapp/pages/check/monitor.jsp
| 1 | -<%@ page language="java" pageEncoding="UTF-8"%> | |
| 2 | -<%@ include file="/pages/common/taglib.jsp"%> | |
| 3 | -<!DOCTYPE html> | |
| 4 | -<html> | |
| 5 | -<head> | |
| 6 | -<style type="text/css"> | |
| 7 | -.text-overflow { | |
| 8 | - display: block; /*内联对象需加*/ | |
| 9 | - width: 31em; | |
| 10 | - word-break: keep-all; /* 不换行 */ | |
| 11 | - white-space: nowrap; /* 不换行 */ | |
| 12 | - overflow: hidden; /* 内容超出宽度时隐藏超出部分的内容 */ | |
| 13 | - text-overflow: ellipsis; | |
| 14 | - /* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/ | |
| 15 | -} | |
| 16 | -</style> | |
| 17 | -<meta charset="UTF-8"> | |
| 18 | -<title>监审管理 |<f:message key="common.title" /></title> | |
| 19 | -<meta | |
| 20 | - content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' | |
| 21 | - name='viewport'> | |
| 22 | -<%@ include file="/pages/common/css.jsp"%> | |
| 23 | -<script src="${BASE}/static/assets/cnlive/js/check.js"></script> | |
| 24 | -<script src="${BASE}/static/assets/jwplayer/jwplayer.js"></script> | |
| 25 | -<script src="${BASE}/static/assets/jwplayer/jwplayer.html5.js"></script> | |
| 26 | -<script type="text/javascript">jwplayer.key="MGAzpXRYxGnaVXhH8jSdKXzDe7ucAAvZGWggIA==";</script> | |
| 27 | - | |
| 28 | -</head> | |
| 29 | -<body class="skin-blue sidebar-collapse sidebar-mini"> | |
| 30 | - <div class="wrapper"> | |
| 31 | - <%@ include file="/pages/common/top.jsp"%> | |
| 32 | - <%@ include file="/pages/common/left.jsp"%> | |
| 33 | - <!-- Content Wrapper. Contains page content --> | |
| 34 | - <div class="content-wrapper"> | |
| 35 | - <!-- Content Header (Page header) --> | |
| 36 | - <section class="content-header"> | |
| 37 | - <h1> | |
| 38 | - 监审管理 <small>monitor panel</small> | |
| 39 | - </h1> | |
| 40 | - <ol class="breadcrumb"> | |
| 41 | - <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 42 | - <li class="active">监审管理</li> | |
| 43 | - </ol> | |
| 44 | - </section> | |
| 45 | - <section class="content"> | |
| 46 | - <div class="row"> | |
| 47 | - <div class="col-md-4"> | |
| 48 | - <div class="box box-solid"> | |
| 49 | - <div class="box-header with-border"> | |
| 50 | - <h3 class="box-title">监控平台</h3> | |
| 51 | - </div> | |
| 52 | - <div class="box-body no-padding"> | |
| 53 | - <div class="col-md-12" id="divShow_${item.id}"> | |
| 54 | - <div class="box box-success box-solid"> | |
| 55 | - <div class="box-header with-border"> | |
| 56 | - <div class="text-overflow"> | |
| 57 | - <h3 class="box-title" id="hidId">${item.title}</h3> | |
| 58 | - </div> | |
| 59 | - <div class="box-tools pull-right"> | |
| 60 | - <button class="btn btn-sm" id="play_button_${item.id}" | |
| 61 | - onclick="play(${item.id});">重新载入</button> | |
| 62 | - </div> | |
| 63 | - </div> | |
| 64 | - <div id="playId" class="box-body"> | |
| 65 | - <%-- <input type="hidden" name="play_url_${item.id}" | |
| 66 | - id="play_url_${item.id}" value="${item.live_url}" /> <span | |
| 67 | - class="mailbox-attachment-icon has-img" | |
| 68 | - id="player_span_${item.id}"> <img | |
| 69 | - src="../../static/assets/dist/img/photo2.png" | |
| 70 | - alt="Attachment"> | |
| 71 | - </span> --%> | |
| 72 | - </div> | |
| 73 | - </div> | |
| 74 | - </div> | |
| 75 | - </div> | |
| 76 | - </div> | |
| 77 | - <div class="box-header with-border"> | |
| 78 | - <h3 class="box-title">直播信息:</h3> | |
| 79 | - </div> | |
| 80 | - <div class="box-body no-padding"> | |
| 81 | - <ul class="nav nav-pills nav-stacked"> | |
| 82 | - <li id="userId"><a><i class="fa fa-file-text-o"></i>用户ID:</a></li> | |
| 83 | - <li id="title"><a><i class="fa fa-file-text-o"></i>TITLE: | |
| 84 | - </a></li> | |
| 85 | - <li id="startTime"><a><i class="fa fa-file-text-o"></i>开播时间: | |
| 86 | - </a></li> | |
| 87 | - </ul> | |
| 88 | - </div> | |
| 89 | - </div> | |
| 90 | - <div class="col-md-8"> | |
| 91 | - <div class="box box-primary"> | |
| 92 | - <div class="box-header with-border"> | |
| 93 | - <h3 class="box-title">监控</h3> | |
| 94 | - <tag:pager id="product_pager" pager="${tLive}" /> | |
| 95 | - </div> | |
| 96 | - <div class="box-body no-padding"> | |
| 97 | - <div class="row"> | |
| 98 | - <c:forEach var="item" items="${tLive.recordList}" | |
| 99 | - varStatus="stat"> | |
| 100 | - <div class="col-md-3" id="divShow_${item.id}"> | |
| 101 | - <div | |
| 102 | - class="box ${item.check_sort eq null ? 'box-warning':'box-success'} box-solid"> | |
| 103 | - <div class="box-header with-border"> | |
| 104 | - <div class="text-overflow"> | |
| 105 | - <h3 class="box-title">${item.title}</h3> | |
| 106 | - </div> | |
| 107 | - <div class="box-tools pull-right"> | |
| 108 | - <button class="btn btn-sm btn-danger" | |
| 109 | - onclick="changePlay('${item.id}','${item.live_url}','${item.t_user_id}','${item.title}','${item.start_time}');">左</button> | |
| 110 | - <button class="btn btn-sm btn-danger" | |
| 111 | - onclick="to_pass(${item.id});">过</button> | |
| 112 | - <button class="btn btn-sm btn-danger" | |
| 113 | - onclick="to_top(${item.id});">顶</button> | |
| 114 | - <button class="btn btn-sm btn-danger" | |
| 115 | - onclick="play_close('${item.id}','${item.live_url}','${item.uuid}');">断</button> | |
| 116 | - </div> | |
| 117 | - </div> | |
| 118 | - <div class="box-body"> | |
| 119 | - <input type="hidden" name="play_url_${item.id}" | |
| 120 | - id="play_url_${item.id}" value="${item.live_url}" /> <span | |
| 121 | - class="mailbox-attachment-icon has-img" | |
| 122 | - id="player_span_${item.id}"> <img | |
| 123 | - src="../../static/assets/dist/img/photo2.png" | |
| 124 | - alt="Attachment"> | |
| 125 | - </span> | |
| 126 | - </div> | |
| 127 | - </div> | |
| 128 | - </div> | |
| 129 | - </c:forEach> | |
| 130 | - </div> | |
| 131 | - </div> | |
| 132 | - </div> | |
| 133 | - </div> | |
| 134 | - </div> | |
| 135 | - <%@ include file="/pages/common/js.jsp"%> | |
| 136 | - <script src="${BASE}/static/assets/cnlive/js/player_m3u8.js"></script> | |
| 137 | - </section> | |
| 138 | - </div> | |
| 139 | - </div> | |
| 140 | -</body> | |
| 141 | -<script type="text/javascript"> | |
| 142 | -jwplayer("playId").setup({ | |
| 143 | - file: "", | |
| 144 | - height: 260, | |
| 145 | - image: "/assets/myVideo.jpg", | |
| 146 | - autostart:true, | |
| 147 | - rtmp: { | |
| 148 | - bufferlength: 0.1 | |
| 149 | - }, | |
| 150 | - width: 370 | |
| 151 | -}); | |
| 152 | -</script> | |
| 1 | +<%@ page language="java" pageEncoding="UTF-8"%> | |
| 2 | +<%@ include file="/pages/common/taglib.jsp"%> | |
| 3 | +<!DOCTYPE html> | |
| 4 | +<html> | |
| 5 | +<head> | |
| 6 | +<style type="text/css"> | |
| 7 | +.text-overflow { | |
| 8 | + display: block; /*内联对象需加*/ | |
| 9 | + width: 31em; | |
| 10 | + word-break: keep-all; /* 不换行 */ | |
| 11 | + white-space: nowrap; /* 不换行 */ | |
| 12 | + overflow: hidden; /* 内容超出宽度时隐藏超出部分的内容 */ | |
| 13 | + text-overflow: ellipsis; | |
| 14 | + /* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/ | |
| 15 | +} | |
| 16 | +</style> | |
| 17 | +<meta charset="UTF-8"> | |
| 18 | +<title>监审管理 |<f:message key="common.title" /></title> | |
| 19 | +<meta | |
| 20 | + content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' | |
| 21 | + name='viewport'> | |
| 22 | +<%@ include file="/pages/common/css.jsp"%> | |
| 23 | +<script src="${BASE}/static/assets/cnlive/js/check.js"></script> | |
| 24 | +<script src="${BASE}/static/assets/jwplayer/jwplayer.js"></script> | |
| 25 | +<script src="${BASE}/static/assets/jwplayer/jwplayer.html5.js"></script> | |
| 26 | +<script type="text/javascript">jwplayer.key="MGAzpXRYxGnaVXhH8jSdKXzDe7ucAAvZGWggIA==";</script> | |
| 27 | + | |
| 28 | +</head> | |
| 29 | +<body class="skin-blue sidebar-collapse sidebar-mini"> | |
| 30 | + <div class="wrapper"> | |
| 31 | + <%@ include file="/pages/common/top.jsp"%> | |
| 32 | + <%@ include file="/pages/common/left.jsp"%> | |
| 33 | + <!-- Content Wrapper. Contains page content --> | |
| 34 | + <div class="content-wrapper"> | |
| 35 | + <!-- Content Header (Page header) --> | |
| 36 | + <section class="content-header"> | |
| 37 | + <h1> | |
| 38 | + 监审管理 <small>monitor panel</small> | |
| 39 | + </h1> | |
| 40 | + <ol class="breadcrumb"> | |
| 41 | + <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 42 | + <li class="active">监审管理</li> | |
| 43 | + </ol> | |
| 44 | + </section> | |
| 45 | + <section class="content"> | |
| 46 | + <div class="row"> | |
| 47 | + <div class="col-md-4"> | |
| 48 | + <div class="box box-solid"> | |
| 49 | + <div class="box-header with-border"> | |
| 50 | + <h3 class="box-title">监控平台</h3> | |
| 51 | + </div> | |
| 52 | + <div class="box-body no-padding"> | |
| 53 | + <div class="col-md-12" id="divShow_${item.id}"> | |
| 54 | + <div class="box box-success box-solid"> | |
| 55 | + <div class="box-header with-border"> | |
| 56 | + <div class="text-overflow"> | |
| 57 | + <h3 class="box-title" id="hidId">${item.title}</h3> | |
| 58 | + </div> | |
| 59 | + <div class="box-tools pull-right"> | |
| 60 | + <button class="btn btn-sm" id="play_button_${item.id}" | |
| 61 | + onclick="play(${item.id});">重新载入</button> | |
| 62 | + </div> | |
| 63 | + </div> | |
| 64 | + <div id="playId" class="box-body"> | |
| 65 | + <%-- <input type="hidden" name="play_url_${item.id}" | |
| 66 | + id="play_url_${item.id}" value="${item.live_url}" /> <span | |
| 67 | + class="mailbox-attachment-icon has-img" | |
| 68 | + id="player_span_${item.id}"> <img | |
| 69 | + src="../../static/assets/dist/img/photo2.png" | |
| 70 | + alt="Attachment"> | |
| 71 | + </span> --%> | |
| 72 | + </div> | |
| 73 | + </div> | |
| 74 | + </div> | |
| 75 | + </div> | |
| 76 | + </div> | |
| 77 | + <div class="box-header with-border"> | |
| 78 | + <h3 class="box-title">直播信息:</h3> | |
| 79 | + </div> | |
| 80 | + <div class="box-body no-padding"> | |
| 81 | + <ul class="nav nav-pills nav-stacked"> | |
| 82 | + <li id="userId"><a><i class="fa fa-file-text-o"></i>用户ID:</a></li> | |
| 83 | + <li id="title"><a><i class="fa fa-file-text-o"></i>TITLE: | |
| 84 | + </a></li> | |
| 85 | + <li id="startTime"><a><i class="fa fa-file-text-o"></i>开播时间: | |
| 86 | + </a></li> | |
| 87 | + </ul> | |
| 88 | + </div> | |
| 89 | + </div> | |
| 90 | + <div class="col-md-8"> | |
| 91 | + <div class="box box-primary"> | |
| 92 | + <div class="box-header with-border"> | |
| 93 | + <h3 class="box-title">监控</h3> | |
| 94 | + <tag:pager id="product_pager" pager="${tLive}" /> | |
| 95 | + </div> | |
| 96 | + <div class="box-body no-padding"> | |
| 97 | + <div class="row"> | |
| 98 | + <c:forEach var="item" items="${tLive.recordList}" | |
| 99 | + varStatus="stat"> | |
| 100 | + <div class="col-md-3" id="divShow_${item.id}"> | |
| 101 | + <div | |
| 102 | + class="box ${item.check_sort eq null ? 'box-warning':'box-success'} box-solid"> | |
| 103 | + <div class="box-header with-border"> | |
| 104 | + <div class="text-overflow"> | |
| 105 | + <h3 class="box-title">${item.title}</h3> | |
| 106 | + </div> | |
| 107 | + <div class="box-tools pull-right"> | |
| 108 | + <button class="btn btn-sm btn-danger" | |
| 109 | + onclick="changePlay('${item.id}','${item.live_url}','${item.t_user_id}','${item.title}','${item.start_time}');">左</button> | |
| 110 | + <button class="btn btn-sm btn-danger" | |
| 111 | + onclick="to_pass(${item.id});">过</button> | |
| 112 | + <button class="btn btn-sm btn-danger" | |
| 113 | + onclick="to_top(${item.id});">顶</button> | |
| 114 | + <button class="btn btn-sm btn-danger" | |
| 115 | + onclick="play_close('${item.id}','${item.live_url}','${item.uuid}');">断</button> | |
| 116 | + </div> | |
| 117 | + </div> | |
| 118 | + <div class="box-body"> | |
| 119 | + <input type="hidden" name="play_url_${item.id}" | |
| 120 | + id="play_url_${item.id}" value="${item.live_url}" /> <span | |
| 121 | + class="mailbox-attachment-icon has-img" | |
| 122 | + id="player_span_${item.id}"> <img | |
| 123 | + src="../../static/assets/dist/img/photo2.png" | |
| 124 | + alt="Attachment"> | |
| 125 | + </span> | |
| 126 | + </div> | |
| 127 | + </div> | |
| 128 | + </div> | |
| 129 | + </c:forEach> | |
| 130 | + </div> | |
| 131 | + </div> | |
| 132 | + </div> | |
| 133 | + </div> | |
| 134 | + </div> | |
| 135 | + <%@ include file="/pages/common/js.jsp"%> | |
| 136 | + <script src="${BASE}/static/assets/cnlive/js/player_m3u8.js"></script> | |
| 137 | + </section> | |
| 138 | + </div> | |
| 139 | + </div> | |
| 140 | +</body> | |
| 141 | +<script type="text/javascript"> | |
| 142 | +jwplayer("playId").setup({ | |
| 143 | + file: "", | |
| 144 | + height: 260, | |
| 145 | + image: "/assets/myVideo.jpg", | |
| 146 | + autostart:true, | |
| 147 | + rtmp: { | |
| 148 | + bufferlength: 0.1 | |
| 149 | + }, | |
| 150 | + width: 370 | |
| 151 | +}); | |
| 152 | +</script> | |
| 153 | 153 | </html> |
| 154 | 154 | \ No newline at end of file | ... | ... |
src/main/webapp/pages/common/js.jsp
| 1 | -<%@ page language="java" pageEncoding="utf-8"%> | |
| 2 | - | |
| 3 | -<script src="${BASE}/static/assets/plugins/jQuery/jQuery-2.1.4.min.js"></script> | |
| 4 | -<!-- Bootstrap 3.3.2 JS --> | |
| 5 | -<script src="${BASE}/static/assets/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> | |
| 6 | -<!-- Slimscroll --> | |
| 7 | -<script src="${BASE}/static/assets/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script> | |
| 8 | -<!-- FastClick --> | |
| 9 | -<script src='${BASE}/static/assets/plugins/fastclick/fastclick.min.js'></script> | |
| 10 | -<!-- AdminLTE App --> | |
| 11 | -<script src="${BASE}/static/assets/dist/js/app.min.js" type="text/javascript"></script> | |
| 12 | -<!-- AdminLTE for demo purposes --> | |
| 13 | -<script src="${BASE}/static/assets/dist/js/demo.js" type="text/javascript"></script> | |
| 14 | -<script src="${BASE}/static/assets/plugins/iCheck/1.0.2/icheck.js?v=1.0.2"></script> | |
| 15 | -<!-- InputMask --> | |
| 16 | -<script src="${BASE}/static/assets/plugins/input-mask/jquery.inputmask.js" type="text/javascript"></script> | |
| 17 | -<script src="${BASE}/static/assets/plugins/input-mask/jquery.inputmask.date.extensions.js" type="text/javascript"></script> | |
| 18 | -<script src="${BASE}/static/assets/plugins/input-mask/jquery.inputmask.extensions.js" type="text/javascript"></script> | |
| 19 | -<!-- date-range-picker --> | |
| 20 | -<script src="${BASE}/static/assets/third-party/moment.min.js" type="text/javascript"></script> | |
| 21 | -<script src="${BASE}/static/assets/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script> | |
| 22 | -<!-- bootstrap time picker --> | |
| 23 | -<script src="${BASE}/static/assets/plugins/timepicker/bootstrap-timepicker.min.js" type="text/javascript"></script> | |
| 24 | -<!-- iCheck 1.0.1 --> | |
| 25 | -<script src="${BASE}/static/assets/plugins/iCheck/icheck.min.js" type="text/javascript"></script> | |
| 26 | -<script src="${BASE}/static/assets/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script> | |
| 27 | - | |
| 28 | -<link rel="stylesheet" href="${BASE}/static/assets/plugins/fileinput/fileinput.css" /> | |
| 29 | -<link rel="stylesheet" href="${BASE}/static/assets/plugins/fileinput/fileinput.min.css" /> | |
| 30 | -<script src="${BASE}/static/assets/plugins/fileinput/fileinput.js"></script> | |
| 31 | -<script src="${BASE}/static/assets/plugins/fileinput/fileinput.min.js"></script> | |
| 32 | -<script src="${BASE}/static/assets/plugins/fileinput/fileinput_locale_zh.js"></script> | |
| 33 | - | |
| 34 | -<!-------直播系统所需 js 文件--> | |
| 35 | -<script src="${BASE}/static/assets/cnlive/js/all_live.js" type="text/javascript"></script> | |
| 36 | -<script src="${BASE}/static/assets/cnlive/js/live.js" type="text/javascript"></script> | |
| 37 | -<script src="${BASE}/static/assets/cnlive/js/room.js" type="text/javascript"></script> | |
| 38 | -<script src="${BASE}/static/assets/cnlive/js/channel.js" type="text/javascript"></script> | |
| 39 | -<script src="${BASE}/static/assets/cnlive/js/signal.js" type="text/javascript"></script> | |
| 40 | -<script src="${BASE}/static/assets/cnlive/js/wowza.js" type="text/javascript"></script> | |
| 41 | -<script src="${BASE}/static/assets/cnlive/js/activity.js" type="text/javascript"></script> | |
| 42 | -<script src="${BASE}/static/assets/cnlive/js/ajax_rest.js" type="text/javascript"></script> | |
| 43 | -<!-- cnlive validate --> | |
| 44 | -<script src="${BASE}/static/assets/plugins/validate/jquery.form.js"></script> | |
| 45 | -<script src="${BASE}/static/assets/plugins/validate/jquery.metadata.js"></script> | |
| 46 | -<script src="${BASE}/static/assets/plugins/validate/jquery.validate.js"></script> | |
| 47 | - | |
| 48 | -<script src="${BASE}/static/assets/plugins/easytree/easyTree.js"></script> | |
| 49 | -<script src="${BASE}/static/assets/cnlive/js/common.js"></script> | |
| 50 | -<script src="${BASE}/static/assets/cnlive/js/global.js"></script> | |
| 51 | -<script type="text/javascript"> | |
| 52 | - BASE = '${BASE}'; | |
| 1 | +<%@ page language="java" pageEncoding="utf-8"%> | |
| 2 | + | |
| 3 | +<script src="${BASE}/static/assets/plugins/jQuery/jQuery-2.1.4.min.js"></script> | |
| 4 | +<!-- Bootstrap 3.3.2 JS --> | |
| 5 | +<script src="${BASE}/static/assets/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> | |
| 6 | +<!-- Slimscroll --> | |
| 7 | +<script src="${BASE}/static/assets/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script> | |
| 8 | +<!-- FastClick --> | |
| 9 | +<script src='${BASE}/static/assets/plugins/fastclick/fastclick.min.js'></script> | |
| 10 | +<!-- AdminLTE App --> | |
| 11 | +<script src="${BASE}/static/assets/dist/js/app.min.js" type="text/javascript"></script> | |
| 12 | +<!-- AdminLTE for demo purposes --> | |
| 13 | +<script src="${BASE}/static/assets/dist/js/demo.js" type="text/javascript"></script> | |
| 14 | +<script src="${BASE}/static/assets/plugins/iCheck/1.0.2/icheck.js?v=1.0.2"></script> | |
| 15 | +<!-- InputMask --> | |
| 16 | +<script src="${BASE}/static/assets/plugins/input-mask/jquery.inputmask.js" type="text/javascript"></script> | |
| 17 | +<script src="${BASE}/static/assets/plugins/input-mask/jquery.inputmask.date.extensions.js" type="text/javascript"></script> | |
| 18 | +<script src="${BASE}/static/assets/plugins/input-mask/jquery.inputmask.extensions.js" type="text/javascript"></script> | |
| 19 | +<!-- date-range-picker --> | |
| 20 | +<script src="${BASE}/static/assets/third-party/moment.min.js" type="text/javascript"></script> | |
| 21 | +<script src="${BASE}/static/assets/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script> | |
| 22 | +<!-- bootstrap time picker --> | |
| 23 | +<script src="${BASE}/static/assets/plugins/timepicker/bootstrap-timepicker.min.js" type="text/javascript"></script> | |
| 24 | +<!-- iCheck 1.0.1 --> | |
| 25 | +<script src="${BASE}/static/assets/plugins/iCheck/icheck.min.js" type="text/javascript"></script> | |
| 26 | +<script src="${BASE}/static/assets/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script> | |
| 27 | + | |
| 28 | +<link rel="stylesheet" href="${BASE}/static/assets/plugins/fileinput/fileinput.css" /> | |
| 29 | +<link rel="stylesheet" href="${BASE}/static/assets/plugins/fileinput/fileinput.min.css" /> | |
| 30 | +<script src="${BASE}/static/assets/plugins/fileinput/fileinput.js"></script> | |
| 31 | +<script src="${BASE}/static/assets/plugins/fileinput/fileinput.min.js"></script> | |
| 32 | +<script src="${BASE}/static/assets/plugins/fileinput/fileinput_locale_zh.js"></script> | |
| 33 | + | |
| 34 | +<!-------直播系统所需 js 文件--> | |
| 35 | +<script src="${BASE}/static/assets/cnlive/js/all_live.js" type="text/javascript"></script> | |
| 36 | +<script src="${BASE}/static/assets/cnlive/js/live.js" type="text/javascript"></script> | |
| 37 | +<script src="${BASE}/static/assets/cnlive/js/room.js" type="text/javascript"></script> | |
| 38 | +<script src="${BASE}/static/assets/cnlive/js/channel.js" type="text/javascript"></script> | |
| 39 | +<script src="${BASE}/static/assets/cnlive/js/signal.js" type="text/javascript"></script> | |
| 40 | +<script src="${BASE}/static/assets/cnlive/js/wowza.js" type="text/javascript"></script> | |
| 41 | +<script src="${BASE}/static/assets/cnlive/js/activity.js" type="text/javascript"></script> | |
| 42 | +<script src="${BASE}/static/assets/cnlive/js/ajax_rest.js" type="text/javascript"></script> | |
| 43 | +<!-- cnlive validate --> | |
| 44 | +<script src="${BASE}/static/assets/plugins/validate/jquery.form.js"></script> | |
| 45 | +<script src="${BASE}/static/assets/plugins/validate/jquery.metadata.js"></script> | |
| 46 | +<script src="${BASE}/static/assets/plugins/validate/jquery.validate.js"></script> | |
| 47 | + | |
| 48 | +<script src="${BASE}/static/assets/plugins/easytree/easyTree.js"></script> | |
| 49 | +<script src="${BASE}/static/assets/cnlive/js/common.js"></script> | |
| 50 | +<script src="${BASE}/static/assets/cnlive/js/global.js"></script> | |
| 51 | +<script type="text/javascript"> | |
| 52 | + BASE = '${BASE}'; | |
| 53 | 53 | </script> |
| 54 | 54 | \ No newline at end of file | ... | ... |
src/main/webapp/pages/common/left.jsp
| 1 | -<%@ page language="java" pageEncoding="utf-8"%> | |
| 2 | -<%@ include file="/pages/common/taglib.jsp"%> | |
| 3 | -<aside class="main-sidebar"> | |
| 4 | - <section class="sidebar"> | |
| 5 | - <div class="user-panel"> | |
| 6 | - <div class="pull-left image"> | |
| 7 | - <img src="${BASE}/static/assets/dist/img/user2-160x160.jpg" | |
| 8 | - class="img-circle" alt="User Image" /> | |
| 9 | - </div> | |
| 10 | - <div class="pull-left info"> | |
| 11 | - <p> | |
| 12 | - <a href="${BASE}/index">刘基城</a> | |
| 13 | - </p> | |
| 14 | - <i class="fa fa-circle text-success"></i> | |
| 15 | - <c:if test="${sessionScope.roleId=='1'}">超级管理员</c:if> | |
| 16 | - <c:if test="${sessionScope.roleId=='0'}">普通用户</c:if> | |
| 17 | - <c:if test="${sessionScope.roleId=='2'}">总编室用户</c:if> | |
| 18 | - </div> | |
| 19 | - </div> | |
| 20 | - <ul class="sidebar-menu"> | |
| 21 | - <c:if test="${sessionScope.roleId=='1'}"> | |
| 22 | - <li class="header">导航栏</li> | |
| 23 | - <li> | |
| 24 | - <a href="${BASE}/switch"><i class="fa fa-circle-o text-blue"></i>全局切换</a> | |
| 25 | - </li> | |
| 26 | - <li> | |
| 27 | - <a href="${BASE}/channel/monitor/1"><i class="fa fa-circle-o text-yellow"></i>直播监控</a> | |
| 28 | - </li> | |
| 29 | - <li> | |
| 30 | - <a href="${BASE}/activity/preload"><i class="fa fa-circle-o"></i>新增活动</a> | |
| 31 | - </li> | |
| 32 | - <li> | |
| 33 | - <a href="${BASE}/activity/list/1"><i class="fa fa-circle-o text-red"></i>活动管理</a> | |
| 34 | - </li> | |
| 35 | - | |
| 36 | - <li class="header">系统设置</li> | |
| 37 | - <li> | |
| 38 | - <a href="${BASE}/channel/list/1"><i class="fa fa-circle-o text-green"></i>频道管理</a> | |
| 39 | - </li> | |
| 40 | - <li> | |
| 41 | - <a href="${BASE}/wowza/list/1"><i class="fa fa-circle-o text-blue"></i>播出服务管理</a> | |
| 42 | - </li> | |
| 43 | - <li> | |
| 44 | - <a href="${BASE}/signal/list/1"><i class="fa fa-circle-o text-red"></i>信源管理</a> | |
| 45 | - </li> | |
| 46 | - </c:if> | |
| 47 | - <c:if test="${sessionScope.roleId=='2'}"> | |
| 48 | - <li class="header">UGC直播审查</li> | |
| 49 | - <li> | |
| 50 | - <a href="${BASE}/user/list/1"><i class="fa fa-circle-o text-yellow"></i>主播管理</a> | |
| 51 | - </li> | |
| 52 | - <li> | |
| 53 | - <a href="${BASE}/check/list/1"><i class="fa fa-circle-o text-red"></i>直播审查</a> | |
| 54 | - </li> | |
| 55 | - <li> | |
| 56 | - <a href="${BASE}/video/check/1"><i class="fa fa-circle-o text-green"></i>点播审查</a> | |
| 57 | - </li> | |
| 58 | - <li> | |
| 59 | - <a href="${BASE}/live/alllive/1"><i class="fa fa-circle-o text-yellow"></i>直播管理</a> | |
| 60 | - </li> | |
| 61 | - <li> | |
| 62 | - <a href="${BASE}/word/list"><i class="fa fa-circle-o text-yellow"></i>敏感词管理</a> | |
| 63 | - </li> | |
| 64 | - </c:if> | |
| 65 | - </ul> | |
| 66 | - </section> | |
| 67 | - <!-- /.sidebar --> | |
| 1 | +<%@ page language="java" pageEncoding="utf-8"%> | |
| 2 | +<%@ include file="/pages/common/taglib.jsp"%> | |
| 3 | +<aside class="main-sidebar"> | |
| 4 | + <section class="sidebar"> | |
| 5 | + <div class="user-panel"> | |
| 6 | + <div class="pull-left image"> | |
| 7 | + <img src="${BASE}/static/assets/dist/img/user2-160x160.jpg" | |
| 8 | + class="img-circle" alt="User Image" /> | |
| 9 | + </div> | |
| 10 | + <div class="pull-left info"> | |
| 11 | + <p> | |
| 12 | + <a href="${BASE}/index">刘基城</a> | |
| 13 | + </p> | |
| 14 | + <i class="fa fa-circle text-success"></i> | |
| 15 | + <c:if test="${sessionScope.roleId=='1'}">超级管理员</c:if> | |
| 16 | + <c:if test="${sessionScope.roleId=='0'}">普通用户</c:if> | |
| 17 | + <c:if test="${sessionScope.roleId=='2'}">总编室用户</c:if> | |
| 18 | + </div> | |
| 19 | + </div> | |
| 20 | + <ul class="sidebar-menu"> | |
| 21 | + <c:if test="${sessionScope.roleId=='1'}"> | |
| 22 | + <li class="header">导航栏</li> | |
| 23 | + <li> | |
| 24 | + <a href="${BASE}/switch"><i class="fa fa-circle-o text-blue"></i>全局切换</a> | |
| 25 | + </li> | |
| 26 | + <li> | |
| 27 | + <a href="${BASE}/channel/monitor/1"><i class="fa fa-circle-o text-yellow"></i>直播监控</a> | |
| 28 | + </li> | |
| 29 | + <li> | |
| 30 | + <a href="${BASE}/activity/preload"><i class="fa fa-circle-o"></i>新增活动</a> | |
| 31 | + </li> | |
| 32 | + <li> | |
| 33 | + <a href="${BASE}/activity/list/1"><i class="fa fa-circle-o text-red"></i>活动管理</a> | |
| 34 | + </li> | |
| 35 | + | |
| 36 | + <li class="header">系统设置</li> | |
| 37 | + <li> | |
| 38 | + <a href="${BASE}/channel/list/1"><i class="fa fa-circle-o text-green"></i>频道管理</a> | |
| 39 | + </li> | |
| 40 | + <li> | |
| 41 | + <a href="${BASE}/wowza/list/1"><i class="fa fa-circle-o text-blue"></i>播出服务管理</a> | |
| 42 | + </li> | |
| 43 | + <li> | |
| 44 | + <a href="${BASE}/signal/list/1"><i class="fa fa-circle-o text-red"></i>信源管理</a> | |
| 45 | + </li> | |
| 46 | + </c:if> | |
| 47 | + <c:if test="${sessionScope.roleId=='2'}"> | |
| 48 | + <li class="header">UGC直播审查</li> | |
| 49 | + <li> | |
| 50 | + <a href="${BASE}/user/list/1"><i class="fa fa-circle-o text-yellow"></i>主播管理</a> | |
| 51 | + </li> | |
| 52 | + <li> | |
| 53 | + <a href="${BASE}/check/list/1"><i class="fa fa-circle-o text-red"></i>直播审查</a> | |
| 54 | + </li> | |
| 55 | + <li> | |
| 56 | + <a href="${BASE}/video/check/1"><i class="fa fa-circle-o text-green"></i>点播审查</a> | |
| 57 | + </li> | |
| 58 | + <li> | |
| 59 | + <a href="${BASE}/live/alllive/1"><i class="fa fa-circle-o text-yellow"></i>直播管理</a> | |
| 60 | + </li> | |
| 61 | + <li> | |
| 62 | + <a href="${BASE}/word/list"><i class="fa fa-circle-o text-yellow"></i>敏感词管理</a> | |
| 63 | + </li> | |
| 64 | + </c:if> | |
| 65 | + </ul> | |
| 66 | + </section> | |
| 67 | + <!-- /.sidebar --> | |
| 68 | 68 | </aside> |
| 69 | 69 | \ No newline at end of file | ... | ... |
src/main/webapp/pages/live/all_live_management.jsp
| 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" style="display: none" | |
| 22 | - id="info_tab_span"><i class="fa fa-bell-o"></i></small> | |
| 23 | - </h1> | |
| 24 | - | |
| 25 | - <ol class="breadcrumb"> | |
| 26 | - <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 27 | - <li class="active">直播管理</li> | |
| 28 | - </ol> | |
| 29 | - </section> | |
| 30 | - <!-- Main content --> | |
| 31 | - <section class="content"> | |
| 32 | - <div class="row"> | |
| 33 | - <div class="col-xs-12"> | |
| 34 | - <div class="box box-warning"> | |
| 35 | - <div class="box-header with-border"> | |
| 36 | - <h3 class="box-title"></h3> | |
| 37 | - <div class="box-tools"> | |
| 38 | - <div class="input-group"> | |
| 39 | - <form role="form" action="../../live/search/1" method="get"> | |
| 40 | - <div class="input-group"> | |
| 41 | - <input type="text" name="search_user_id" id="search_user_id" | |
| 42 | - class="form-control input-sm" style="width: 150px;" | |
| 43 | - placeholder="用户id" /> <input type="text" | |
| 44 | - name="search_title" id="search_title" | |
| 45 | - class="form-control input-sm" style="width: 150px;" | |
| 46 | - placeholder="活动名称" /> | |
| 47 | - <button type="submit" class="btn btn-sm btn-default"> | |
| 48 | - <i class="fa fa-search"></i>搜索 | |
| 49 | - </button> | |
| 50 | - </div> | |
| 51 | - </form> | |
| 52 | - </div> | |
| 53 | - </div> | |
| 54 | - </div> | |
| 55 | - <!-- /.box-header --> | |
| 56 | - <div class="box-body"> | |
| 57 | - <table class="table table-bordered"> | |
| 58 | - <tr> | |
| 59 | - <th>活动ID</th> | |
| 60 | - <th>stream_name</th> | |
| 61 | - <th>活动名称</th> | |
| 62 | - <th>开始时间</th> | |
| 63 | - <th>结束时间</th> | |
| 64 | - <th>状态</th> | |
| 65 | - <th>下线</th> | |
| 66 | - </tr> | |
| 67 | - <c:forEach var="item" items="${tLive.recordList}" | |
| 68 | - varStatus="stat"> | |
| 69 | - <tr> | |
| 70 | - <td>${item.id}</td> | |
| 71 | - <td>${item.t_user_id}_${item.uuid}</td> | |
| 72 | - <td>${item.title}</td> | |
| 73 | - <td><fmt:formatDate value="${item.start_time}" | |
| 74 | - pattern="yyyy-MM-dd HH:mm" /></td> | |
| 75 | - <td>${item.end_time}</td> | |
| 76 | - <td><c:if test="${item.t_status_id==0}"> | |
| 77 | - <span class="badge bg-green">未开始</span> | |
| 78 | - </c:if> <c:if test="${item.t_status_id==2}"> | |
| 79 | - <span class="badge bg-green">正常结束</span> | |
| 80 | - </c:if> <c:if test="${item.t_status_id==1}"> | |
| 81 | - <span class="badge bg-yellow">直播中</span> | |
| 82 | - </c:if> <c:if test="${item.t_status_id==-2}"> | |
| 83 | - <span class="badge bg-red">异常结束</span> | |
| 84 | - </c:if> | |
| 85 | - | |
| 86 | - <c:if test="${item.t_status_id==-3}"> | |
| 87 | - <span class="badge bg-yellow">已经下线</span> | |
| 88 | - </c:if> | |
| 89 | - | |
| 90 | - </td> | |
| 91 | - | |
| 92 | - <td> | |
| 93 | - <%-- <button type="button" class="btn btn-xs btn-success" id="down" onclick="t_live_close('${item.id}','${item.uuid}');"> | |
| 94 | - <i class="icon-upload"></i>下线 | |
| 95 | - </button> --%> | |
| 96 | - | |
| 97 | - <button class="btn btn-danger btn-sm" | |
| 98 | - onclick="t_live_close('${item.id}','${item.uuid}');"> | |
| 99 | - <i class="fa fa-close"></i> | |
| 100 | - </button> | |
| 101 | - </td> | |
| 102 | - </tr> | |
| 103 | - </c:forEach> | |
| 104 | - </table> | |
| 105 | - </div> | |
| 106 | - <!-- /.box-body --> | |
| 107 | - <div class="box-footer clearfix"> | |
| 108 | - <center> | |
| 109 | - <tag:pager id="product_pager" pager="${tLive}" /> | |
| 110 | - </center> | |
| 111 | - </div> | |
| 112 | - </div> | |
| 113 | - </div> | |
| 114 | - </div> | |
| 115 | - </section> | |
| 116 | - </div> | |
| 117 | - <%@ include file="/pages/common/bottom.jsp"%> | |
| 118 | - </div> | |
| 119 | - <%@ include file="/pages/common/js.jsp"%> | |
| 120 | -</body> | |
| 121 | -</html> | |
| 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" style="display: none" | |
| 22 | + id="info_tab_span"><i class="fa fa-bell-o"></i></small> | |
| 23 | + </h1> | |
| 24 | + | |
| 25 | + <ol class="breadcrumb"> | |
| 26 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 27 | + <li class="active">直播管理</li> | |
| 28 | + </ol> | |
| 29 | + </section> | |
| 30 | + <!-- Main content --> | |
| 31 | + <section class="content"> | |
| 32 | + <div class="row"> | |
| 33 | + <div class="col-xs-12"> | |
| 34 | + <div class="box box-warning"> | |
| 35 | + <div class="box-header with-border"> | |
| 36 | + <h3 class="box-title"></h3> | |
| 37 | + <div class="box-tools"> | |
| 38 | + <div class="input-group"> | |
| 39 | + <form role="form" action="../../live/search/1" method="get"> | |
| 40 | + <div class="input-group"> | |
| 41 | + <input type="text" name="search_user_id" id="search_user_id" | |
| 42 | + class="form-control input-sm" style="width: 150px;" | |
| 43 | + placeholder="用户id" /> <input type="text" | |
| 44 | + name="search_title" id="search_title" | |
| 45 | + class="form-control input-sm" style="width: 150px;" | |
| 46 | + placeholder="活动名称" /> | |
| 47 | + <button type="submit" class="btn btn-sm btn-default"> | |
| 48 | + <i class="fa fa-search"></i>搜索 | |
| 49 | + </button> | |
| 50 | + </div> | |
| 51 | + </form> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + </div> | |
| 55 | + <!-- /.box-header --> | |
| 56 | + <div class="box-body"> | |
| 57 | + <table class="table table-bordered"> | |
| 58 | + <tr> | |
| 59 | + <th>活动ID</th> | |
| 60 | + <th>stream_name</th> | |
| 61 | + <th>活动名称</th> | |
| 62 | + <th>开始时间</th> | |
| 63 | + <th>结束时间</th> | |
| 64 | + <th>状态</th> | |
| 65 | + <th>下线</th> | |
| 66 | + </tr> | |
| 67 | + <c:forEach var="item" items="${tLive.recordList}" | |
| 68 | + varStatus="stat"> | |
| 69 | + <tr> | |
| 70 | + <td>${item.id}</td> | |
| 71 | + <td>${item.t_user_id}_${item.uuid}</td> | |
| 72 | + <td>${item.title}</td> | |
| 73 | + <td><fmt:formatDate value="${item.start_time}" | |
| 74 | + pattern="yyyy-MM-dd HH:mm" /></td> | |
| 75 | + <td>${item.end_time}</td> | |
| 76 | + <td><c:if test="${item.t_status_id==0}"> | |
| 77 | + <span class="badge bg-green">未开始</span> | |
| 78 | + </c:if> <c:if test="${item.t_status_id==2}"> | |
| 79 | + <span class="badge bg-green">正常结束</span> | |
| 80 | + </c:if> <c:if test="${item.t_status_id==1}"> | |
| 81 | + <span class="badge bg-yellow">直播中</span> | |
| 82 | + </c:if> <c:if test="${item.t_status_id==-2}"> | |
| 83 | + <span class="badge bg-red">异常结束</span> | |
| 84 | + </c:if> | |
| 85 | + | |
| 86 | + <c:if test="${item.t_status_id==-3}"> | |
| 87 | + <span class="badge bg-yellow">已经下线</span> | |
| 88 | + </c:if> | |
| 89 | + | |
| 90 | + </td> | |
| 91 | + | |
| 92 | + <td> | |
| 93 | + <%-- <button type="button" class="btn btn-xs btn-success" id="down" onclick="t_live_close('${item.id}','${item.uuid}');"> | |
| 94 | + <i class="icon-upload"></i>下线 | |
| 95 | + </button> --%> | |
| 96 | + | |
| 97 | + <button class="btn btn-danger btn-sm" | |
| 98 | + onclick="t_live_close('${item.id}','${item.uuid}');"> | |
| 99 | + <i class="fa fa-close"></i> | |
| 100 | + </button> | |
| 101 | + </td> | |
| 102 | + </tr> | |
| 103 | + </c:forEach> | |
| 104 | + </table> | |
| 105 | + </div> | |
| 106 | + <!-- /.box-body --> | |
| 107 | + <div class="box-footer clearfix"> | |
| 108 | + <center> | |
| 109 | + <tag:pager id="product_pager" pager="${tLive}" /> | |
| 110 | + </center> | |
| 111 | + </div> | |
| 112 | + </div> | |
| 113 | + </div> | |
| 114 | + </div> | |
| 115 | + </section> | |
| 116 | + </div> | |
| 117 | + <%@ include file="/pages/common/bottom.jsp"%> | |
| 118 | + </div> | |
| 119 | + <%@ include file="/pages/common/js.jsp"%> | |
| 120 | +</body> | |
| 121 | +</html> | ... | ... |
src/main/webapp/pages/live/live_add.jsp
| 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.name}</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 | - | |
| 46 | - <form id="create_form" enctype="multipart/form-data" method="post" > | |
| 47 | - | |
| 48 | - <div class="row"> | |
| 49 | - <!-- right column --> | |
| 50 | - <div class="col-md-12"> | |
| 51 | - <!-- general form elements disabled --> | |
| 52 | - <div class="box box-warning"> | |
| 53 | - <div class="box-body"> | |
| 54 | - <div class="form-group"> | |
| 55 | - <label> 活动名称 </label> | |
| 56 | - <div class="input-group"> | |
| 57 | - <span class="input-group-addon"><i class="fa fa-font"></i> | |
| 58 | - </span> <input type="text" value="${tActivity.name }" name="name" | |
| 59 | - id="name" class="form-control"> | |
| 60 | - <input type="text" id="activity_id" name="activity_id" value="${tActivity.id}" hidden=""> | |
| 61 | - </div> | |
| 62 | - </div> | |
| 63 | - <div class="form-group"> | |
| 64 | - <label> 直播时间 </label> | |
| 65 | - <div class="row"> | |
| 66 | - <div class="col-lg-6"> | |
| 67 | - <div class="input-group"> | |
| 68 | - <span class="input-group-addon"> 开始时间 </span> <input | |
| 69 | - type="text" class="form-control form_datetime" | |
| 70 | - value="<fmt:formatDate value="${tActivity.start_time}" pattern="yyyy-MM-dd HH:mm"/>" | |
| 71 | - name="start_time" id="start_time" | |
| 72 | - data-inputmask="'alias': 'yyyy-MM-dd HH:mm'" data-mask="" /> | |
| 73 | - </div> | |
| 74 | - </div> | |
| 75 | - <div class="col-lg-6"> | |
| 76 | - <div class="input-group"> | |
| 77 | - <span class="input-group-addon"> 结束时间</span> <input | |
| 78 | - type="text" class="form-control form_datetime" | |
| 79 | - value="<fmt:formatDate value="${tActivity.end_time}" pattern="yyyy-MM-dd HH:mm"/>" | |
| 80 | - name="end_time" id="end_time" | |
| 81 | - data-inputmask="'alias': 'yyyy-MM-dd HH:mm'" data-mask=""> | |
| 82 | - </div> | |
| 83 | - </div> | |
| 84 | - </div> | |
| 85 | - </div> | |
| 86 | - <div class="form-group"> | |
| 87 | - | |
| 88 | - <label>封面海报 </label> | |
| 89 | - <div class="input-group"> | |
| 90 | - <span class="input-group-addon"><i | |
| 91 | - class="fa fa-file-word-o"></i> </span> <input id="input-22" type="file" name="input-22" accept="image/*" class="file-loading"> | |
| 92 | - | |
| 93 | - </div> | |
| 94 | - </div> | |
| 95 | - <div class="form-group"> | |
| 96 | - <label> 播出直播间 </label> | |
| 97 | - <div class="box box-warning"> | |
| 98 | - <div class="box-body"> | |
| 99 | - <div class="form-group"> | |
| 100 | - | |
| 101 | - <select class="form-control" name="t_default_video_id" | |
| 102 | - id="t_default_video_id"> | |
| 103 | - | |
| 104 | - <c:forEach var="item" items="${tRooms}" | |
| 105 | - varStatus="stat"> | |
| 106 | - <option id="t_room_id_${item.id}" ${item.id==tLive.t_room_id ? 'selected="selected"':''} value="${item.id}">${item.name}</option> | |
| 107 | - </c:forEach> | |
| 108 | - </select> | |
| 109 | - </div> | |
| 110 | - </div> | |
| 111 | - </div> | |
| 112 | - </div> | |
| 113 | - | |
| 114 | - <div class="form-group"> | |
| 115 | - | |
| 116 | - <label>活动简述 </label> | |
| 117 | - | |
| 118 | - <div class="input-group"> | |
| 119 | - <span class="input-group-addon"><i | |
| 120 | - class="fa fa-file-word-o"></i> </span> <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script> | |
| 121 | - </div> | |
| 122 | - </div> | |
| 123 | - <div class="box-footer"> | |
| 124 | - <button type="submit" id="t_activity_save_btn" | |
| 125 | - name="t_activity_save_btn" class="btn btn-success"> | |
| 126 | - <i class="fa fa-save "></i> 保存 | |
| 127 | - </button> | |
| 128 | - </div> | |
| 129 | - </div> | |
| 130 | - </div> | |
| 131 | - </div> | |
| 132 | - </div> | |
| 133 | - </form> | |
| 134 | - </div> | |
| 135 | - </section> | |
| 136 | - </div> | |
| 137 | - </div> | |
| 138 | - <%@ include file="/pages/common/bottom.jsp"%> | |
| 139 | -</div> | |
| 140 | - <!-- 信号选择结束 --> | |
| 141 | - <%@ include file="/pages/common/js.jsp"%> | |
| 142 | - | |
| 143 | - <script type="text/javascript"> | |
| 144 | - | |
| 145 | - | |
| 146 | - $(function () { | |
| 147 | - //Money Euro | |
| 148 | - $("[data-mask]").inputmask(); | |
| 149 | - }); | |
| 150 | - | |
| 151 | - $(function () { | |
| 152 | - $("#datemask").inputmask("dd/mm/yyyy", {"placeholder": "dd/mm/yyyy"}); | |
| 153 | - //Datemask2 mm/dd/yyyy | |
| 154 | - $("#datemask2").inputmask("mm/dd/yyyy", {"placeholder": "mm/dd/yyyy"}); | |
| 155 | - //Money Euro | |
| 156 | - $("[data-mask]").inputmask(); | |
| 157 | - | |
| 158 | - //Date range picker | |
| 159 | - $('#reservation').daterangepicker(); | |
| 160 | - //Date range picker with time picker | |
| 161 | - $('#reservationtime').daterangepicker({timePicker: true, timePickerIncrement: 30, format: 'MM/DD/YYYY h:mm A'}); | |
| 162 | - //Date range as a button | |
| 163 | - $('#daterange-btn').daterangepicker( | |
| 164 | - { | |
| 165 | - ranges: { | |
| 166 | - 'Today': [moment(), moment()], | |
| 167 | - 'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)], | |
| 168 | - 'Last 7 Days': [moment().subtract('days', 6), moment()], | |
| 169 | - 'Last 30 Days': [moment().subtract('days', 29), moment()], | |
| 170 | - 'This Month': [moment().startOf('month'), moment().endOf('month')], | |
| 171 | - 'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')] | |
| 172 | - }, | |
| 173 | - startDate: moment().subtract('days', 29), | |
| 174 | - endDate: moment() | |
| 175 | - }, | |
| 176 | - function (start, end) { | |
| 177 | - $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')); | |
| 178 | - } | |
| 179 | - ); | |
| 180 | - }); | |
| 181 | - </script> | |
| 182 | - | |
| 183 | - | |
| 184 | - <!-- Le javascript | |
| 185 | - ================================================== --> | |
| 186 | - <script | |
| 187 | - src="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script> | |
| 188 | - | |
| 189 | - <script type="text/javascript"> | |
| 190 | - $(".form_datetime").datetimepicker({ | |
| 191 | - //format: "dd MM yyyy - hh:ii", | |
| 192 | - format: "yyyy-mm-dd hh:ii", | |
| 193 | - autoclose: true, | |
| 194 | - todayBtn: true, | |
| 195 | - pickerPosition: "bottom-right" | |
| 196 | - }); | |
| 197 | -</script> | |
| 198 | - | |
| 199 | -<script type="text/javascript"> | |
| 200 | - | |
| 201 | - //实例化编辑器 | |
| 202 | - //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例 | |
| 203 | - var ue = UE.getEditor('editor',{ | |
| 204 | - autoHeightEnabled: true, | |
| 205 | - autoFloatEnabled: true | |
| 206 | - }); | |
| 207 | - | |
| 208 | - | |
| 209 | - function isFocus(e){ | |
| 210 | - alert(UE.getEditor('editor').isFocus()); | |
| 211 | - UE.dom.domUtils.preventDefault(e) | |
| 212 | - } | |
| 213 | - function setblur(e){ | |
| 214 | - UE.getEditor('editor').blur(); | |
| 215 | - UE.dom.domUtils.preventDefault(e) | |
| 216 | - } | |
| 217 | - function insertHtml() { | |
| 218 | - var value = prompt('插入html代码', ''); | |
| 219 | - UE.getEditor('editor').execCommand('insertHtml', value) | |
| 220 | - } | |
| 221 | - function createEditor() { | |
| 222 | - enableBtn(); | |
| 223 | - UE.getEditor('editor'); | |
| 224 | - } | |
| 225 | - function getAllHtml() { | |
| 226 | - alert(UE.getEditor('editor').getAllHtml()) | |
| 227 | - } | |
| 228 | - function getContent() { | |
| 229 | - var arr = []; | |
| 230 | - arr.push("使用editor.getContent()方法可以获得编辑器的内容"); | |
| 231 | - arr.push("内容为:"); | |
| 232 | - arr.push(UE.getEditor('editor').getContent()); | |
| 233 | - alert(arr.join("\n")); | |
| 234 | - } | |
| 235 | - function getPlainTxt() { | |
| 236 | - var arr = []; | |
| 237 | - arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容"); | |
| 238 | - arr.push("内容为:"); | |
| 239 | - arr.push(UE.getEditor('editor').getPlainTxt()); | |
| 240 | - alert(arr.join('\n')) | |
| 241 | - } | |
| 242 | - function setContent(isAppendTo) { | |
| 243 | - var arr = []; | |
| 244 | - arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容"); | |
| 245 | - UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo); | |
| 246 | - alert(arr.join("\n")); | |
| 247 | - } | |
| 248 | - function setDisabled() { | |
| 249 | - UE.getEditor('editor').setDisabled('fullscreen'); | |
| 250 | - disableBtn("enable"); | |
| 251 | - } | |
| 252 | - | |
| 253 | - function setEnabled() { | |
| 254 | - UE.getEditor('editor').setEnabled(); | |
| 255 | - enableBtn(); | |
| 256 | - } | |
| 257 | - | |
| 258 | - function getText() { | |
| 259 | - //当你点击按钮时编辑区域已经失去了焦点,如果直接用getText将不会得到内容,所以要在选回来,然后取得内容 | |
| 260 | - var range = UE.getEditor('editor').selection.getRange(); | |
| 261 | - range.select(); | |
| 262 | - var txt = UE.getEditor('editor').selection.getText(); | |
| 263 | - alert(txt) | |
| 264 | - } | |
| 265 | - | |
| 266 | - function getContentTxt() { | |
| 267 | - var arr = []; | |
| 268 | - arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容"); | |
| 269 | - arr.push("编辑器的纯文本内容为:"); | |
| 270 | - arr.push(UE.getEditor('editor').getContentTxt()); | |
| 271 | - alert(arr.join("\n")); | |
| 272 | - } | |
| 273 | - function hasContent() { | |
| 274 | - var arr = []; | |
| 275 | - arr.push("使用editor.hasContents()方法判断编辑器里是否有内容"); | |
| 276 | - arr.push("判断结果为:"); | |
| 277 | - arr.push(UE.getEditor('editor').hasContents()); | |
| 278 | - alert(arr.join("\n")); | |
| 279 | - } | |
| 280 | - function setFocus() { | |
| 281 | - UE.getEditor('editor').focus(); | |
| 282 | - } | |
| 283 | - function deleteEditor() { | |
| 284 | - disableBtn(); | |
| 285 | - UE.getEditor('editor').destroy(); | |
| 286 | - } | |
| 287 | - function disableBtn(str) { | |
| 288 | - var div = document.getElementById('btns'); | |
| 289 | - var btns = UE.dom.domUtils.getElementsByTagName(div, "button"); | |
| 290 | - for (var i = 0, btn; btn = btns[i++];) { | |
| 291 | - if (btn.id == str) { | |
| 292 | - UE.dom.domUtils.removeAttributes(btn, ["disabled"]); | |
| 293 | - } else { | |
| 294 | - btn.setAttribute("disabled", "true"); | |
| 295 | - } | |
| 296 | - } | |
| 297 | - } | |
| 298 | - function enableBtn() { | |
| 299 | - var div = document.getElementById('btns'); | |
| 300 | - var btns = UE.dom.domUtils.getElementsByTagName(div, "button"); | |
| 301 | - for (var i = 0, btn; btn = btns[i++];) { | |
| 302 | - UE.dom.domUtils.removeAttributes(btn, ["disabled"]); | |
| 303 | - } | |
| 304 | - } | |
| 305 | - | |
| 306 | - function getLocalData () { | |
| 307 | - alert(UE.getEditor('editor').execCommand( "getlocaldata" )); | |
| 308 | - } | |
| 309 | - | |
| 310 | - function clearLocalData () { | |
| 311 | - UE.getEditor('editor').execCommand( "clearlocaldata" ); | |
| 312 | - alert("已清空草稿箱") | |
| 313 | - } | |
| 314 | - | |
| 315 | - $(document).on('ready', function() { | |
| 316 | - $("#input-22").fileinput({ | |
| 317 | - previewFileType : "image", | |
| 318 | - browseClass : "btn btn-success", | |
| 319 | - browseLabel : "Pick Image", | |
| 320 | - browseIcon : "<i class=\"glyphicon glyphicon-picture\"></i> ", | |
| 321 | - removeClass : "btn btn-danger", | |
| 322 | - removeLabel : "Delete", | |
| 323 | - removeIcon : "<i class=\"glyphicon glyphicon-trash\"></i> ", | |
| 324 | - uploadClass : "btn btn-info", | |
| 325 | - uploadLabel : "Upload", | |
| 326 | - uploadIcon : "<i class=\"glyphicon glyphicon-upload\"></i> " | |
| 327 | - }); | |
| 328 | - | |
| 329 | - $(function() { | |
| 330 | - $('#create_form').ajaxForm({ | |
| 331 | - type : 'post', | |
| 332 | - url : '../live/save', | |
| 333 | - enctype : 'multipart/form-data', | |
| 334 | - beforeSubmit : function() { | |
| 335 | - return true; | |
| 336 | - }, | |
| 337 | - error : function(XMLHttpRequest, textStatus, errorThrown) { | |
| 338 | - alert("错误"); | |
| 339 | - }, | |
| 340 | - success : function(result) { | |
| 341 | - location.href = '../live/list/1'; | |
| 342 | - } | |
| 343 | - }); | |
| 344 | - }); | |
| 345 | - }); | |
| 346 | - | |
| 347 | - /* $(function() { | |
| 348 | - $('#create_form').ajaxForm({ | |
| 349 | - type : 'post', | |
| 350 | - url : '../live/save', | |
| 351 | - enctype : 'multipart/form-data', | |
| 352 | - beforeSubmit : function() { | |
| 353 | - var cms_column_ref_id=$("#input-22").val(); | |
| 354 | - if(cms_column_ref_id==''){ | |
| 355 | - alert("请输入栏目名称,点击获取,然后选择!"); | |
| 356 | - return false; | |
| 357 | - } | |
| 358 | - }, | |
| 359 | - error : function(XMLHttpRequest, textStatus, errorThrown) { | |
| 360 | - alert("错误"); | |
| 361 | - }, | |
| 362 | - success : function(result) { | |
| 363 | - location.href = '../live/list/1'; | |
| 364 | - } | |
| 365 | - }); | |
| 366 | - }); | |
| 367 | - */ | |
| 368 | - | |
| 369 | -</script> | |
| 370 | -</body> | |
| 371 | -</html> | |
| 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.name}</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 | + | |
| 46 | + <form id="create_form" enctype="multipart/form-data" method="post" > | |
| 47 | + | |
| 48 | + <div class="row"> | |
| 49 | + <!-- right column --> | |
| 50 | + <div class="col-md-12"> | |
| 51 | + <!-- general form elements disabled --> | |
| 52 | + <div class="box box-warning"> | |
| 53 | + <div class="box-body"> | |
| 54 | + <div class="form-group"> | |
| 55 | + <label> 活动名称 </label> | |
| 56 | + <div class="input-group"> | |
| 57 | + <span class="input-group-addon"><i class="fa fa-font"></i> | |
| 58 | + </span> <input type="text" value="${tActivity.name }" name="name" | |
| 59 | + id="name" class="form-control"> | |
| 60 | + <input type="text" id="activity_id" name="activity_id" value="${tActivity.id}" hidden=""> | |
| 61 | + </div> | |
| 62 | + </div> | |
| 63 | + <div class="form-group"> | |
| 64 | + <label> 直播时间 </label> | |
| 65 | + <div class="row"> | |
| 66 | + <div class="col-lg-6"> | |
| 67 | + <div class="input-group"> | |
| 68 | + <span class="input-group-addon"> 开始时间 </span> <input | |
| 69 | + type="text" class="form-control form_datetime" | |
| 70 | + value="<fmt:formatDate value="${tActivity.start_time}" pattern="yyyy-MM-dd HH:mm"/>" | |
| 71 | + name="start_time" id="start_time" | |
| 72 | + data-inputmask="'alias': 'yyyy-MM-dd HH:mm'" data-mask="" /> | |
| 73 | + </div> | |
| 74 | + </div> | |
| 75 | + <div class="col-lg-6"> | |
| 76 | + <div class="input-group"> | |
| 77 | + <span class="input-group-addon"> 结束时间</span> <input | |
| 78 | + type="text" class="form-control form_datetime" | |
| 79 | + value="<fmt:formatDate value="${tActivity.end_time}" pattern="yyyy-MM-dd HH:mm"/>" | |
| 80 | + name="end_time" id="end_time" | |
| 81 | + data-inputmask="'alias': 'yyyy-MM-dd HH:mm'" data-mask=""> | |
| 82 | + </div> | |
| 83 | + </div> | |
| 84 | + </div> | |
| 85 | + </div> | |
| 86 | + <div class="form-group"> | |
| 87 | + | |
| 88 | + <label>封面海报 </label> | |
| 89 | + <div class="input-group"> | |
| 90 | + <span class="input-group-addon"><i | |
| 91 | + class="fa fa-file-word-o"></i> </span> <input id="input-22" type="file" name="input-22" accept="image/*" class="file-loading"> | |
| 92 | + | |
| 93 | + </div> | |
| 94 | + </div> | |
| 95 | + <div class="form-group"> | |
| 96 | + <label> 播出直播间 </label> | |
| 97 | + <div class="box box-warning"> | |
| 98 | + <div class="box-body"> | |
| 99 | + <div class="form-group"> | |
| 100 | + | |
| 101 | + <select class="form-control" name="t_default_video_id" | |
| 102 | + id="t_default_video_id"> | |
| 103 | + | |
| 104 | + <c:forEach var="item" items="${tRooms}" | |
| 105 | + varStatus="stat"> | |
| 106 | + <option id="t_room_id_${item.id}" ${item.id==tLive.t_room_id ? 'selected="selected"':''} value="${item.id}">${item.name}</option> | |
| 107 | + </c:forEach> | |
| 108 | + </select> | |
| 109 | + </div> | |
| 110 | + </div> | |
| 111 | + </div> | |
| 112 | + </div> | |
| 113 | + | |
| 114 | + <div class="form-group"> | |
| 115 | + | |
| 116 | + <label>活动简述 </label> | |
| 117 | + | |
| 118 | + <div class="input-group"> | |
| 119 | + <span class="input-group-addon"><i | |
| 120 | + class="fa fa-file-word-o"></i> </span> <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script> | |
| 121 | + </div> | |
| 122 | + </div> | |
| 123 | + <div class="box-footer"> | |
| 124 | + <button type="submit" id="t_activity_save_btn" | |
| 125 | + name="t_activity_save_btn" class="btn btn-success"> | |
| 126 | + <i class="fa fa-save "></i> 保存 | |
| 127 | + </button> | |
| 128 | + </div> | |
| 129 | + </div> | |
| 130 | + </div> | |
| 131 | + </div> | |
| 132 | + </div> | |
| 133 | + </form> | |
| 134 | + </div> | |
| 135 | + </section> | |
| 136 | + </div> | |
| 137 | + </div> | |
| 138 | + <%@ include file="/pages/common/bottom.jsp"%> | |
| 139 | +</div> | |
| 140 | + <!-- 信号选择结束 --> | |
| 141 | + <%@ include file="/pages/common/js.jsp"%> | |
| 142 | + | |
| 143 | + <script type="text/javascript"> | |
| 144 | + | |
| 145 | + | |
| 146 | + $(function () { | |
| 147 | + //Money Euro | |
| 148 | + $("[data-mask]").inputmask(); | |
| 149 | + }); | |
| 150 | + | |
| 151 | + $(function () { | |
| 152 | + $("#datemask").inputmask("dd/mm/yyyy", {"placeholder": "dd/mm/yyyy"}); | |
| 153 | + //Datemask2 mm/dd/yyyy | |
| 154 | + $("#datemask2").inputmask("mm/dd/yyyy", {"placeholder": "mm/dd/yyyy"}); | |
| 155 | + //Money Euro | |
| 156 | + $("[data-mask]").inputmask(); | |
| 157 | + | |
| 158 | + //Date range picker | |
| 159 | + $('#reservation').daterangepicker(); | |
| 160 | + //Date range picker with time picker | |
| 161 | + $('#reservationtime').daterangepicker({timePicker: true, timePickerIncrement: 30, format: 'MM/DD/YYYY h:mm A'}); | |
| 162 | + //Date range as a button | |
| 163 | + $('#daterange-btn').daterangepicker( | |
| 164 | + { | |
| 165 | + ranges: { | |
| 166 | + 'Today': [moment(), moment()], | |
| 167 | + 'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)], | |
| 168 | + 'Last 7 Days': [moment().subtract('days', 6), moment()], | |
| 169 | + 'Last 30 Days': [moment().subtract('days', 29), moment()], | |
| 170 | + 'This Month': [moment().startOf('month'), moment().endOf('month')], | |
| 171 | + 'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')] | |
| 172 | + }, | |
| 173 | + startDate: moment().subtract('days', 29), | |
| 174 | + endDate: moment() | |
| 175 | + }, | |
| 176 | + function (start, end) { | |
| 177 | + $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')); | |
| 178 | + } | |
| 179 | + ); | |
| 180 | + }); | |
| 181 | + </script> | |
| 182 | + | |
| 183 | + | |
| 184 | + <!-- Le javascript | |
| 185 | + ================================================== --> | |
| 186 | + <script | |
| 187 | + src="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script> | |
| 188 | + | |
| 189 | + <script type="text/javascript"> | |
| 190 | + $(".form_datetime").datetimepicker({ | |
| 191 | + //format: "dd MM yyyy - hh:ii", | |
| 192 | + format: "yyyy-mm-dd hh:ii", | |
| 193 | + autoclose: true, | |
| 194 | + todayBtn: true, | |
| 195 | + pickerPosition: "bottom-right" | |
| 196 | + }); | |
| 197 | +</script> | |
| 198 | + | |
| 199 | +<script type="text/javascript"> | |
| 200 | + | |
| 201 | + //实例化编辑器 | |
| 202 | + //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例 | |
| 203 | + var ue = UE.getEditor('editor',{ | |
| 204 | + autoHeightEnabled: true, | |
| 205 | + autoFloatEnabled: true | |
| 206 | + }); | |
| 207 | + | |
| 208 | + | |
| 209 | + function isFocus(e){ | |
| 210 | + alert(UE.getEditor('editor').isFocus()); | |
| 211 | + UE.dom.domUtils.preventDefault(e) | |
| 212 | + } | |
| 213 | + function setblur(e){ | |
| 214 | + UE.getEditor('editor').blur(); | |
| 215 | + UE.dom.domUtils.preventDefault(e) | |
| 216 | + } | |
| 217 | + function insertHtml() { | |
| 218 | + var value = prompt('插入html代码', ''); | |
| 219 | + UE.getEditor('editor').execCommand('insertHtml', value) | |
| 220 | + } | |
| 221 | + function createEditor() { | |
| 222 | + enableBtn(); | |
| 223 | + UE.getEditor('editor'); | |
| 224 | + } | |
| 225 | + function getAllHtml() { | |
| 226 | + alert(UE.getEditor('editor').getAllHtml()) | |
| 227 | + } | |
| 228 | + function getContent() { | |
| 229 | + var arr = []; | |
| 230 | + arr.push("使用editor.getContent()方法可以获得编辑器的内容"); | |
| 231 | + arr.push("内容为:"); | |
| 232 | + arr.push(UE.getEditor('editor').getContent()); | |
| 233 | + alert(arr.join("\n")); | |
| 234 | + } | |
| 235 | + function getPlainTxt() { | |
| 236 | + var arr = []; | |
| 237 | + arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容"); | |
| 238 | + arr.push("内容为:"); | |
| 239 | + arr.push(UE.getEditor('editor').getPlainTxt()); | |
| 240 | + alert(arr.join('\n')) | |
| 241 | + } | |
| 242 | + function setContent(isAppendTo) { | |
| 243 | + var arr = []; | |
| 244 | + arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容"); | |
| 245 | + UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo); | |
| 246 | + alert(arr.join("\n")); | |
| 247 | + } | |
| 248 | + function setDisabled() { | |
| 249 | + UE.getEditor('editor').setDisabled('fullscreen'); | |
| 250 | + disableBtn("enable"); | |
| 251 | + } | |
| 252 | + | |
| 253 | + function setEnabled() { | |
| 254 | + UE.getEditor('editor').setEnabled(); | |
| 255 | + enableBtn(); | |
| 256 | + } | |
| 257 | + | |
| 258 | + function getText() { | |
| 259 | + //当你点击按钮时编辑区域已经失去了焦点,如果直接用getText将不会得到内容,所以要在选回来,然后取得内容 | |
| 260 | + var range = UE.getEditor('editor').selection.getRange(); | |
| 261 | + range.select(); | |
| 262 | + var txt = UE.getEditor('editor').selection.getText(); | |
| 263 | + alert(txt) | |
| 264 | + } | |
| 265 | + | |
| 266 | + function getContentTxt() { | |
| 267 | + var arr = []; | |
| 268 | + arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容"); | |
| 269 | + arr.push("编辑器的纯文本内容为:"); | |
| 270 | + arr.push(UE.getEditor('editor').getContentTxt()); | |
| 271 | + alert(arr.join("\n")); | |
| 272 | + } | |
| 273 | + function hasContent() { | |
| 274 | + var arr = []; | |
| 275 | + arr.push("使用editor.hasContents()方法判断编辑器里是否有内容"); | |
| 276 | + arr.push("判断结果为:"); | |
| 277 | + arr.push(UE.getEditor('editor').hasContents()); | |
| 278 | + alert(arr.join("\n")); | |
| 279 | + } | |
| 280 | + function setFocus() { | |
| 281 | + UE.getEditor('editor').focus(); | |
| 282 | + } | |
| 283 | + function deleteEditor() { | |
| 284 | + disableBtn(); | |
| 285 | + UE.getEditor('editor').destroy(); | |
| 286 | + } | |
| 287 | + function disableBtn(str) { | |
| 288 | + var div = document.getElementById('btns'); | |
| 289 | + var btns = UE.dom.domUtils.getElementsByTagName(div, "button"); | |
| 290 | + for (var i = 0, btn; btn = btns[i++];) { | |
| 291 | + if (btn.id == str) { | |
| 292 | + UE.dom.domUtils.removeAttributes(btn, ["disabled"]); | |
| 293 | + } else { | |
| 294 | + btn.setAttribute("disabled", "true"); | |
| 295 | + } | |
| 296 | + } | |
| 297 | + } | |
| 298 | + function enableBtn() { | |
| 299 | + var div = document.getElementById('btns'); | |
| 300 | + var btns = UE.dom.domUtils.getElementsByTagName(div, "button"); | |
| 301 | + for (var i = 0, btn; btn = btns[i++];) { | |
| 302 | + UE.dom.domUtils.removeAttributes(btn, ["disabled"]); | |
| 303 | + } | |
| 304 | + } | |
| 305 | + | |
| 306 | + function getLocalData () { | |
| 307 | + alert(UE.getEditor('editor').execCommand( "getlocaldata" )); | |
| 308 | + } | |
| 309 | + | |
| 310 | + function clearLocalData () { | |
| 311 | + UE.getEditor('editor').execCommand( "clearlocaldata" ); | |
| 312 | + alert("已清空草稿箱") | |
| 313 | + } | |
| 314 | + | |
| 315 | + $(document).on('ready', function() { | |
| 316 | + $("#input-22").fileinput({ | |
| 317 | + previewFileType : "image", | |
| 318 | + browseClass : "btn btn-success", | |
| 319 | + browseLabel : "Pick Image", | |
| 320 | + browseIcon : "<i class=\"glyphicon glyphicon-picture\"></i> ", | |
| 321 | + removeClass : "btn btn-danger", | |
| 322 | + removeLabel : "Delete", | |
| 323 | + removeIcon : "<i class=\"glyphicon glyphicon-trash\"></i> ", | |
| 324 | + uploadClass : "btn btn-info", | |
| 325 | + uploadLabel : "Upload", | |
| 326 | + uploadIcon : "<i class=\"glyphicon glyphicon-upload\"></i> " | |
| 327 | + }); | |
| 328 | + | |
| 329 | + $(function() { | |
| 330 | + $('#create_form').ajaxForm({ | |
| 331 | + type : 'post', | |
| 332 | + url : '../live/save', | |
| 333 | + enctype : 'multipart/form-data', | |
| 334 | + beforeSubmit : function() { | |
| 335 | + return true; | |
| 336 | + }, | |
| 337 | + error : function(XMLHttpRequest, textStatus, errorThrown) { | |
| 338 | + alert("错误"); | |
| 339 | + }, | |
| 340 | + success : function(result) { | |
| 341 | + location.href = '../live/list/1'; | |
| 342 | + } | |
| 343 | + }); | |
| 344 | + }); | |
| 345 | + }); | |
| 346 | + | |
| 347 | + /* $(function() { | |
| 348 | + $('#create_form').ajaxForm({ | |
| 349 | + type : 'post', | |
| 350 | + url : '../live/save', | |
| 351 | + enctype : 'multipart/form-data', | |
| 352 | + beforeSubmit : function() { | |
| 353 | + var cms_column_ref_id=$("#input-22").val(); | |
| 354 | + if(cms_column_ref_id==''){ | |
| 355 | + alert("请输入栏目名称,点击获取,然后选择!"); | |
| 356 | + return false; | |
| 357 | + } | |
| 358 | + }, | |
| 359 | + error : function(XMLHttpRequest, textStatus, errorThrown) { | |
| 360 | + alert("错误"); | |
| 361 | + }, | |
| 362 | + success : function(result) { | |
| 363 | + location.href = '../live/list/1'; | |
| 364 | + } | |
| 365 | + }); | |
| 366 | + }); | |
| 367 | + */ | |
| 368 | + | |
| 369 | +</script> | |
| 370 | +</body> | |
| 371 | +</html> | ... | ... |
src/main/webapp/pages/live/live_management.jsp
| 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 | -<!-- | |
| 14 | -<body class="skin-blue fixed ">--> | |
| 15 | -<body class="skin-blue sidebar-mini"> | |
| 16 | - <div class="wrapper"> | |
| 17 | - <%@ include file="/pages/common/top.jsp"%> | |
| 18 | - <%@ include file="/pages/common/left.jsp"%> | |
| 19 | - <div class="content-wrapper"> | |
| 20 | - <!-- Content Header (Page header) --> | |
| 21 | - <section class="content-header"> | |
| 22 | - <h1> | |
| 23 | - 活动管理<small><a href="../../live/preload"><i | |
| 24 | - class="fa fa-plus"></i>新增活动</a> </small> | |
| 25 | - <small class="label label-warning" style="display: none" | |
| 26 | - id="info_tab_span"><i class="fa fa-bell-o"></i></small> | |
| 27 | - </h1> | |
| 28 | - | |
| 29 | - <ol class="breadcrumb"> | |
| 30 | - <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 31 | - <li class="active">活动管理</li> | |
| 32 | - </ol> | |
| 33 | - </section> | |
| 34 | - <!-- Main content --> | |
| 35 | - <section class="content"> | |
| 36 | - <div class="row"> | |
| 37 | - <div class="col-xs-12"> | |
| 38 | - <div class="box box-warning"> | |
| 39 | - <div class="box-header with-border"> | |
| 40 | - <h3 class="box-title"></h3> | |
| 41 | - <div class="box-tools"> | |
| 42 | - <div class="input-group"> | |
| 43 | - <form action="../search/1" method="post"> | |
| 44 | - <div class="input-group"> | |
| 45 | - <input type="text" name="search_text" id="search_text" | |
| 46 | - class="form-control input-sm" style="width: 150px;" | |
| 47 | - placeholder="Search" /> | |
| 48 | - <button id="t_activity_search_btn" type="submit" | |
| 49 | - class="btn btn-sm btn-default"> | |
| 50 | - <i class="fa fa-search"></i>搜索 | |
| 51 | - </button> | |
| 52 | - </div> | |
| 53 | - </form> | |
| 54 | - </div> | |
| 55 | - </div> | |
| 56 | - </div> | |
| 57 | - <!-- /.box-header --> | |
| 58 | - <div class="box-body"> | |
| 59 | - <table class="table table-bordered"> | |
| 60 | - <tr> | |
| 61 | - <th>活动名称</th> | |
| 62 | - <th>开始时间</th> | |
| 63 | - <th>结束时间</th> | |
| 64 | - <th>状态</th> | |
| 65 | - <th>修改</th> | |
| 66 | - <th>删除</th> | |
| 67 | - </tr> | |
| 68 | - <c:forEach var="item" items="${tLive.recordList}" | |
| 69 | - varStatus="stat"> | |
| 70 | - <tr> | |
| 71 | - <td><a href="${BASE}/live/preview/${item.id}">${item.title}</a> | |
| 72 | - </td> | |
| 73 | - <td><fmt:formatDate value="${item.start_time}" | |
| 74 | - pattern="yyyy-MM-dd HH:mm" /></td> | |
| 75 | - <td>${item.end_time}</td> | |
| 76 | - <td> | |
| 77 | - <c:if test="${item.t_status_id==0}"> | |
| 78 | - <span class="badge bg-green">未开始</span> | |
| 79 | - </c:if> <c:if test="${item.t_status_id==1}"> | |
| 80 | - <span class="badge bg-red">直播中</span> | |
| 81 | - </c:if> <c:if test="${item.t_status_id==2}"> | |
| 82 | - <span class="badge">直播结束</span> | |
| 83 | - </c:if> <c:if test="${item.t_status_id==3}"> | |
| 84 | - <span class="badge">回放同步中</span> | |
| 85 | - </c:if> <c:if test="${item.t_status_id==4}"> | |
| 86 | - <span class="badge">同步完成</span> | |
| 87 | - </c:if> | |
| 88 | - </td> | |
| 89 | - <td> | |
| 90 | - <button class="btn btn-default btn-sm" | |
| 91 | - onclick="t_live_edit(${item.id});"> | |
| 92 | - <i class="fa fa-edit"></i> | |
| 93 | - </button> | |
| 94 | - </td> | |
| 95 | - <td> | |
| 96 | - <button class="btn btn-danger btn-sm" | |
| 97 | - onclick="t_live_delete(${item.id});"> | |
| 98 | - <i class="fa fa-close"></i> | |
| 99 | - </button> | |
| 100 | - </td> | |
| 101 | - </tr> | |
| 102 | - </c:forEach> | |
| 103 | - </table> | |
| 104 | - </div> | |
| 105 | - <!-- /.box-body --> | |
| 106 | - <div class="box-footer clearfix"> | |
| 107 | - <center> | |
| 108 | - <tag:pager id="product_pager" pager="${tLive}" /> | |
| 109 | - </center> | |
| 110 | - </div> | |
| 111 | - </div> | |
| 112 | - </div> | |
| 113 | - </div> | |
| 114 | - </div> | |
| 115 | - <%@ include file="/pages/common/bottom.jsp"%> | |
| 116 | - </div> | |
| 117 | - <%@ include file="/pages/common/js.jsp"%> | |
| 118 | -</body> | |
| 119 | -</html> | |
| 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 | +<!-- | |
| 14 | +<body class="skin-blue fixed ">--> | |
| 15 | +<body class="skin-blue sidebar-mini"> | |
| 16 | + <div class="wrapper"> | |
| 17 | + <%@ include file="/pages/common/top.jsp"%> | |
| 18 | + <%@ include file="/pages/common/left.jsp"%> | |
| 19 | + <div class="content-wrapper"> | |
| 20 | + <!-- Content Header (Page header) --> | |
| 21 | + <section class="content-header"> | |
| 22 | + <h1> | |
| 23 | + 活动管理<small><a href="../../live/preload"><i | |
| 24 | + class="fa fa-plus"></i>新增活动</a> </small> | |
| 25 | + <small class="label label-warning" style="display: none" | |
| 26 | + id="info_tab_span"><i class="fa fa-bell-o"></i></small> | |
| 27 | + </h1> | |
| 28 | + | |
| 29 | + <ol class="breadcrumb"> | |
| 30 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 31 | + <li class="active">活动管理</li> | |
| 32 | + </ol> | |
| 33 | + </section> | |
| 34 | + <!-- Main content --> | |
| 35 | + <section class="content"> | |
| 36 | + <div class="row"> | |
| 37 | + <div class="col-xs-12"> | |
| 38 | + <div class="box box-warning"> | |
| 39 | + <div class="box-header with-border"> | |
| 40 | + <h3 class="box-title"></h3> | |
| 41 | + <div class="box-tools"> | |
| 42 | + <div class="input-group"> | |
| 43 | + <form action="../search/1" method="post"> | |
| 44 | + <div class="input-group"> | |
| 45 | + <input type="text" name="search_text" id="search_text" | |
| 46 | + class="form-control input-sm" style="width: 150px;" | |
| 47 | + placeholder="Search" /> | |
| 48 | + <button id="t_activity_search_btn" type="submit" | |
| 49 | + class="btn btn-sm btn-default"> | |
| 50 | + <i class="fa fa-search"></i>搜索 | |
| 51 | + </button> | |
| 52 | + </div> | |
| 53 | + </form> | |
| 54 | + </div> | |
| 55 | + </div> | |
| 56 | + </div> | |
| 57 | + <!-- /.box-header --> | |
| 58 | + <div class="box-body"> | |
| 59 | + <table class="table table-bordered"> | |
| 60 | + <tr> | |
| 61 | + <th>活动名称</th> | |
| 62 | + <th>开始时间</th> | |
| 63 | + <th>结束时间</th> | |
| 64 | + <th>状态</th> | |
| 65 | + <th>修改</th> | |
| 66 | + <th>删除</th> | |
| 67 | + </tr> | |
| 68 | + <c:forEach var="item" items="${tLive.recordList}" | |
| 69 | + varStatus="stat"> | |
| 70 | + <tr> | |
| 71 | + <td><a href="${BASE}/live/preview/${item.id}">${item.title}</a> | |
| 72 | + </td> | |
| 73 | + <td><fmt:formatDate value="${item.start_time}" | |
| 74 | + pattern="yyyy-MM-dd HH:mm" /></td> | |
| 75 | + <td>${item.end_time}</td> | |
| 76 | + <td> | |
| 77 | + <c:if test="${item.t_status_id==0}"> | |
| 78 | + <span class="badge bg-green">未开始</span> | |
| 79 | + </c:if> <c:if test="${item.t_status_id==1}"> | |
| 80 | + <span class="badge bg-red">直播中</span> | |
| 81 | + </c:if> <c:if test="${item.t_status_id==2}"> | |
| 82 | + <span class="badge">直播结束</span> | |
| 83 | + </c:if> <c:if test="${item.t_status_id==3}"> | |
| 84 | + <span class="badge">回放同步中</span> | |
| 85 | + </c:if> <c:if test="${item.t_status_id==4}"> | |
| 86 | + <span class="badge">同步完成</span> | |
| 87 | + </c:if> | |
| 88 | + </td> | |
| 89 | + <td> | |
| 90 | + <button class="btn btn-default btn-sm" | |
| 91 | + onclick="t_live_edit(${item.id});"> | |
| 92 | + <i class="fa fa-edit"></i> | |
| 93 | + </button> | |
| 94 | + </td> | |
| 95 | + <td> | |
| 96 | + <button class="btn btn-danger btn-sm" | |
| 97 | + onclick="t_live_delete(${item.id});"> | |
| 98 | + <i class="fa fa-close"></i> | |
| 99 | + </button> | |
| 100 | + </td> | |
| 101 | + </tr> | |
| 102 | + </c:forEach> | |
| 103 | + </table> | |
| 104 | + </div> | |
| 105 | + <!-- /.box-body --> | |
| 106 | + <div class="box-footer clearfix"> | |
| 107 | + <center> | |
| 108 | + <tag:pager id="product_pager" pager="${tLive}" /> | |
| 109 | + </center> | |
| 110 | + </div> | |
| 111 | + </div> | |
| 112 | + </div> | |
| 113 | + </div> | |
| 114 | + </div> | |
| 115 | + <%@ include file="/pages/common/bottom.jsp"%> | |
| 116 | + </div> | |
| 117 | + <%@ include file="/pages/common/js.jsp"%> | |
| 118 | +</body> | |
| 119 | +</html> | ... | ... |
src/main/webapp/pages/live/search_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>直播活动管理<small class="label label-warning" style="display: none" | |
| 21 | + id="info_tab_span"><i class="fa fa-bell-o"></i></small> | |
| 22 | + </h1> | |
| 23 | + | |
| 24 | + <ol class="breadcrumb"> | |
| 25 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 26 | + <li class="active">活动管理</li> | |
| 27 | + </ol> | |
| 28 | + </section> | |
| 29 | + <!-- Main content --> | |
| 30 | + <section class="content"> | |
| 31 | + <div class="row"> | |
| 32 | + <div class="col-xs-12"> | |
| 33 | + <div class="box box-warning"> | |
| 34 | + <div class="box-header with-border"> | |
| 35 | + <h3 class="box-title"></h3> | |
| 36 | + <div class="box-tools"> | |
| 37 | + <div class="input-group"> | |
| 38 | + <form action="../search/1" method="get"> | |
| 39 | + <div class="input-group"> | |
| 40 | + <input type="text" name="search_user_id" id="search_user_id" | |
| 41 | + class="form-control input-sm" style="width: 150px;" | |
| 42 | + placeholder="用户id" /> | |
| 43 | + <input type="text" name="search_title" id="search_title" | |
| 44 | + class="form-control input-sm" style="width: 150px;" | |
| 45 | + placeholder="活动名称" /> | |
| 46 | + <button id="t_activity_search_btn" type="submit" | |
| 47 | + class="btn btn-sm btn-default"> | |
| 48 | + <i class="fa fa-search"></i>搜索 | |
| 49 | + </button> | |
| 50 | + </div> | |
| 51 | + </form> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + </div> | |
| 55 | + <!-- /.box-header --> | |
| 56 | + <div class="box-body"> | |
| 57 | + <table class="table table-bordered"> | |
| 58 | + <tr> | |
| 59 | + <th>活动ID</th> | |
| 60 | + <th>用户ID</th> | |
| 61 | + <th>活动名称</th> | |
| 62 | + <th>开始时间</th> | |
| 63 | + <th>结束时间</th> | |
| 64 | + <th>状态</th> | |
| 65 | + <th>下线</th> | |
| 66 | + </tr> | |
| 67 | + <c:forEach var="item" items="${tLive.recordList}"varStatus="stat"> | |
| 68 | + <tr> | |
| 69 | + <td>${item.id}</td> | |
| 70 | + <td>${item.t_user_id}</td> | |
| 71 | + <td>${item.title}</td> | |
| 72 | + <td><fmt:formatDate value="${item.start_time}" | |
| 73 | + pattern="yyyy-MM-dd HH:mm" /></td> | |
| 74 | + <td>${item.end_time}</td> | |
| 75 | + <td> | |
| 76 | + <c:if test="${item.t_status_id==0}"> | |
| 77 | + <span class="badge bg-green">未开始</span> | |
| 78 | + </c:if> <c:if test="${item.t_status_id==2}"> | |
| 79 | + <span class="badge bg-red">直播中</span> | |
| 80 | + </c:if> <c:if test="${item.t_status_id==1}"> | |
| 81 | + <span class="badge">直播结束</span> | |
| 82 | + </c:if> <c:if test="${item.t_status_id==-2}"> | |
| 83 | + <span class="badge">回放同步中</span> | |
| 84 | + </c:if> | |
| 85 | + </td> | |
| 86 | + | |
| 87 | + <td> | |
| 88 | + <button class="btn btn-danger btn-sm" | |
| 89 | + onclick="t_live_close('${item.id}','${item.live_url}');"> | |
| 90 | + <i class="fa fa-close"></i> | |
| 91 | + </button> | |
| 92 | + </td> | |
| 93 | + </tr> | |
| 94 | + </c:forEach> | |
| 95 | + </table> | |
| 96 | + </div> | |
| 97 | + <!-- /.box-body --> | |
| 98 | + <div class="box-footer clearfix"> | |
| 99 | + <center> | |
| 100 | + <tag:pager3 id="product_pager" pager="${tLive}" /> | |
| 101 | + </center> | |
| 102 | + </div> | |
| 103 | + </div> | |
| 104 | + </div> | |
| 105 | + </div> | |
| 106 | + </div> | |
| 107 | + <%@ include file="/pages/common/bottom.jsp"%> | |
| 108 | + </div> | |
| 109 | + <%@ include file="/pages/common/js.jsp"%> | |
| 110 | +</body> | |
| 111 | +</html> | ... | ... |
src/main/webapp/pages/live/video_management.jsp
| 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" style="display: none" | |
| 22 | - id="info_tab_span"><i class="fa fa-bell-o"></i></small> | |
| 23 | - </h1> | |
| 24 | - | |
| 25 | - <ol class="breadcrumb"> | |
| 26 | - <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 27 | - <li class="active">活动管理</li> | |
| 28 | - </ol> | |
| 29 | - </section> | |
| 30 | - <!-- Main content --> | |
| 31 | - <section class="content"> | |
| 32 | - <div class="row"> | |
| 33 | - <div class="col-xs-12"> | |
| 34 | - <div class="box box-warning"> | |
| 35 | - <div class="box-header with-border"></div> | |
| 36 | - <div class="box-body"> | |
| 37 | - <table class="table table-bordered"> | |
| 38 | - <tr> | |
| 39 | - <th width="30%">名称</th> | |
| 40 | - <th width="30%">relation_id</th> | |
| 41 | - <th width="30%">审核状态</th> | |
| 42 | - <th width="10%">操作</th> | |
| 43 | - </tr> | |
| 44 | - <c:forEach var="item" items="${videos.recordList}" | |
| 45 | - varStatus="stat"> | |
| 46 | - <tr> | |
| 47 | - <td><a onclick="t_live_xq(${item.id});">${item.title}</a></td> | |
| 48 | - <td>${item.relation_id}</td> | |
| 49 | - <td><c:choose> | |
| 50 | - <c:when test="${item.check_state==1}"> | |
| 51 | - <span class="badge bg-green">审核通过</span> | |
| 52 | - </c:when> | |
| 53 | - <c:otherwise> | |
| 54 | - <span class="badge bg-red">未审核</span> | |
| 55 | - </c:otherwise> | |
| 56 | - </c:choose></td> | |
| 57 | - <td> | |
| 58 | - <button class="btn btn-danger btn-sm" | |
| 59 | - onclick="t_live_underLine(${item.id});">下线</button> | |
| 60 | - </td> | |
| 61 | - </tr> | |
| 62 | - </c:forEach> | |
| 63 | - </table> | |
| 64 | - </div> | |
| 65 | - <!-- /.box-body --> | |
| 66 | - <div class="box-footer clearfix"> | |
| 67 | - <center> | |
| 68 | - <tag:pager id="product_pager" pager="${videos}" /> | |
| 69 | - </center> | |
| 70 | - </div> | |
| 71 | - </div> | |
| 72 | - </div> | |
| 73 | - </div> | |
| 74 | - </div> | |
| 75 | - <%@ include file="/pages/common/bottom.jsp"%> | |
| 76 | - </div> | |
| 77 | - <%@ include file="/pages/common/js.jsp"%> | |
| 78 | -</body> | |
| 79 | -</html> | |
| 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" style="display: none" | |
| 22 | + id="info_tab_span"><i class="fa fa-bell-o"></i></small> | |
| 23 | + </h1> | |
| 24 | + | |
| 25 | + <ol class="breadcrumb"> | |
| 26 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 27 | + <li class="active">活动管理</li> | |
| 28 | + </ol> | |
| 29 | + </section> | |
| 30 | + <!-- Main content --> | |
| 31 | + <section class="content"> | |
| 32 | + <div class="row"> | |
| 33 | + <div class="col-xs-12"> | |
| 34 | + <div class="box box-warning"> | |
| 35 | + <div class="box-header with-border"></div> | |
| 36 | + <div class="box-body"> | |
| 37 | + <table class="table table-bordered"> | |
| 38 | + <tr> | |
| 39 | + <th width="30%">名称</th> | |
| 40 | + <th width="30%">relation_id</th> | |
| 41 | + <th width="30%">审核状态</th> | |
| 42 | + <th width="10%">操作</th> | |
| 43 | + </tr> | |
| 44 | + <c:forEach var="item" items="${videos.recordList}" | |
| 45 | + varStatus="stat"> | |
| 46 | + <tr> | |
| 47 | + <td><a onclick="t_live_xq(${item.id});">${item.title}</a></td> | |
| 48 | + <td>${item.relation_id}</td> | |
| 49 | + <td><c:choose> | |
| 50 | + <c:when test="${item.check_state==1}"> | |
| 51 | + <span class="badge bg-green">审核通过</span> | |
| 52 | + </c:when> | |
| 53 | + <c:otherwise> | |
| 54 | + <span class="badge bg-red">未审核</span> | |
| 55 | + </c:otherwise> | |
| 56 | + </c:choose></td> | |
| 57 | + <td> | |
| 58 | + <button class="btn btn-danger btn-sm" | |
| 59 | + onclick="t_live_underLine(${item.id});">下线</button> | |
| 60 | + </td> | |
| 61 | + </tr> | |
| 62 | + </c:forEach> | |
| 63 | + </table> | |
| 64 | + </div> | |
| 65 | + <!-- /.box-body --> | |
| 66 | + <div class="box-footer clearfix"> | |
| 67 | + <center> | |
| 68 | + <tag:pager id="product_pager" pager="${videos}" /> | |
| 69 | + </center> | |
| 70 | + </div> | |
| 71 | + </div> | |
| 72 | + </div> | |
| 73 | + </div> | |
| 74 | + </div> | |
| 75 | + <%@ include file="/pages/common/bottom.jsp"%> | |
| 76 | + </div> | |
| 77 | + <%@ include file="/pages/common/js.jsp"%> | |
| 78 | +</body> | |
| 79 | +</html> | ... | ... |
src/main/webapp/pages/user/user_list.jsp
| 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 sidebar-mini"> | |
| 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" style="display: none" | |
| 22 | - id="info_tab_span"><i class="fa fa-bell-o"></i></small> | |
| 23 | - </h1> | |
| 24 | - <ol class="breadcrumb"> | |
| 25 | - <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 26 | - <li><a>用户管理</a></li> | |
| 27 | - </ol> | |
| 28 | - </section> | |
| 29 | - <!-- Main content --> | |
| 30 | - <section class="content"> | |
| 31 | - <div class="row"> | |
| 32 | - <div class="col-xs-12"> | |
| 33 | - <div class="box box-success"> | |
| 34 | - <div class="box-header with-border"> | |
| 35 | - <!-- <h3 class="box-title"></h3> --> | |
| 36 | - <div class="box-tools"> | |
| 37 | - <div class="input-group"></div> | |
| 38 | - </div> | |
| 39 | - </div> | |
| 40 | - <!-- /.box-header --> | |
| 41 | - <div class="box-body"> | |
| 42 | - <table class="table table-bordered"> | |
| 43 | - <tr> | |
| 44 | - <th>用户名</th> | |
| 45 | - <th>用户权限</th> | |
| 46 | - <th>创建日期</th> | |
| 47 | - <th>举报次数</th> | |
| 48 | - <th>举报原因</th> | |
| 49 | - <th>播放列表</th> | |
| 50 | - </tr> | |
| 51 | - <c:forEach var="item" items="${userPage.recordList}" | |
| 52 | - varStatus="stat"> | |
| 53 | - <tr> | |
| 54 | - <td>${item.name}</td> | |
| 55 | - <td>${item.is_admin}</td> | |
| 56 | - <td>${item.create_time}</td> | |
| 57 | - <td> | |
| 58 | - <c:if test="${item.reported_count<=5}"><span class="badge">${item.reported_count}</span></c:if> | |
| 59 | - <c:if test="${item.reported_count>5}"><span class="badge bg-red">${item.reported_count}</span></c:if> | |
| 60 | - </td> | |
| 61 | - <td> | |
| 62 | - <c:forEach items="${fn:split(item.reported_reason,',')}" var="tags"> | |
| 63 | - ${tags} | |
| 64 | - </c:forEach> | |
| 65 | - </td> | |
| 66 | - <td><a href="${BASE}/user/live/${item.id}/1">查看</a></td> | |
| 67 | - </tr> | |
| 68 | - </c:forEach> | |
| 69 | - </table> | |
| 70 | - </div> | |
| 71 | - <div class="box-footer clearfix "> | |
| 72 | - <center> | |
| 73 | - <tag:pager id="product_pager" pager="${userPage}" /> | |
| 74 | - </center> | |
| 75 | - </div> | |
| 76 | - </div> | |
| 77 | - </div> | |
| 78 | - </div> | |
| 79 | - </section> | |
| 80 | - </div> | |
| 81 | - <%@ include file="/pages/common/bottom.jsp"%> | |
| 82 | - <%@ include file="/pages/common/js.jsp"%> | |
| 83 | - </div> | |
| 84 | -</body> | |
| 85 | -</html> | |
| 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 sidebar-mini"> | |
| 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" style="display: none" | |
| 22 | + id="info_tab_span"><i class="fa fa-bell-o"></i></small> | |
| 23 | + </h1> | |
| 24 | + <ol class="breadcrumb"> | |
| 25 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 26 | + <li><a>用户管理</a></li> | |
| 27 | + </ol> | |
| 28 | + </section> | |
| 29 | + <!-- Main content --> | |
| 30 | + <section class="content"> | |
| 31 | + <div class="row"> | |
| 32 | + <div class="col-xs-12"> | |
| 33 | + <div class="box box-success"> | |
| 34 | + <div class="box-header with-border"> | |
| 35 | + <!-- <h3 class="box-title"></h3> --> | |
| 36 | + <div class="box-tools"> | |
| 37 | + <div class="input-group"></div> | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + <!-- /.box-header --> | |
| 41 | + <div class="box-body"> | |
| 42 | + <table class="table table-bordered"> | |
| 43 | + <tr> | |
| 44 | + <th>用户名</th> | |
| 45 | + <th>用户权限</th> | |
| 46 | + <th>创建日期</th> | |
| 47 | + <th>举报次数</th> | |
| 48 | + <th>举报原因</th> | |
| 49 | + <th>播放列表</th> | |
| 50 | + </tr> | |
| 51 | + <c:forEach var="item" items="${userPage.recordList}" | |
| 52 | + varStatus="stat"> | |
| 53 | + <tr> | |
| 54 | + <td>${item.name}</td> | |
| 55 | + <td>${item.is_admin}</td> | |
| 56 | + <td>${item.create_time}</td> | |
| 57 | + <td> | |
| 58 | + <c:if test="${item.reported_count<=5}"><span class="badge">${item.reported_count}</span></c:if> | |
| 59 | + <c:if test="${item.reported_count>5}"><span class="badge bg-red">${item.reported_count}</span></c:if> | |
| 60 | + </td> | |
| 61 | + <td> | |
| 62 | + <c:forEach items="${fn:split(item.reported_reason,',')}" var="tags"> | |
| 63 | + ${tags} | |
| 64 | + </c:forEach> | |
| 65 | + </td> | |
| 66 | + <td><a href="${BASE}/user/live/${item.id}/1">查看</a></td> | |
| 67 | + </tr> | |
| 68 | + </c:forEach> | |
| 69 | + </table> | |
| 70 | + </div> | |
| 71 | + <div class="box-footer clearfix "> | |
| 72 | + <center> | |
| 73 | + <tag:pager id="product_pager" pager="${userPage}" /> | |
| 74 | + </center> | |
| 75 | + </div> | |
| 76 | + </div> | |
| 77 | + </div> | |
| 78 | + </div> | |
| 79 | + </section> | |
| 80 | + </div> | |
| 81 | + <%@ include file="/pages/common/bottom.jsp"%> | |
| 82 | + <%@ include file="/pages/common/js.jsp"%> | |
| 83 | + </div> | |
| 84 | +</body> | |
| 85 | +</html> | ... | ... |
src/main/webapp/pages/user/user_live_list.jsp
| 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 | -</head> | |
| 14 | -<body class="skin-blue sidebar-mini"> | |
| 15 | - <div class="wrapper"> | |
| 16 | - <%@ include file="/pages/common/top.jsp"%> | |
| 17 | - <%@ include file="/pages/common/left.jsp"%> | |
| 18 | - <div class="content-wrapper"> | |
| 19 | - <!-- Content Header (Page header) --> | |
| 20 | - <section class="content-header"> | |
| 21 | - <h1>播放列表</h1> | |
| 22 | - <ol class="breadcrumb"> | |
| 23 | - <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 24 | - <li><a>播放列表</a></li> | |
| 25 | - </ol> | |
| 26 | - </section> | |
| 27 | - <!-- Main content --> | |
| 28 | - <section class="content"> | |
| 29 | - <div class="row"> | |
| 30 | - <div class="col-xs-12"> | |
| 31 | - <div class="box box-success"> | |
| 32 | - <div class="box-header with-border"> | |
| 33 | - <!-- <h3 class="box-title"></h3> --> | |
| 34 | - <div class="box-tools"> | |
| 35 | - <div class="input-group"></div> | |
| 36 | - </div> | |
| 37 | - </div> | |
| 38 | - <!-- /.box-header --> | |
| 39 | - <div class="box-body"> | |
| 40 | - <table class="table table-bordered table-hover"> | |
| 41 | - <tr> | |
| 42 | - <th>标题</th> | |
| 43 | - <th>状态</th> | |
| 44 | - <th>开始时间</th> | |
| 45 | - <th>结束时间</th> | |
| 46 | - <th>回放地址</th> | |
| 47 | - </tr> | |
| 48 | - <c:forEach var="item" items="${userPage.recordList}" | |
| 49 | - varStatus="stat"> | |
| 50 | - <tr> | |
| 51 | - <td>${item.title}</td> | |
| 52 | - <td>${item.t_status_id}</td> | |
| 53 | - <td>${item.start_time}</td> | |
| 54 | - <td>${item.end_time}</td> | |
| 55 | - <td><abbr title="initialism">${item.live_url}</abbr></td> | |
| 56 | - </tr> | |
| 57 | - </c:forEach> | |
| 58 | - </table> | |
| 59 | - </div> | |
| 60 | - <div class="box-footer clearfix "> | |
| 61 | - <center> | |
| 62 | - <tag:pager id="product_pager" pager="${userPage}" /> | |
| 63 | - </center> | |
| 64 | - </div> | |
| 65 | - </div> | |
| 66 | - </div> | |
| 67 | - </div> | |
| 68 | - </section> | |
| 69 | - </div> | |
| 70 | - <%@ include file="/pages/common/bottom.jsp"%> | |
| 71 | - <%@ include file="/pages/common/js.jsp"%> | |
| 72 | - </div> | |
| 73 | -</body> | |
| 74 | -</html> | |
| 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 | +</head> | |
| 14 | +<body class="skin-blue sidebar-mini"> | |
| 15 | + <div class="wrapper"> | |
| 16 | + <%@ include file="/pages/common/top.jsp"%> | |
| 17 | + <%@ include file="/pages/common/left.jsp"%> | |
| 18 | + <div class="content-wrapper"> | |
| 19 | + <!-- Content Header (Page header) --> | |
| 20 | + <section class="content-header"> | |
| 21 | + <h1>播放列表</h1> | |
| 22 | + <ol class="breadcrumb"> | |
| 23 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 24 | + <li><a>播放列表</a></li> | |
| 25 | + </ol> | |
| 26 | + </section> | |
| 27 | + <!-- Main content --> | |
| 28 | + <section class="content"> | |
| 29 | + <div class="row"> | |
| 30 | + <div class="col-xs-12"> | |
| 31 | + <div class="box box-success"> | |
| 32 | + <div class="box-header with-border"> | |
| 33 | + <!-- <h3 class="box-title"></h3> --> | |
| 34 | + <div class="box-tools"> | |
| 35 | + <div class="input-group"></div> | |
| 36 | + </div> | |
| 37 | + </div> | |
| 38 | + <!-- /.box-header --> | |
| 39 | + <div class="box-body"> | |
| 40 | + <table class="table table-bordered table-hover"> | |
| 41 | + <tr> | |
| 42 | + <th>标题</th> | |
| 43 | + <th>状态</th> | |
| 44 | + <th>开始时间</th> | |
| 45 | + <th>结束时间</th> | |
| 46 | + <th>回放地址</th> | |
| 47 | + </tr> | |
| 48 | + <c:forEach var="item" items="${userPage.recordList}" | |
| 49 | + varStatus="stat"> | |
| 50 | + <tr> | |
| 51 | + <td>${item.title}</td> | |
| 52 | + <td>${item.t_status_id}</td> | |
| 53 | + <td>${item.start_time}</td> | |
| 54 | + <td>${item.end_time}</td> | |
| 55 | + <td><abbr title="initialism">${item.live_url}</abbr></td> | |
| 56 | + </tr> | |
| 57 | + </c:forEach> | |
| 58 | + </table> | |
| 59 | + </div> | |
| 60 | + <div class="box-footer clearfix "> | |
| 61 | + <center> | |
| 62 | + <tag:pager id="product_pager" pager="${userPage}" /> | |
| 63 | + </center> | |
| 64 | + </div> | |
| 65 | + </div> | |
| 66 | + </div> | |
| 67 | + </div> | |
| 68 | + </section> | |
| 69 | + </div> | |
| 70 | + <%@ include file="/pages/common/bottom.jsp"%> | |
| 71 | + <%@ include file="/pages/common/js.jsp"%> | |
| 72 | + </div> | |
| 73 | +</body> | |
| 74 | +</html> | ... | ... |
src/main/webapp/pages/word/word_add.jsp
| 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 | - <small>添加敏感词</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" 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> <textarea id="words" name="words" class="form-control" rows="3" placeholder="北京,上海,天津"></textarea> | |
| 47 | - </div> | |
| 48 | - </div> | |
| 49 | - </div> | |
| 50 | - <button type="submit" id="t_channel_save_btn" | |
| 51 | - class="btn btn-primary"> | |
| 52 | - <i class="fa fa-save "></i> 保存 | |
| 53 | - </button> | |
| 54 | - </form> | |
| 55 | - </div> | |
| 56 | - </div> | |
| 57 | - </section> | |
| 58 | - </div> | |
| 59 | - <%@ include file="/pages/common/bottom.jsp"%> | |
| 60 | - </div> | |
| 61 | - <%@ include file="/pages/common/js.jsp"%> | |
| 62 | - <script type="text/javascript"> | |
| 63 | - $(function() { | |
| 64 | - $('#create_form').ajaxForm({ | |
| 65 | - type : 'post', | |
| 66 | - url : '../../word/add', | |
| 67 | - beforeSubmit : function() { | |
| 68 | - return true; | |
| 69 | - }, | |
| 70 | - error : function(XMLHttpRequest, textStatus, errorThrown) { | |
| 71 | - alert("错误"); | |
| 72 | - }, | |
| 73 | - success : function(result) { | |
| 74 | - alert("添加成功"); | |
| 75 | - location.href = '../../word/list'; | |
| 76 | - } | |
| 77 | - }); | |
| 78 | - }); | |
| 79 | - | |
| 80 | - </script> | |
| 81 | -</body> | |
| 82 | -</html> | |
| 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 | + <small>添加敏感词</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" 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> <textarea id="words" name="words" class="form-control" rows="3" placeholder="北京,上海,天津"></textarea> | |
| 47 | + </div> | |
| 48 | + </div> | |
| 49 | + </div> | |
| 50 | + <button type="submit" id="t_channel_save_btn" | |
| 51 | + class="btn btn-primary"> | |
| 52 | + <i class="fa fa-save "></i> 保存 | |
| 53 | + </button> | |
| 54 | + </form> | |
| 55 | + </div> | |
| 56 | + </div> | |
| 57 | + </section> | |
| 58 | + </div> | |
| 59 | + <%@ include file="/pages/common/bottom.jsp"%> | |
| 60 | + </div> | |
| 61 | + <%@ include file="/pages/common/js.jsp"%> | |
| 62 | + <script type="text/javascript"> | |
| 63 | + $(function() { | |
| 64 | + $('#create_form').ajaxForm({ | |
| 65 | + type : 'post', | |
| 66 | + url : '../../word/add', | |
| 67 | + beforeSubmit : function() { | |
| 68 | + return true; | |
| 69 | + }, | |
| 70 | + error : function(XMLHttpRequest, textStatus, errorThrown) { | |
| 71 | + alert("错误"); | |
| 72 | + }, | |
| 73 | + success : function(result) { | |
| 74 | + alert("添加成功"); | |
| 75 | + location.href = '../../word/list'; | |
| 76 | + } | |
| 77 | + }); | |
| 78 | + }); | |
| 79 | + | |
| 80 | + </script> | |
| 81 | +</body> | |
| 82 | +</html> | ... | ... |
src/main/webapp/pages/word/word_management.jsp
| 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 | - 所有关键词 <small><a href="../pages/word/word_add.jsp"><i | |
| 27 | - class="fa fa-plus"></i>新增</a> </small><small 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 | - <div class="box box-success"> | |
| 40 | - <div class="box-body"> | |
| 41 | - <div class="form-group"> | |
| 42 | - <table class="table table-bordered"> | |
| 43 | - <tr> | |
| 44 | - <!-- <th>过滤</th>--> | |
| 45 | - </tr> | |
| 46 | - <c:forEach var="str" items="${str}" | |
| 47 | - varStatus="stat"> | |
| 48 | - <tr> | |
| 49 | - <td>${str}</td> | |
| 50 | - </tr> | |
| 51 | - </c:forEach> | |
| 52 | - </table> | |
| 53 | - </div> | |
| 54 | - </div> | |
| 55 | - </div> | |
| 56 | - </div> | |
| 57 | - </section> | |
| 58 | - </div> | |
| 59 | - <%@ include file="/pages/common/bottom.jsp"%> | |
| 60 | - </div> | |
| 61 | -</body> | |
| 62 | -</html> | |
| 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 | + 所有关键词 <small><a href="../pages/word/word_add.jsp"><i | |
| 27 | + class="fa fa-plus"></i>新增</a> </small><small 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 | + <div class="box box-success"> | |
| 40 | + <div class="box-body"> | |
| 41 | + <div class="form-group"> | |
| 42 | + <table class="table table-bordered"> | |
| 43 | + <tr> | |
| 44 | + <!-- <th>过滤</th>--> | |
| 45 | + </tr> | |
| 46 | + <c:forEach var="str" items="${str}" | |
| 47 | + varStatus="stat"> | |
| 48 | + <tr> | |
| 49 | + <td>${str}</td> | |
| 50 | + </tr> | |
| 51 | + </c:forEach> | |
| 52 | + </table> | |
| 53 | + </div> | |
| 54 | + </div> | |
| 55 | + </div> | |
| 56 | + </div> | |
| 57 | + </section> | |
| 58 | + </div> | |
| 59 | + <%@ include file="/pages/common/bottom.jsp"%> | |
| 60 | + </div> | |
| 61 | +</body> | |
| 62 | +</html> | ... | ... |
src/main/webapp/static/assets/ckplayer_back/ckplayer.js
| 1 | -/* | |
| 2 | -------------------------------------------------------------------------- | |
| 3 | - 说明: | |
| 4 | - 正式使用时可以把该文件的注释全部去掉,节省加载时间 | |
| 5 | - ckplayer6.8,有问题请访问http://www.ckplayer.com | |
| 6 | - 请注意,该文件为UTF-8编码,不需要改变编码即可使用于各种编码形式的网站内 | |
| 7 | -------------------------------------------------------------------------- | |
| 8 | -第一部分,加载插件 | |
| 9 | -以下为加载的插件部份 | |
| 10 | -插件的设置参数说明: | |
| 11 | - 1、插件名称 | |
| 12 | - 2、水平对齐方式(0左,1中,2右) | |
| 13 | - 3、垂直对齐方式(0上,1中,2下) | |
| 14 | - 4、水平方向位置偏移量 | |
| 15 | - 5、垂直方向位置偏移量 | |
| 16 | - 6、插件的等级,0=普通图片插件且跟随控制栏隐藏而隐藏,显示而显示,1=普通图片插件且永久显示,2=swf插件,默认显示,3=swf插件,默认隐藏,swf插件都可以交互 | |
| 17 | - 7、插件是否绑定在控制栏上,0不绑定,1绑定,当值是1的时候该插件将会随着控制栏一起隐藏或缓动 | |
| 18 | - 8、插件为swf并且可交互时,默认调用的类所在的包名称,详细说明可以到帮助手册里查看,默认无 | |
| 19 | - 插件名称不能相同,对此的详细说明请到网站查看 | |
| 20 | -*/ | |
| 21 | -function ckcpt() { | |
| 22 | - var cpt = ''; | |
| 23 | - return cpt; | |
| 24 | -} | |
| 25 | -/* | |
| 26 | -插件的定义结束 | |
| 27 | -以下是对播放器功能进行配置 | |
| 28 | -*/ | |
| 29 | -function ckstyle() { //定义总的风格 | |
| 30 | - var ck = { | |
| 31 | - cpath: '', | |
| 32 | - /* | |
| 33 | - 播放器风格压缩包文件的路径,默认的是style.swf | |
| 34 | - 如果调用不出来可以试着设置成绝对路径试试 | |
| 35 | - 如果不知道路径并且使用的是默认配置,可以直接留空,播放器会 | |
| 36 | - */ | |
| 37 | - language: '', | |
| 38 | - /*播放器所使用的语言配置文件,需要和播放器在同目录下,默认是language.xml*/ | |
| 39 | - flashvars: '', | |
| 40 | - /* | |
| 41 | - 这里是用来做为对flashvars值的补充,除了c和x二个参数以外的设置都可以在这里进行配置 | |
| 42 | - 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 | |
| 43 | - 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3*/ | |
| 44 | - setup: '1,1,1,1,1,2,0,1,2,0,0,1,200,0,2,1,0,1,1,1,1,10,3,0,1,2,3000,0,0,0,0,1,1,1,1,1,1,250,0,90,0,0,0', | |
| 45 | - /* | |
| 46 | - 这是配置文件里比较重要的一个参数,共有N个功能控制参数,并且以后会继续的增加,各控制参数以英文逗号(,)隔开。下面列出各参数的说明: | |
| 47 | - 1、鼠标经过按钮是否使用手型,0普通鼠标,1手型鼠标,2是只有按钮手型,3是控制栏手型 | |
| 48 | - 2、是否支持单击暂停,0不支持,1是支持 | |
| 49 | - 3、是否支持双击全屏,0不支持,1是支持 | |
| 50 | - 4、在播放前置广告时是否同时加载视频,0不加载,1加载 | |
| 51 | - 5、广告显示的参考对象,0是参考视频区域,1是参考播放器区域 | |
| 52 | - 6、广告大小的调整方式,只针对swf和图片有效,视频是自动缩放的 | |
| 53 | - 0=自动调整大小,意思是说大的话就变小,小的话就变大 | |
| 54 | - 1=是大的化变小,小的话不变 | |
| 55 | - 2=是什么也不变,就这么大 | |
| 56 | - 3=是跟参考对像(第5个控制)参数设置的一样宽高 | |
| 57 | - 7、前置广告播放顺序,0是顺序播放,1是随机播放,>1则随机取所有广告中的(N-1)个进行播放 | |
| 58 | - 8、对于视频广告是否采用修正,0是不使用,1是使用,如果是1,则用户在网速慢的情况下会按设定的倒计时进行播放广告,计时结束则放正片(比较人性化),设置成0的话,则强制播放完广告才能播放正片 | |
| 59 | - 9、是否开启滚动文字广告,0是不开启,1是开启且不使用关闭按钮,2是开启并且使用关闭按钮,开启后将在加载视频的时候加载滚动文字广告 | |
| 60 | - 10、视频的调整方式 | |
| 61 | - 0=是自动调整大小,意思是说大的话就变小,小的话就变大,同时保持长宽比例不变 | |
| 62 | - 1=是大的化变小,小的话不变 | |
| 63 | - 2=是什么也不变,就这么大 | |
| 64 | - 3=是跟参考对像(pm_video的设置)参数设置的一样宽高 | |
| 65 | - 11、是否在多视频时分段加载,0不是,1是 | |
| 66 | - 12、缩放视频时是否进行平滑处理,0不是,1是 | |
| 67 | - 13、视频缓冲时间,单位:毫秒,建议不超过300 | |
| 68 | - 14、初始图片调整方式( | |
| 69 | - 0=是自动调整大小,意思是说大的话就变小,小的话就变大,同时保持长宽比例不变 | |
| 70 | - 1=是大的化变小,小的话不变 | |
| 71 | - 2=是什么也不变,就这么大 | |
| 72 | - 3=是跟pm_video参数设置的一样宽高 | |
| 73 | - 15、暂停广告调整方式( | |
| 74 | - 0=是自动调整大小,意思是说大的话就变小,小的话就变大,同时保持长宽比例不变 | |
| 75 | - 1=是大的化变小,小的话不变 | |
| 76 | - 2=是什么也不变,就这么大 | |
| 77 | - 3=是跟pm_video参数设置的一样宽 | |
| 78 | - 16、暂停广告是否使用关闭广告设置,0不使用,1使用 | |
| 79 | - 17、缓冲时是否播放广告,0是不显示,1是显示并同时隐藏掉缓冲图标和进度,2是显示并不隐藏缓冲图标 | |
| 80 | - 18、是否支持键盘空格键控制播放和暂停0不支持,1支持 | |
| 81 | - 19、是否支持键盘左右方向键控制快进快退0不支持,1支持 | |
| 82 | - 20、是否支持键盘上下方向键控制音量0不支持,1支持 | |
| 83 | - 21、播放器返回js全部监听函数的等级,0-2,等级越高,返回的参数越多 | |
| 84 | - 0=不返回全部监听事件 | |
| 85 | - 1=返回监听,但不在控制台输出 | |
| 86 | - 2=返回监听,并且在控制台同步输出 | |
| 87 | - 3=返回全部监听事件,并且在参数前加上"播放器ID->",用于多播放器的监听 | |
| 88 | - 22、快进和快退的秒数 | |
| 89 | - 23、界面上图片元素加载失败重新加载次数 | |
| 90 | - 24、开启加载皮肤压缩文件包的加载进度提示 | |
| 91 | - 25、使用隐藏控制栏时显示简单进度条的功能,0是不使用,1是使用,2是只在普通状态下使用 | |
| 92 | - 26、控制栏隐藏设置(0不隐藏,1全屏时隐藏,2都隐藏 | |
| 93 | - 27、控制栏隐藏延时时间,即在鼠标离开控制栏后多少毫秒后隐藏控制栏 | |
| 94 | - 28、滚动文字广告左右滚动时是否采用无缝,默认0采用,1是不采用 | |
| 95 | - 29、0是正常状态,1是控制栏默认隐藏,播放状态下鼠标经过播放器显示控制栏,2是一直隐藏控制栏 | |
| 96 | - 30、在播放rtmp视频时暂停后点击播放是否采用重新链接的方式,这里一共分0-2三个等级 | |
| 97 | - 31、当采用网址形式(flashvars里s=1/2时)读取视频地址时是采用默认0=get方法,1=post方式 | |
| 98 | - 32、是否启用播放按钮和暂停按钮 | |
| 99 | - 33、是否启用中间暂停按钮 | |
| 100 | - 34、是否启用静音按钮 | |
| 101 | - 35、是否启用全屏按钮 | |
| 102 | - 36、是否启用进度调节栏,0不启用,1是启用,2是只能前进(向右拖动),3是只能后退,4是只能前进但能回到第一次拖动时的位置,5是看过的地方可以随意拖动, | |
| 103 | - 37、是否启用调节音量 | |
| 104 | - 38、计算时间的间隔,毫秒 | |
| 105 | - 39、前置logo至少显示的时间,单位:毫秒 | |
| 106 | - 40、前置视频广告的默认音量 | |
| 107 | - 41、当s=3/4时加载插件是否从压缩包里加载,0不是,1是 | |
| 108 | - 42、加载风格是否采用加密方式传送,该功能普通用户不能使用 | |
| 109 | - 43、在s=1/2时,调用地址里的地址是否是相对地址(相对于调用文件),0不是,1是 | |
| 110 | - */ | |
| 111 | - pm_bg: '0x000000,100,230,180', | |
| 112 | - /*播放器整体的背景配置,请注意,这里只是一个初始化的设置,如果需要真正的改动播放器的背景和最小宽高,需要在风格文件里找到相同的参数进行更改。 | |
| 113 | - 1、整体背景颜色 | |
| 114 | - 2、背景透明度 | |
| 115 | - 3、播放器最小宽度 | |
| 116 | - 4、播放器最小高度 | |
| 117 | - 这里只是初始化时的设置,最终加载完播放器后显示的效果需要在style.swf/style.xml里设置该参数 | |
| 118 | - */ | |
| 119 | - mylogo: 'logo.swf', | |
| 120 | - /* | |
| 121 | - 视频加载前显示的logo文件,不使用设置成null,即mylogo='null'; | |
| 122 | - */ | |
| 123 | - pm_mylogo: '1,1,-100,-55', | |
| 124 | - /* | |
| 125 | - 视频加载前显示的logo文件(mylogo参数的)的位置 | |
| 126 | - 本软件所有的四个参数控制位置的方式全部都是统一的意思,如下 | |
| 127 | - 1、水平对齐方式,0是左,1是中,2是右 | |
| 128 | - 2、垂直对齐方式,0是上,1是中,2是下 | |
| 129 | - 3、水平偏移量,举例说明,如果第1个参数设置成0左对齐,第3个偏移量设置成10,就是离左边10个像素,第一个参数设置成2,偏移量如果设置的是正值就会移到播放器外面,只有设置成负值才行,设置成-1,按钮就会跑到播放器外面 | |
| 130 | - 4、垂直偏移量 | |
| 131 | - */ | |
| 132 | - /* logo: 'cklogo.png',*/ | |
| 133 | - logo='null', | |
| 134 | - /* | |
| 135 | - 默认右上角一直显示的logo,不使用设置成null,即logo='null'; | |
| 136 | - */ | |
| 137 | - pm_logo: '2,0,-100,20', | |
| 138 | - /* | |
| 139 | - 播放器右上角的logo的位置 | |
| 140 | - 1、水平对齐方式,0是左,1是中,2是右 | |
| 141 | - 2、垂直对齐方式,0是上,1是中,2是下 | |
| 142 | - 3、水平偏移量 | |
| 143 | - 4、垂直偏移量 | |
| 144 | - 以下是播放器自带的二个插件 | |
| 145 | - */ | |
| 146 | - control_rel: 'related.swf,ckplayer/related.xml,0', | |
| 147 | - /* | |
| 148 | - 视频结束显示精彩视频的插件 | |
| 149 | - 1、视频播放结束后显示相关精彩视频的插件文件(注意,视频结束动作设置成3时(即var flashvars={e:3})有效), | |
| 150 | - 2、xml文件是调用精彩视频的示例文件,可以自定义文件类型(比如asp,php,jsp,.net只要输出的是xml格式就行),实际使用中一定要注意第二个参数的路径要正确 | |
| 151 | - 3、第三个参数是设置配置文件的编码,0是默认的utf-8,1是gbk2312 | |
| 152 | - */ | |
| 153 | - control_pv: 'Preview.swf,105,2000', | |
| 154 | - /* | |
| 155 | - 视频预览插件 | |
| 156 | - 1、插件文件名称(该插件和上面的精彩视频的插件都是放在风格压缩包里的) | |
| 157 | - 2、离进度栏的高(指的是插件的顶部离进度栏的位置) | |
| 158 | - 3、延迟时间(该处设置鼠标经过进度栏停顿多少毫秒后才显示插件) | |
| 159 | - 建议一定要设置延时时间,不然当鼠标在进度栏上划过的时候就会读取视频地址进行预览,很占资源 | |
| 160 | - */ | |
| 161 | - pm_repc: '', | |
| 162 | - /* | |
| 163 | - 视频地址替换符,该功能主要是用来做简单加密的功能,使用方法很简单,请注意,只针对f值是视频地址的时候有效,其它地方不能使用。具体的请查看http://www.ckplayer.com/manual.php?id=4#title_25 | |
| 164 | - */ | |
| 165 | - pm_spac: '|', | |
| 166 | - /* | |
| 167 | - 视频地址间隔符,这里主要是播放多段视频时使用普通调用方式或网址调用方式时使用的。默认使用|,如果视频地址里本身存在|的话需要另外设置一个间隔符,注意,即使只有一个视频也需要设置。另外在使用rtmp协议播放视频的时候,如果视频存在多级目录的话,这里要改成其它的符号,因为rtmp协议的视频地址多级的话也需要用到|隔开流地址和实例地址 | |
| 168 | - */ | |
| 169 | - pm_fpac: 'file->f', | |
| 170 | - /* | |
| 171 | - 该参数的功能是把自定义的flashvars里的变量替换成ckplayer里对应的变量,默认的参数的意思是把flashvars里的file值替换成f值,因为ckplayer里只认f值,多个替换之间用竖线隔开 | |
| 172 | - */ | |
| 173 | - pm_advtime: '2,0,-110,10,0,300,0', | |
| 174 | - /* | |
| 175 | - 前置广告倒计时文本位置,播放前置 广告时有个倒计时的显示文本框,这里是设置该文本框的位置和宽高,对齐方式的。一共7个参数,分别表示: | |
| 176 | - 1、水平对齐方式,0是左对齐,1是中间对齐,2是右对齐 | |
| 177 | - 2、垂直对齐方式,0是上对齐,1是中间对齐,2是低部对齐 | |
| 178 | - 3、水平位置偏移量 | |
| 179 | - 4、垂直位置偏移量 | |
| 180 | - 5、文字对齐方式,0是左对齐,1是中间对齐,2是右对齐,3是默认对齐 | |
| 181 | - 6、文本框宽席 | |
| 182 | - 7、文本框高度 | |
| 183 | - */ | |
| 184 | - pm_advstatus: '1,2,2,-200,-40', | |
| 185 | - /* | |
| 186 | - 前置广告静音按钮,静音按钮只在是视频广告时显示,当然也可以控制不显示 | |
| 187 | - 1、是否显示0不显示,1显示 | |
| 188 | - 2、水平对齐方式 | |
| 189 | - 3、垂直对齐方式 | |
| 190 | - 4、水平偏移量 | |
| 191 | - 5、垂直偏移量 | |
| 192 | - */ | |
| 193 | - pm_advjp: '1,1,2,2,-100,-40', | |
| 194 | - /* | |
| 195 | - 前置广告跳过广告按钮的位置 | |
| 196 | - 1、是否显示0不显示,1是显示 | |
| 197 | - 2、跳过按钮触发对象(值0/1,0是直接跳转,1是触发js:function ckadjump(){}) | |
| 198 | - 3、水平对齐方式 | |
| 199 | - 4、垂直对齐方式 | |
| 200 | - 5、水平偏移量 | |
| 201 | - 6、垂直偏移量 | |
| 202 | - */ | |
| 203 | - pm_padvc: '2,0,-13,-13', | |
| 204 | - /* | |
| 205 | - 暂停广告的关闭按钮的位置 | |
| 206 | - 1、水平对齐方式 | |
| 207 | - 2、垂直对齐方式 | |
| 208 | - 3、水平偏移量 | |
| 209 | - 4、垂直偏移量 | |
| 210 | - */ | |
| 211 | - pm_advms: '2,2,-46,-67', | |
| 212 | - /* | |
| 213 | - 滚动广告关闭按钮位置 | |
| 214 | - 1、水平对齐方式 | |
| 215 | - 2、垂直对齐方式 | |
| 216 | - 3、水平偏移量 | |
| 217 | - 4、垂直偏移量 | |
| 218 | - */ | |
| 219 | - pm_zip: '1,1,-20,-8,1,0,0', | |
| 220 | - /* | |
| 221 | - 加载皮肤压缩包时提示文字的位置 | |
| 222 | - 1、水平对齐方式,0是左对齐,1是中间对齐,2是右对齐 | |
| 223 | - 2、垂直对齐方式,0是上对齐,1是中间对齐,2是低部对齐 | |
| 224 | - 3、水平位置偏移量 | |
| 225 | - 4、垂直位置偏移量 | |
| 226 | - 5、文字对齐方式,0是左对齐,1是中间对齐,2是右对齐,3是默认对齐 | |
| 227 | - 6、文本框宽席 | |
| 228 | - 7、文本框高度 | |
| 229 | - */ | |
| 230 | - //pm_advmarquee: '1,2,50,-60,50,18,0,0x000000,50,0,20,1,15,2000', | |
| 231 | - pm_advmarquee: '1,2,50,-70,50,20,0,0x000000,50,0,20,1,30,2000', | |
| 232 | - /* | |
| 233 | - 滚动广告的控制,要使用的话需要在setup里的第9个参数设置成1 | |
| 234 | - 这里分二种情况,前六个参数是定位控制,第7个参数是设置定位方式(0:相对定位,1:绝对定位) | |
| 235 | - 第一种情况:第7个参数是0的时候,相对定位,就是播放器长宽变化的时候,控制栏也跟着变 | |
| 236 | - 1、默认1:中间对齐 | |
| 237 | - 2、上中下对齐(0是上,1是中,2是下) | |
| 238 | - 3、离左边的距离 | |
| 239 | - 4、Y轴偏移量 | |
| 240 | - 5、离右边的距离 | |
| 241 | - 6、高度 | |
| 242 | - 7、定位方式 | |
| 243 | - 第二种情况:第7个参数是1的时候,绝对定位,就是播放器长宽变化的时候,控制栏不跟着变,这种方式一般使用在控制栏大小不变的时候 | |
| 244 | - 1、左中右对齐方式(0是左,1是中间,2是右) | |
| 245 | - 2、上中下对齐(0是上,1是中,2是下) | |
| 246 | - 3、x偏移量 | |
| 247 | - 4、y偏移量 | |
| 248 | - 5、宽度 | |
| 249 | - 6、高度 | |
| 250 | - 7、定位方式 | |
| 251 | - 以上是前7个参数的作用 | |
| 252 | - 8、是文字广告的背景色 | |
| 253 | - 9、置背景色的透明度 | |
| 254 | - 10、控制滚动方向,0是水平滚动(包括左右),1是上下滚动(包括向上和向下) | |
| 255 | - 11、移动的单位时长,即移动单位像素所需要的时长,毫秒 | |
| 256 | - 12、移动的单位像素,正数同左/上,负数向右/下 | |
| 257 | - 13、是行高,这个在设置向上或向下滚动的时候有用处 | |
| 258 | - 14、控制向上或向下滚动时每次停止的时间 | |
| 259 | - */ | |
| 260 | - pm_glowfilter:'1,0x01485d, 100, 6, 3, 10, 1, 0, 0', | |
| 261 | - /* | |
| 262 | - 滚动文字广告是否采用发光滤镜 | |
| 263 | - 1、是否使用发光滤镜,0是不采用,1是使用 | |
| 264 | - 2、(default = 0xFF0000) — 光晕颜色,采用十六进制格式 0xRRGGBB。 默认值为 0xFF0000 | |
| 265 | - 3、(default = 100) — 颜色的 Alpha 透明度值。 有效值为 0 到 100。 例如,25 设置透明度为 25% | |
| 266 | - 4、(default = 6.0) — 水平模糊量。 有效值为 0 到 255(浮点)。 2 的乘方值(如 2、4、8、16 和 32)经过优化,呈现速度比其它值更快 | |
| 267 | - 5、(default = 6.0) — 垂直模糊量。 有效值为 0 到 255(浮点)。 2 的乘方值(如 2、4、8、16 和 32)经过优化,呈现速度比其它值更快 | |
| 268 | - 6、(default = 2) —光晕的强度。 该值越高,光晕的颜色越深,而且发光与背景之间的对比度也越强。 有效值为 0 到 255 | |
| 269 | - 7、(default = 1) — 应用滤镜的次数 | |
| 270 | - 8、(default = 0) — 指定发光是否为内侧发光。 值 1 指定发光是内侧发光。 值 0 指定发光是外侧发光(对象外缘周围的发光) | |
| 271 | - 9、(default = 0) — 指定对象是否具有挖空效果。 值为 1 将使对象的填充变为透明,并显示文档的背景颜色 | |
| 272 | - */ | |
| 273 | - advmarquee: escape('{a href="http://www.ckplayer.com"}{font color="#FFFFFF" size="12" face="Microsoft YaHei"}这里可以放文字广告,播放器默认使用这里设置的广告内容,如果不想在这里使用可以清空这里的内容,如果想在页面中实时定义滚动文字广告内容,可以清空这里的内容,然后在页面中设置广告函数。{/font}{/a}'), | |
| 274 | - /* | |
| 275 | - 该处是滚动文字广告的内容,如果不想在这里设置,就把这里清空并且在页面中使用js的函数定义function ckmarqueeadv(){return '广告内容'} | |
| 276 | - */ | |
| 277 | - mainfuntion:'', | |
| 278 | - /* | |
| 279 | - 当flashvars里s=3/4时,调用的函数包名称,默认为空,调用时间轴上的函数setAppObj | |
| 280 | - */ | |
| 281 | - flashplayer:'', | |
| 282 | - /* | |
| 283 | - 当flashvars里的s=3/4时,也可以把swf文件放在这里 | |
| 284 | - */ | |
| 285 | - calljs:'ckplayer_status,ckadjump,playerstop,ckmarqueeadv', | |
| 286 | - /* | |
| 287 | - 1、全局监听返回结果的函数 | |
| 288 | - 2、跳过广告的函数 | |
| 289 | - 3、播放结束时调用的js函数 | |
| 290 | - 4、加载滚动文字广告的函 | |
| 291 | - */ | |
| 292 | - myweb: escape(''), | |
| 293 | - /* | |
| 294 | - ------------------------------------------------------------------------------------------------------------------ | |
| 295 | - 以下内容部份是和插件相关的配置,请注意,自定义插件以及其配置的命名方式要注意,不要和系统的相重复,不然就会替换掉系统的相关设置,删除相关插件的话也可以同时删除相关的配置 | |
| 296 | - ------------------------------------------------------------------------------------------------------------------ | |
| 297 | - 以下内容定义自定义插件的相关配置,这里也可以自定义任何自己的插件需要配置的内容,当然,如果你某个插件不使用的话,也可以删除相关的配置 | |
| 298 | - ------------------------------------------------------------------------------------------------------------------ | |
| 299 | - */ | |
| 300 | - cpt_lights: '1', | |
| 301 | - /* | |
| 302 | - 该处定义是否使用开关灯,使用开灯效果时调用页面的js函数function closelights(){},关灯调用 function closelights(){}; | |
| 303 | - */ | |
| 304 | - cpt_share: 'ckplayer/share.xml', | |
| 305 | - /* | |
| 306 | - 分享插件调用的配置文件地址,此设设置成空,则不启用分享按钮 | |
| 307 | - 调用插件开始 | |
| 308 | - */ | |
| 309 | - cpt_list: ckcpt() | |
| 310 | - /* | |
| 311 | - ckcpt()是本文件最上方的定义插件的函数 | |
| 312 | - */ | |
| 313 | - } | |
| 314 | - return ck; | |
| 315 | -} | |
| 316 | -/* | |
| 317 | -html5部分开始 | |
| 318 | -以下代码是支持html5的,如果你不需要,可以删除。 | |
| 319 | -html5代码块的代码可以随意更改以适合你的应用,欢迎到论坛交流更改心得 | |
| 320 | -*/ | |
| 321 | -(function() { | |
| 322 | - var CKobject = { | |
| 323 | - _K_: function(d){return document.getElementById(d);}, | |
| 324 | - _T_: false, | |
| 325 | - _M_: false, | |
| 326 | - _G_: false, | |
| 327 | - _Y_: false, | |
| 328 | - _I_: null, | |
| 329 | - _J_: 0, | |
| 330 | - _O_: {}, | |
| 331 | - uaMatch:function(u,rMsie,rFirefox,rOpera,rChrome,rSafari,rSafari2,mozilla,mobile){ | |
| 332 | - var match = rMsie.exec(u); | |
| 333 | - if (match != null) { | |
| 334 | - return { | |
| 335 | - b: 'IE', | |
| 336 | - v: match[2] || '0' | |
| 337 | - } | |
| 338 | - } | |
| 339 | - match = rFirefox.exec(u); | |
| 340 | - if (match != null) { | |
| 341 | - return { | |
| 342 | - b: match[1] || '', | |
| 343 | - v: match[2] || '0' | |
| 344 | - } | |
| 345 | - } | |
| 346 | - match = rOpera.exec(u); | |
| 347 | - if (match != null) { | |
| 348 | - return { | |
| 349 | - b: match[1] || '', | |
| 350 | - v: match[2] || '0' | |
| 351 | - } | |
| 352 | - } | |
| 353 | - match = rChrome.exec(u); | |
| 354 | - if (match != null) { | |
| 355 | - return { | |
| 356 | - b: match[1] || '', | |
| 357 | - v: match[2] || '0' | |
| 358 | - } | |
| 359 | - } | |
| 360 | - match = rSafari.exec(u); | |
| 361 | - if (match != null) { | |
| 362 | - return { | |
| 363 | - b: match[2] || '', | |
| 364 | - v: match[1] || '0' | |
| 365 | - } | |
| 366 | - } | |
| 367 | - match = rSafari2.exec(u); | |
| 368 | - if (match != null) { | |
| 369 | - return { | |
| 370 | - b: match[1] || '', | |
| 371 | - v: match[2] || '0' | |
| 372 | - } | |
| 373 | - } | |
| 374 | - match = mozilla.exec(u); | |
| 375 | - if (match != null) { | |
| 376 | - return { | |
| 377 | - b: match[1] || '', | |
| 378 | - v: match[2] || '0' | |
| 379 | - } | |
| 380 | - } | |
| 381 | - match = mobile.exec(u); | |
| 382 | - if (match != null) { | |
| 383 | - return { | |
| 384 | - b: match[1] || '', | |
| 385 | - v: match[2] || '0' | |
| 386 | - } | |
| 387 | - } | |
| 388 | - else { | |
| 389 | - return { | |
| 390 | - b: 'unknown', | |
| 391 | - v: '0' | |
| 392 | - } | |
| 393 | - } | |
| 394 | - }, | |
| 395 | - browser: function() { | |
| 396 | - var u = navigator.userAgent, | |
| 397 | - rMsie = /(msie\s|trident.*rv:)([\w.]+)/, | |
| 398 | - rFirefox = /(firefox)\/([\w.]+)/, | |
| 399 | - rOpera = /(opera).+version\/([\w.]+)/, | |
| 400 | - rChrome = /(chrome)\/([\w.]+)/, | |
| 401 | - rSafari = /version\/([\w.]+).*(safari)/, | |
| 402 | - rSafari2 = /(safari)\/([\w.]+)/, | |
| 403 | - mozilla = /(mozilla)\/([\w.]+)/, | |
| 404 | - mobile = /(mobile)\/([\w.]+)/; | |
| 405 | - var c = u.toLowerCase(); | |
| 406 | - var d = this.uaMatch(c,rMsie,rFirefox,rOpera,rChrome,rSafari,rSafari2,mozilla,mobile); | |
| 407 | - if (d.b) { | |
| 408 | - b = d.b; | |
| 409 | - v = d.v; | |
| 410 | - } | |
| 411 | - return {B: b, V: v}; | |
| 412 | - }, | |
| 413 | - Platform: function() { | |
| 414 | - var w = ''; | |
| 415 | - var u = navigator.userAgent, | |
| 416 | - app = navigator.appVersion; | |
| 417 | - var b = { | |
| 418 | - iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, | |
| 419 | - iPad: u.indexOf('iPad') > -1, | |
| 420 | - ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), | |
| 421 | - android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, | |
| 422 | - webKit: u.indexOf('AppleWebKit') > -1, | |
| 423 | - trident: u.indexOf('Trident') > -1, | |
| 424 | - gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, | |
| 425 | - presto: u.indexOf('Presto') > -1, | |
| 426 | - mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/), | |
| 427 | - webApp: u.indexOf('Safari') == -1 | |
| 428 | - }; | |
| 429 | - for (var k in b) { | |
| 430 | - if (b[k]) { | |
| 431 | - w = k; | |
| 432 | - break; | |
| 433 | - } | |
| 434 | - } | |
| 435 | - return w; | |
| 436 | - }, | |
| 437 | - isHTML5:function(){ | |
| 438 | - return !!document.createElement('video').canPlayType; | |
| 439 | - }, | |
| 440 | - getType:function(){ | |
| 441 | - return this._T_; | |
| 442 | - }, | |
| 443 | - getVideo: function() { | |
| 444 | - var v = ''; | |
| 445 | - var s = this._E_['v']; | |
| 446 | - if (s && s.length>1) { | |
| 447 | - for (var i = 0; i < s.length; i++) { | |
| 448 | - var a = s[i].split('->'); | |
| 449 | - if (a.length >= 1 && a[0] != '') { | |
| 450 | - v += '<source src="' + a[0] + '"'; | |
| 451 | - } | |
| 452 | - if (a.length >= 2 && a[1] != '') { | |
| 453 | - v += ' type="' + a[1] + '"'; | |
| 454 | - } | |
| 455 | - v += '>'; | |
| 456 | - } | |
| 457 | - } | |
| 458 | - return v; | |
| 459 | - }, | |
| 460 | - getVars: function(k) { | |
| 461 | - var o=this._A_; | |
| 462 | - if (typeof(o) == 'undefined') { | |
| 463 | - return null; | |
| 464 | - } | |
| 465 | - if (k in o) { | |
| 466 | - return o[k]; | |
| 467 | - } else { | |
| 468 | - return null; | |
| 469 | - } | |
| 470 | - }, | |
| 471 | - getParams: function() { | |
| 472 | - var p = ''; | |
| 473 | - if (this._A_) { | |
| 474 | - if (parseInt(this.getVars('p')) == 1) { | |
| 475 | - p += ' autoplay="autoplay"'; | |
| 476 | - } | |
| 477 | - if (parseInt(this.getVars('e')) == 1) { | |
| 478 | - p += ' loop="loop"'; | |
| 479 | - } | |
| 480 | - if (parseInt(this.getVars('p')) == 2) { | |
| 481 | - p += ' preload="metadata"'; | |
| 482 | - } | |
| 483 | - if (this.getVars('i')) { | |
| 484 | - p += ' poster="' + this.getVars('i') + '"'; | |
| 485 | - } | |
| 486 | - } | |
| 487 | - return p; | |
| 488 | - }, | |
| 489 | - getpath: function(z) { | |
| 490 | - var f='CDEFGHIJKLMNOPQRSTUVWXYZcdefghijklmnopqrstuvwxyz'; | |
| 491 | - var w=z.substr(0,1); | |
| 492 | - if(f.indexOf(w)>-1 && (z.substr(0,4)==w+'://' || z.substr(0,4)==w+':\\')){ | |
| 493 | - return z; | |
| 494 | - } | |
| 495 | - var d = unescape(window.location.href).replace('file:///', ''); | |
| 496 | - var k = parseInt(document.location.port); | |
| 497 | - var u = document.location.protocol + '//' + document.location.hostname; | |
| 498 | - var l = '', | |
| 499 | - e = '', | |
| 500 | - t = ''; | |
| 501 | - var s = 0; | |
| 502 | - var r = unescape(z).split('//'); | |
| 503 | - if (r.length > 0) { | |
| 504 | - l = r[0] + '//' | |
| 505 | - } | |
| 506 | - var h = 'http|https|ftp|rtsp|mms|ftp|rtmp|file'; | |
| 507 | - var a = h.split('|'); | |
| 508 | - if (k != 80 && k) { | |
| 509 | - u += ':' + k; | |
| 510 | - } | |
| 511 | - for (i = 0; i < a.length; i++) { | |
| 512 | - if ((a[i] + '://') == l) { | |
| 513 | - s = 1; | |
| 514 | - break; | |
| 515 | - } | |
| 516 | - } | |
| 517 | - if (s == 0) { | |
| 518 | - if (z.substr(0, 1) == '/') { | |
| 519 | - t = u + z; | |
| 520 | - } else { | |
| 521 | - e = d.substring(0, d.lastIndexOf('/') + 1).replace('\\', '/'); | |
| 522 | - var w = z.replace('../', './'); | |
| 523 | - var u = w.split('./'); | |
| 524 | - var n = u.length; | |
| 525 | - var r = w.replace('./', ''); | |
| 526 | - var q = e.split('/'); | |
| 527 | - var j = q.length - n; | |
| 528 | - for (i = 0; i < j; i++) { | |
| 529 | - t += q[i] + '/'; | |
| 530 | - } | |
| 531 | - t += r; | |
| 532 | - } | |
| 533 | - } else { | |
| 534 | - t = z; | |
| 535 | - } | |
| 536 | - return t; | |
| 537 | - }, | |
| 538 | - getXhr: function() { | |
| 539 | - var x; | |
| 540 | - try { | |
| 541 | - x = new ActiveXObject('Msxml2.XMLHTTP'); | |
| 542 | - } catch(e) { | |
| 543 | - try { | |
| 544 | - x = new ActiveXObject('Microsoft.XMLHTTP'); | |
| 545 | - } catch(e) { | |
| 546 | - x = false; | |
| 547 | - } | |
| 548 | - } | |
| 549 | - if (!x && typeof XMLHttpRequest != 'undefined') { | |
| 550 | - x = new XMLHttpRequest(); | |
| 551 | - } | |
| 552 | - return x; | |
| 553 | - }, | |
| 554 | - getX: function(){ | |
| 555 | - var f='ckstyle()'; | |
| 556 | - if (this.getVars('x') && parseInt(this.getVars('c'))!=1 ) { | |
| 557 | - f=this.getVars('x')+'()'; | |
| 558 | - } | |
| 559 | - try { | |
| 560 | - if (typeof(eval(f)) == 'object') { | |
| 561 | - this._X_ = eval(f); | |
| 562 | - } | |
| 563 | - } catch(e) { | |
| 564 | - try { | |
| 565 | - if (typeof(eval(ckstyle)) == 'object') { | |
| 566 | - this._X_ = ckstyle(); | |
| 567 | - } | |
| 568 | - } catch(e) { | |
| 569 | - this._X_ = ckstyle(); | |
| 570 | - } | |
| 571 | - } | |
| 572 | - }, | |
| 573 | - getSn: function(s, n) { | |
| 574 | - if(n>=0){ | |
| 575 | - return this._X_[s].split(',')[n]; | |
| 576 | - } | |
| 577 | - else{ | |
| 578 | - return this._X_[s]; | |
| 579 | - } | |
| 580 | - }, | |
| 581 | - getUrl: function(L, B) { | |
| 582 | - var C = this; | |
| 583 | - var b = ['get', 'utf-8']; | |
| 584 | - if (L && L.length == 2) { | |
| 585 | - var a = L[0]; | |
| 586 | - var c = L[1].split('/'); | |
| 587 | - if (c.length >= 2) { | |
| 588 | - b[0] = c[1]; | |
| 589 | - } | |
| 590 | - if (c.length >= 3) { | |
| 591 | - b[1] = c[2]; | |
| 592 | - } | |
| 593 | - this.ajax(b[0], b[1], a, | |
| 594 | - function(s) { | |
| 595 | - if (s && s != 'error') { | |
| 596 | - var d = '', | |
| 597 | - e = s; | |
| 598 | - if (s.indexOf('}') > -1) { | |
| 599 | - var f = s.split('}'); | |
| 600 | - for (var i = 0; i < f.length - 1; i++) { | |
| 601 | - d += f[i] + '}'; | |
| 602 | - var h = f[i].replace('{', '').split('->'); | |
| 603 | - if (h.length == 2) { | |
| 604 | - C._A_[h[0]] = h[1]; | |
| 605 | - } | |
| 606 | - } | |
| 607 | - e = f[f.length - 1]; | |
| 608 | - } | |
| 609 | - C._E_['v'] = e.split(','); | |
| 610 | - if (B) { | |
| 611 | - C.showHtml5(); | |
| 612 | - } else { | |
| 613 | - C.changeParams(d); | |
| 614 | - C.newAdr(); | |
| 615 | - } | |
| 616 | - } | |
| 617 | - }); | |
| 618 | - } | |
| 619 | - }, | |
| 620 | - getflashvars: function(s) { | |
| 621 | - var v = '', | |
| 622 | - i = 0; | |
| 623 | - if (s) { | |
| 624 | - for (var k in s) { | |
| 625 | - if (i > 0) { | |
| 626 | - v += '&'; | |
| 627 | - } | |
| 628 | - if (k == 'f' && s[k] && ! this.getSn('pm_repc',-1)) { | |
| 629 | - s[k] = this.getpath(s[k]); | |
| 630 | - if (s[k].indexOf('&') > -1) { | |
| 631 | - s[k] = encodeURIComponent(s[k]); | |
| 632 | - } | |
| 633 | - } | |
| 634 | - if (k == 'y' && s[k]) { | |
| 635 | - s[k] = this.getpath(s[k]); | |
| 636 | - } | |
| 637 | - v += k + '=' + s[k]; | |
| 638 | - i++; | |
| 639 | - } | |
| 640 | - } | |
| 641 | - return v; | |
| 642 | - }, | |
| 643 | - getparam: function(s) { | |
| 644 | - var w = '', | |
| 645 | - v = '', | |
| 646 | - o = { | |
| 647 | - allowScriptAccess: 'always', | |
| 648 | - allowFullScreen: true, | |
| 649 | - quality: 'high', | |
| 650 | - bgcolor: '#000' | |
| 651 | - }; | |
| 652 | - if (s) { | |
| 653 | - for (var k in s) { | |
| 654 | - o[k] = s[k]; | |
| 655 | - } | |
| 656 | - } | |
| 657 | - for (var e in o) { | |
| 658 | - w += e + '="' + o[e] + '" '; | |
| 659 | - v += '<param name="' + e + '" value="' + o[e] + '" />'; | |
| 660 | - } | |
| 661 | - w = w.replace('movie=', 'src='); | |
| 662 | - return { | |
| 663 | - w: w, | |
| 664 | - v: v | |
| 665 | - }; | |
| 666 | - }, | |
| 667 | - getObjectById: function(s) { | |
| 668 | - var C = this; | |
| 669 | - if (C._T_) { | |
| 670 | - C._V_=C._K_(s) | |
| 671 | - return C ; | |
| 672 | - } | |
| 673 | - var x = null, | |
| 674 | - y = C._K_(s), | |
| 675 | - r = 'embed'; | |
| 676 | - if (y && y.nodeName == 'OBJECT') { | |
| 677 | - if (typeof y.SetVariable != 'undefined') { | |
| 678 | - x= y; | |
| 679 | - } else { | |
| 680 | - var z = y.getElementsByTagName(r)[0]; | |
| 681 | - if (z) { | |
| 682 | - x= z; | |
| 683 | - } | |
| 684 | - } | |
| 685 | - } | |
| 686 | - return x; | |
| 687 | - }, | |
| 688 | - ajax: function(b, u, s, f) { | |
| 689 | - var x = this.getXhr(); | |
| 690 | - var a = [], | |
| 691 | - m = ''; | |
| 692 | - if (b == 'get') { | |
| 693 | - if (s.indexOf('?') > -1) { | |
| 694 | - m = s + '&t=' + new Date().getTime(); | |
| 695 | - } else { | |
| 696 | - m = s + '?t=' + new Date().getTime(); | |
| 697 | - } | |
| 698 | - x.open('get', m); | |
| 699 | - } else { | |
| 700 | - a = s.split('?'); | |
| 701 | - s = a[0], | |
| 702 | - m = a[1]; | |
| 703 | - x.open('post', s, true); | |
| 704 | - } | |
| 705 | - x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); | |
| 706 | - x.setRequestHeader('charset', u); | |
| 707 | - if (b == 'post') { | |
| 708 | - x.send(m); | |
| 709 | - } else { | |
| 710 | - x.send(null); | |
| 711 | - } | |
| 712 | - x.onreadystatechange = function() { | |
| 713 | - if (x.readyState == 4) { | |
| 714 | - var g = x.responseText; | |
| 715 | - if (g != '') { | |
| 716 | - f(g); | |
| 717 | - } else { | |
| 718 | - f(null); | |
| 719 | - } | |
| 720 | - } | |
| 721 | - } | |
| 722 | - }, | |
| 723 | - addListener: function(e, f) { | |
| 724 | - var o=this._V_; | |
| 725 | - switch(e){ | |
| 726 | - case 'time': | |
| 727 | - e='timeupdate'; | |
| 728 | - this.AT=f; | |
| 729 | - f=this.addListenerTime; | |
| 730 | - break; | |
| 731 | - case 'totaltime': | |
| 732 | - this.ATAll=f; | |
| 733 | - return; | |
| 734 | - break; | |
| 735 | - default: | |
| 736 | - break; | |
| 737 | - } | |
| 738 | - //console.log(typeof(f)); | |
| 739 | - if(typeof(f)=='string'){ | |
| 740 | - f=eval(f); | |
| 741 | - } | |
| 742 | - if (o.addEventListener) { | |
| 743 | - try{ | |
| 744 | - o.addEventListener(e, f, false); | |
| 745 | - } | |
| 746 | - catch (e) { | |
| 747 | - this.getNot(); | |
| 748 | - } | |
| 749 | - } | |
| 750 | - else if (o.attachEvent) { | |
| 751 | - try{ | |
| 752 | - o.attachEvent('on' + e, f); | |
| 753 | - } | |
| 754 | - catch(e){ | |
| 755 | - this.getNot(); | |
| 756 | - } | |
| 757 | - } | |
| 758 | - else { | |
| 759 | - o['on' + e] = f; | |
| 760 | - } | |
| 761 | - }, | |
| 762 | - removeListener: function( e, f) { | |
| 763 | - var o=this._V_; | |
| 764 | - switch(e){ | |
| 765 | - case 'time': | |
| 766 | - e='timeupdate'; | |
| 767 | - this.AT=null; | |
| 768 | - break; | |
| 769 | - case 'totaltime': | |
| 770 | - this.ATAll=null; | |
| 771 | - return; | |
| 772 | - break; | |
| 773 | - default: | |
| 774 | - break; | |
| 775 | - } | |
| 776 | - if(typeof(f)=='string'){ | |
| 777 | - f=eval(f); | |
| 778 | - } | |
| 779 | - if (o.removeEventListener) { | |
| 780 | - try{ | |
| 781 | - o.removeEventListener(e, f, false); | |
| 782 | - } | |
| 783 | - catch(e){ | |
| 784 | - this.getNot(); | |
| 785 | - } | |
| 786 | - } | |
| 787 | - else if (o.detachEvent) { | |
| 788 | - try{ | |
| 789 | - o.detachEvent('on' + e, f); | |
| 790 | - } | |
| 791 | - catch(e){ | |
| 792 | - this.getNot(); | |
| 793 | - } | |
| 794 | - } | |
| 795 | - else { | |
| 796 | - o['on' + e] = null; | |
| 797 | - } | |
| 798 | - }, | |
| 799 | - Flash: function() { | |
| 800 | - var f = false,v = 0; | |
| 801 | - if (document.all || this.browser()['B'].toLowerCase().indexOf('ie')>-1) { | |
| 802 | - try { | |
| 803 | - var s = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); | |
| 804 | - f = true; | |
| 805 | - var z = s.GetVariable('$version'); | |
| 806 | - v = parseInt(z.split(' ')[1].split(',')[0]); | |
| 807 | - } catch(e) {} | |
| 808 | - } else { | |
| 809 | - if (navigator.plugins && navigator.plugins.length > 0) { | |
| 810 | - var s = navigator.plugins['Shockwave Flash']; | |
| 811 | - if (s) { | |
| 812 | - f = true; | |
| 813 | - var w = s.description.split(' '); | |
| 814 | - for (var i = 0; i < w.length; ++i) { | |
| 815 | - if (isNaN(parseInt(w[i]))) continue; | |
| 816 | - v = parseInt(w[i]); | |
| 817 | - } | |
| 818 | - } | |
| 819 | - } | |
| 820 | - } | |
| 821 | - return { | |
| 822 | - f: f, | |
| 823 | - v: v | |
| 824 | - }; | |
| 825 | - }, | |
| 826 | - embed:function(f,d,i,w,h,b,v,e,p,j){ | |
| 827 | - var s=['all']; | |
| 828 | - if(b){ | |
| 829 | - if(this.isHTML5()){ | |
| 830 | - this.embedHTML5(d,i,w,h,e,v,s,j); | |
| 831 | - } | |
| 832 | - else{ | |
| 833 | - this.embedSWF(f,d,i,w,h,v,p); | |
| 834 | - } | |
| 835 | - } | |
| 836 | - else{ | |
| 837 | - if(this.Flash()['f'] && parseInt(this.Flash()['v'])>10){ | |
| 838 | - this.embedSWF(f,d,i,w,h,v,p); | |
| 839 | - } | |
| 840 | - else if(this.isHTML5()){ | |
| 841 | - this.embedHTML5(d,i,w,h,e,v,s,j); | |
| 842 | - } | |
| 843 | - else{ | |
| 844 | - this.embedSWF(f,d,i,w,h,v,p); | |
| 845 | - } | |
| 846 | - } | |
| 847 | - }, | |
| 848 | - embedSWF: function(C, D, N, W, H, V, P) { | |
| 849 | - if (!N) { | |
| 850 | - N = 'ckplayer_a1' | |
| 851 | - } | |
| 852 | - if (!P) { | |
| 853 | - P = { | |
| 854 | - bgcolor: '#FFF', | |
| 855 | - allowFullScreen: true, | |
| 856 | - allowScriptAccess: 'always', | |
| 857 | - wmode:'transparent' | |
| 858 | - }; | |
| 859 | - } | |
| 860 | - this._A_=V; | |
| 861 | - this.getX(); | |
| 862 | - var u = 'undefined', | |
| 863 | - g = false, | |
| 864 | - j = document, | |
| 865 | - r = 'http://www.macromedia.com/go/getflashplayer', | |
| 866 | - t = '<a href="' + r + '" target="_blank">请点击此处下载安装最新的flash插件</a>', | |
| 867 | - error = { | |
| 868 | - w: '您的网页不符合w3c标准,无法显示播放器', | |
| 869 | - f: '您没有安装flash插件,无法播放视频,' + t, | |
| 870 | - v: '您的flash插件版本过低,无法播放视频,' + t | |
| 871 | - }, | |
| 872 | - w3c = typeof j.getElementById != u && typeof j.getElementsByTagName != u && typeof j.createElement != u, | |
| 873 | - i = 'id="' + N + '" name="' + N + '" ', | |
| 874 | - s = '', | |
| 875 | - l = ''; | |
| 876 | - P['movie'] = C; | |
| 877 | - P['flashvars'] = this.getflashvars(V); | |
| 878 | - if(W==-1){ | |
| 879 | - d=true; | |
| 880 | - this._K_(D).style.width='100%'; | |
| 881 | - W='100%'; | |
| 882 | - } | |
| 883 | - s += '<object pluginspage="http://www.macromedia.com/go/getflashplayer" '; | |
| 884 | - s += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '; | |
| 885 | - s += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=11,3,0,0" '; | |
| 886 | - s += 'width="' + W + '" '; | |
| 887 | - s += 'height="' + H + '" '; | |
| 888 | - s += i; | |
| 889 | - s += 'align="middle">'; | |
| 890 | - s += this.getparam(P)['v']; | |
| 891 | - s += '<embed '; | |
| 892 | - s += this.getparam(P)['w']; | |
| 893 | - s += ' width="' + W + '" height="' + H + '" name="' + N + '" id="' + N + '" align="middle" ' + i; | |
| 894 | - s += 'type="application/x-shockwave-flash" pluginspage="' + r + '" />'; | |
| 895 | - s += '</object>'; | |
| 896 | - if (!w3c) { | |
| 897 | - l = error['w']; | |
| 898 | - g = true; | |
| 899 | - } else { | |
| 900 | - if (!this.Flash()['f']) { | |
| 901 | - l = error['f']; | |
| 902 | - g = true; | |
| 903 | - } else { | |
| 904 | - if (this.Flash()['v'] < 11) { | |
| 905 | - l = error['v']; | |
| 906 | - g = true; | |
| 907 | - } else { | |
| 908 | - l = s; | |
| 909 | - this._T_=false; | |
| 910 | - } | |
| 911 | - } | |
| 912 | - } | |
| 913 | - if (l) { | |
| 914 | - this._K_(D).innerHTML = l; | |
| 915 | - } | |
| 916 | - if (g){ | |
| 917 | - this._K_(D).style.color = '#0066cc'; | |
| 918 | - this._K_(D).style.lineHeight = this._K_(D).style.height; | |
| 919 | - this._K_(D).style.textAlign= 'center'; | |
| 920 | - } | |
| 921 | - }, | |
| 922 | - embedHTML5: function(C, P, W, H, V, A, S, J) { | |
| 923 | - this._E_ = { | |
| 924 | - c: C, | |
| 925 | - p: P, | |
| 926 | - w: W, | |
| 927 | - h: H, | |
| 928 | - v: V, | |
| 929 | - s: S, | |
| 930 | - j: J==undefined || J?true:false | |
| 931 | - }; | |
| 932 | - this._A_ = A; | |
| 933 | - this.getX(); | |
| 934 | - b = this.browser()['B'], | |
| 935 | - v = this.browser()['V'], | |
| 936 | - x = v.split('.'), | |
| 937 | - t = x[0], | |
| 938 | - m = b + v, | |
| 939 | - n = b + t, | |
| 940 | - w = '', | |
| 941 | - s = false, | |
| 942 | - f = this.Flash()['f'], | |
| 943 | - a = false; | |
| 944 | - if (!S) { | |
| 945 | - S = ['iPad', 'iPhone', 'ios']; | |
| 946 | - } | |
| 947 | - for (var i = 0; i < S.length; i++) { | |
| 948 | - w = S[i]; | |
| 949 | - if (w.toLowerCase() == 'all') { | |
| 950 | - s = true; | |
| 951 | - break; | |
| 952 | - } | |
| 953 | - if (w.toLowerCase() == 'all+false' && !f) { | |
| 954 | - s = true; | |
| 955 | - break; | |
| 956 | - } | |
| 957 | - if (w.indexOf('+') > -1) { | |
| 958 | - w = w.split('+')[0]; | |
| 959 | - a = true; | |
| 960 | - } else { | |
| 961 | - a = false; | |
| 962 | - } | |
| 963 | - if (this.Platform() == w || m == w || n == w || b == w) { | |
| 964 | - if (a) { | |
| 965 | - if (!f) { | |
| 966 | - s = true; | |
| 967 | - break; | |
| 968 | - } | |
| 969 | - }else { | |
| 970 | - s = true; | |
| 971 | - break; | |
| 972 | - } | |
| 973 | - } | |
| 974 | - } | |
| 975 | - if (s) { | |
| 976 | - if (V) { | |
| 977 | - var l = V[0].split('->'); | |
| 978 | - if (l && l.length == 2 && l[1].indexOf('ajax') > -1) { | |
| 979 | - this.getUrl(l, true); | |
| 980 | - return; | |
| 981 | - } | |
| 982 | - } | |
| 983 | - this.showHtml5(); | |
| 984 | - } | |
| 985 | - }, | |
| 986 | - status: function() { | |
| 987 | - this._H_ = parseInt(this.getSn('setup', 20)); | |
| 988 | - var f='ckplayer_status'; | |
| 989 | - if (this.getSn('calljs', 0)!='') { | |
| 990 | - f=this.getSn('calljs', 0); | |
| 991 | - } | |
| 992 | - try { | |
| 993 | - if (typeof(eval(f)) == 'function') { | |
| 994 | - this._L_=eval(f); | |
| 995 | - this._M_=true; | |
| 996 | - return true; | |
| 997 | - } | |
| 998 | - } catch(e) { | |
| 999 | - try { | |
| 1000 | - if (typeof(eval(ckplayer_status)) == 'function') { | |
| 1001 | - this._L_=ckplayer_status; | |
| 1002 | - this._M_=true; | |
| 1003 | - return true; | |
| 1004 | - } | |
| 1005 | - } catch(e) { | |
| 1006 | - return false; | |
| 1007 | - } | |
| 1008 | - } | |
| 1009 | - return false; | |
| 1010 | - }, | |
| 1011 | - showHtml5: function() { | |
| 1012 | - var C = this; | |
| 1013 | - var p = C._E_['p'], | |
| 1014 | - a = C._E_['v'], | |
| 1015 | - c = C._E_['c'], | |
| 1016 | - j = '', | |
| 1017 | - b = false; | |
| 1018 | - var s = this._E_['v']; | |
| 1019 | - var w=C._E_['w'],h=C._E_['h']; | |
| 1020 | - var d=false; | |
| 1021 | - var r=''; | |
| 1022 | - if(s.length==1){ | |
| 1023 | - r=' src="'+s[0].split('->')[0]+'"'; | |
| 1024 | - } | |
| 1025 | - if(w==-1){ | |
| 1026 | - d=true; | |
| 1027 | - C._K_(c).style.width='100%'; | |
| 1028 | - w='100%'; | |
| 1029 | - } | |
| 1030 | - if(w.toString().indexOf('%')>-1){ | |
| 1031 | - w='100%'; | |
| 1032 | - } | |
| 1033 | - if(h.toString().indexOf('%')>-1){ | |
| 1034 | - h='100%'; | |
| 1035 | - } | |
| 1036 | - if(C._E_['j']){ | |
| 1037 | - j=' controls="controls"'; | |
| 1038 | - } | |
| 1039 | - var v = '<video'+j+r+' id="' + p + '" width="' + w + '" height="' + h + '"' + C.getParams() + ' webkit-playsinline>' + C.getVideo() + '</video>'; | |
| 1040 | - C._K_(c).innerHTML = v; | |
| 1041 | - C._K_(c).style.backgroundColor = '#000'; | |
| 1042 | - C._V_ = C._K_(p); | |
| 1043 | - if(!d){ | |
| 1044 | - C._K_(c).style.width=C._E_['w'].toString().indexOf('%')>-1?(C._K_(c).offsetWidth*parseInt(C._E_['w'])*0.01)+'px':C._V_.width+'px'; | |
| 1045 | - C._K_(c).style.height=C._E_['h'].toString().indexOf('%')>-1?(C._K_(c).offsetHeight*parseInt(C._E_['h'])*0.01)+'px':C._V_.height+'px'; | |
| 1046 | - } | |
| 1047 | - C._P_ = false; | |
| 1048 | - C._T_ = true; | |
| 1049 | - if (C.getVars('loaded')!='') { | |
| 1050 | - var f=C.getVars('loaded')+'()'; | |
| 1051 | - try { | |
| 1052 | - if (typeof(eval(f)) == 'function') { | |
| 1053 | - eval(f); | |
| 1054 | - } | |
| 1055 | - } catch(e) { | |
| 1056 | - try { | |
| 1057 | - if (typeof(eval(loadedHandler)) == 'function') { | |
| 1058 | - loadedHandler(); | |
| 1059 | - } | |
| 1060 | - } catch(e) { | |
| 1061 | - } | |
| 1062 | - } | |
| 1063 | - } | |
| 1064 | - C.status(); | |
| 1065 | - C.addListener('play', C.playHandler); | |
| 1066 | - C.addListener('pause', C.playHandler); | |
| 1067 | - C.addListener('error', C.errorHandler); | |
| 1068 | - C.addListener('emptied', C.errorHandler); | |
| 1069 | - C.addListener('loadedmetadata', C.loadedMetadataHandler); | |
| 1070 | - C.addListener('ended', C.endedHandler); | |
| 1071 | - C.addListener('volumechange', C.volumeChangeHandler); | |
| 1072 | - if((C.getVars('m')!='' && C.getVars('m')!=null) || parseInt( C.getSn('setup', 0))>0){ | |
| 1073 | - C._K_(c).style.cursor='pointer'; | |
| 1074 | - } | |
| 1075 | - if((C.getVars('m')!='' && C.getVars('m')!=null) || parseInt( C.getSn('setup', 1))==1){ | |
| 1076 | - C.addListener('click', C.html5Click); | |
| 1077 | - } | |
| 1078 | - }, | |
| 1079 | - addListenerTime:function(){ | |
| 1080 | - var C = CKobject; | |
| 1081 | - if(C.AT){ | |
| 1082 | - C.AT(C._V_['currentTime']); | |
| 1083 | - } | |
| 1084 | - }, | |
| 1085 | - videoPlay: function() { | |
| 1086 | - if (this._T_) { | |
| 1087 | - this._V_.play(); | |
| 1088 | - } | |
| 1089 | - }, | |
| 1090 | - videoPause: function() { | |
| 1091 | - if (this._T_) { | |
| 1092 | - this._V_.pause(); | |
| 1093 | - } | |
| 1094 | - }, | |
| 1095 | - playOrPause: function() { | |
| 1096 | - if (this._T_) { | |
| 1097 | - if (this._V_.paused) { | |
| 1098 | - this._V_.play(); | |
| 1099 | - } else { | |
| 1100 | - this._V_.pause(); | |
| 1101 | - } | |
| 1102 | - } | |
| 1103 | - }, | |
| 1104 | - fastNext: function() { | |
| 1105 | - if (this._T_) { | |
| 1106 | - this._V_['currentTime'] = this._V_['currentTime'] + 10; | |
| 1107 | - } | |
| 1108 | - }, | |
| 1109 | - fastBack: function() { | |
| 1110 | - if (this._T_) { | |
| 1111 | - this._V_['currentTime'] = this._V_['currentTime'] - 10; | |
| 1112 | - } | |
| 1113 | - }, | |
| 1114 | - changeVolume: function(n) { | |
| 1115 | - if(n<0 || n>100){ | |
| 1116 | - return; | |
| 1117 | - } | |
| 1118 | - if (this._T_) { | |
| 1119 | - this._V_['volume'] = n * 0.01; | |
| 1120 | - } | |
| 1121 | - }, | |
| 1122 | - videoSeek: function(t) { | |
| 1123 | - if (this._T_) { | |
| 1124 | - this._V_['currentTime'] = t; | |
| 1125 | - } | |
| 1126 | - }, | |
| 1127 | - newAddress: function(u) { | |
| 1128 | - var s = []; | |
| 1129 | - if (u) { | |
| 1130 | - s = this.isHtml5New(u); | |
| 1131 | - } else { | |
| 1132 | - return; | |
| 1133 | - } | |
| 1134 | - if (s && this._T_) { | |
| 1135 | - this.changeParams(u); | |
| 1136 | - var l = s[0].split('->'); | |
| 1137 | - if (l && l.length == 2 && l[1].indexOf('ajax') > -1) { | |
| 1138 | - this.getUrl(l, false); | |
| 1139 | - return; | |
| 1140 | - } | |
| 1141 | - this._E_['v'] = s; | |
| 1142 | - this.newAdr(); | |
| 1143 | - } | |
| 1144 | - }, | |
| 1145 | - quitFullScreen:function() { | |
| 1146 | - if(document.cancelFullScreen) { | |
| 1147 | - document.cancelFullScreen(); | |
| 1148 | - } | |
| 1149 | - else if(document.mozCancelFullScreen) { | |
| 1150 | - document.mozCancelFullScreen(); | |
| 1151 | - } else if(document.webkitCancelFullScreen) { | |
| 1152 | - document.webkitCancelFullScreen(); | |
| 1153 | - } | |
| 1154 | - | |
| 1155 | - }, | |
| 1156 | - changeStatus:function(n){ | |
| 1157 | - this._H_=n; | |
| 1158 | - }, | |
| 1159 | - newAdr: function() { | |
| 1160 | - var s = this._E_['v']; | |
| 1161 | - this._V_.pause(); | |
| 1162 | - if(s.length==1){ | |
| 1163 | - this._V_.src=s[0].split('->')[0]; | |
| 1164 | - } | |
| 1165 | - else{ | |
| 1166 | - this._V_['innerHTML'] = this.getVideo(); | |
| 1167 | - } | |
| 1168 | - this._V_.load(); | |
| 1169 | - }, | |
| 1170 | - isHtml5New: function(s) { | |
| 1171 | - if (s.indexOf('html5') == -1) { | |
| 1172 | - return false; | |
| 1173 | - } | |
| 1174 | - var a = s.replace(/{/g, ''); | |
| 1175 | - var b = a.split('}'); | |
| 1176 | - var c = ''; | |
| 1177 | - for (var i = 0; i < b.length; i++) { | |
| 1178 | - if (b[i].indexOf('html5') > -1) { | |
| 1179 | - c = b[i].replace('html5->', '').split(','); | |
| 1180 | - break; | |
| 1181 | - } | |
| 1182 | - } | |
| 1183 | - return c; | |
| 1184 | - }, | |
| 1185 | - changeParams: function(f) { | |
| 1186 | - if (f) { | |
| 1187 | - var a = f.replace(/{/g, ''); | |
| 1188 | - var b = a.split('}'); | |
| 1189 | - var c = ''; | |
| 1190 | - for (var i = 0; i < b.length; i++) { | |
| 1191 | - var d = b[i].split('->'); | |
| 1192 | - if(d.length == 2){ | |
| 1193 | - switch(d[0]){ | |
| 1194 | - case 'p': | |
| 1195 | - if(parseInt(d[1]) == 1){ | |
| 1196 | - this._V_.autoplay = true; | |
| 1197 | - } | |
| 1198 | - else if(parseInt(d[1]) == 2){ | |
| 1199 | - this._V_.preload = 'metadata'; | |
| 1200 | - } | |
| 1201 | - else{ | |
| 1202 | - this._V_.autoplay = false; | |
| 1203 | - if(this._I_!=null){ | |
| 1204 | - clearInterval(this._I_); | |
| 1205 | - this._I_=null; | |
| 1206 | - } | |
| 1207 | - } | |
| 1208 | - break; | |
| 1209 | - case 'e': | |
| 1210 | - if(parseInt(d[1]) == 1){ | |
| 1211 | - this._V_.loop = true; | |
| 1212 | - } | |
| 1213 | - else{ | |
| 1214 | - this._V_.loop = false; | |
| 1215 | - } | |
| 1216 | - break; | |
| 1217 | - case 'i': | |
| 1218 | - this._V_.poster = d[1]; | |
| 1219 | - break; | |
| 1220 | - default: | |
| 1221 | - break; | |
| 1222 | - } | |
| 1223 | - } | |
| 1224 | - } | |
| 1225 | - } | |
| 1226 | - }, | |
| 1227 | - frontAdPause: function(s) { | |
| 1228 | - this.getNot(); | |
| 1229 | - }, | |
| 1230 | - frontAdUnload: function() { | |
| 1231 | - this.getNot(); | |
| 1232 | - }, | |
| 1233 | - changeFace: function(s) { | |
| 1234 | - this.getNot(); | |
| 1235 | - }, | |
| 1236 | - plugin: function(a, b, c, d, e, f, g) { | |
| 1237 | - this.getNot(); | |
| 1238 | - }, | |
| 1239 | - videoClear: function() { | |
| 1240 | - this.getNot(); | |
| 1241 | - }, | |
| 1242 | - videoBrightness: function(s) { | |
| 1243 | - this.getNot(); | |
| 1244 | - }, | |
| 1245 | - videoContrast: function(s) { | |
| 1246 | - this.getNot(); | |
| 1247 | - }, | |
| 1248 | - videoSaturation: function(s) { | |
| 1249 | - this.getNot(); | |
| 1250 | - }, | |
| 1251 | - videoSetHue: function(s) { | |
| 1252 | - this.getNot(); | |
| 1253 | - }, | |
| 1254 | - videoWAndH: function(a, b) { | |
| 1255 | - this.getNot(); | |
| 1256 | - }, | |
| 1257 | - videoWHXY: function(a, b, c, d) { | |
| 1258 | - this.getNot(); | |
| 1259 | - }, | |
| 1260 | - changeFlashvars: function(a) { | |
| 1261 | - this.getNot(); | |
| 1262 | - }, | |
| 1263 | - changeMyObject: function(a, b) { | |
| 1264 | - this.getNot(); | |
| 1265 | - }, | |
| 1266 | - getMyObject: function(a, b) { | |
| 1267 | - this.getNot(); | |
| 1268 | - }, | |
| 1269 | - changeeFace: function() { | |
| 1270 | - this.getNot(); | |
| 1271 | - }, | |
| 1272 | - changeStyle: function(a, b) { | |
| 1273 | - this.getNot(); | |
| 1274 | - }, | |
| 1275 | - promptLoad: function() { | |
| 1276 | - this.getNot(); | |
| 1277 | - }, | |
| 1278 | - promptUnload: function() { | |
| 1279 | - this.getNot(); | |
| 1280 | - }, | |
| 1281 | - marqueeLoad: function(a,b) { | |
| 1282 | - this.getNot(); | |
| 1283 | - }, | |
| 1284 | - marqueeClose: function(s) { | |
| 1285 | - this.getNot(); | |
| 1286 | - }, | |
| 1287 | - videoError: function(s) { | |
| 1288 | - this.getNot(); | |
| 1289 | - }, | |
| 1290 | - formatUrl: function(s) { | |
| 1291 | - this.getNot(); | |
| 1292 | - }, | |
| 1293 | - sendJS: function(s) { | |
| 1294 | - this.getNot(); | |
| 1295 | - }, | |
| 1296 | - plugAttribute: function(s) { | |
| 1297 | - this.getNot(); | |
| 1298 | - }, | |
| 1299 | - errorTextShow: function(s) { | |
| 1300 | - this.getNot(); | |
| 1301 | - }, | |
| 1302 | - openUrl: function(s) { | |
| 1303 | - window.open(s); | |
| 1304 | - }, | |
| 1305 | - jsonParse: function(s) { | |
| 1306 | - this.getNot(); | |
| 1307 | - }, | |
| 1308 | - promptShow: function(s,x,y) { | |
| 1309 | - this.getNot(); | |
| 1310 | - }, | |
| 1311 | - screenShot: function(s,x,y,x2,y2) { | |
| 1312 | - this.getNot(); | |
| 1313 | - }, | |
| 1314 | - fullScreen: function() { | |
| 1315 | - this.getNot(); | |
| 1316 | - }, | |
| 1317 | - allowFull: function() { | |
| 1318 | - this.getNot(); | |
| 1319 | - }, | |
| 1320 | - loadButton: function() { | |
| 1321 | - this.getNot(); | |
| 1322 | - }, | |
| 1323 | - getFile: function() { | |
| 1324 | - this.getNot(); | |
| 1325 | - }, | |
| 1326 | - textBoxShow:function() { | |
| 1327 | - this.getNot(); | |
| 1328 | - }, | |
| 1329 | - loadElement: function() { | |
| 1330 | - this.getNot(); | |
| 1331 | - }, | |
| 1332 | - textBoxClose: function() { | |
| 1333 | - this.getNot(); | |
| 1334 | - }, | |
| 1335 | - textBoxTween: function() { | |
| 1336 | - this.getNot(); | |
| 1337 | - }, | |
| 1338 | - getNot: function() { | |
| 1339 | - var s='The ckplayer\'s API for HTML5 does not exist'; | |
| 1340 | - return s; | |
| 1341 | - }, | |
| 1342 | - volumeChangeHandler: function() { | |
| 1343 | - var C = CKobject; | |
| 1344 | - if (C._V_.muted) { | |
| 1345 | - C.returnStatus('volumechange:0', 1); | |
| 1346 | - C._O_['volume'] = 0; | |
| 1347 | - C._O_['mute'] = true; | |
| 1348 | - } else { | |
| 1349 | - C._O_['mute'] = false; | |
| 1350 | - C._O_['volume'] = C._V_['volume'] * 100; | |
| 1351 | - C.returnStatus('volumechange:'+C._V_['volume'] * 100, 1); | |
| 1352 | - } | |
| 1353 | - }, | |
| 1354 | - endedHandler: function() { | |
| 1355 | - var C = CKobject; | |
| 1356 | - var e=parseInt(C.getVars('e')); | |
| 1357 | - C.returnStatus('ended', 1); | |
| 1358 | - if(C._I_){ | |
| 1359 | - clearInterval(C._I_); | |
| 1360 | - C._I_=null; | |
| 1361 | - } | |
| 1362 | - if ( e!= 0 && e !=4 && e !=6) { | |
| 1363 | - return; | |
| 1364 | - } | |
| 1365 | - if(e==6){ | |
| 1366 | - this.quitFullScreen(); | |
| 1367 | - } | |
| 1368 | - var f='playerstop()'; | |
| 1369 | - if (C.getSn('calljs', 2)!='') { | |
| 1370 | - f=C.getSn('calljs', 2)+'()'; | |
| 1371 | - } | |
| 1372 | - try { | |
| 1373 | - if (typeof(eval(f)) == 'function') { | |
| 1374 | - eval(f); | |
| 1375 | - return; | |
| 1376 | - } | |
| 1377 | - } catch(e) { | |
| 1378 | - try { | |
| 1379 | - if (typeof(eval(playerstop)) == 'function') { | |
| 1380 | - playerstop(); | |
| 1381 | - return; | |
| 1382 | - } | |
| 1383 | - } catch(e) { | |
| 1384 | - return; | |
| 1385 | - } | |
| 1386 | - } | |
| 1387 | - }, | |
| 1388 | - loadedMetadataHandler: function() { | |
| 1389 | - var C = CKobject; | |
| 1390 | - C.returnStatus('loadedmetadata', 1); | |
| 1391 | - C._O_['totalTime'] = C._V_['duration']; | |
| 1392 | - C._O_['width'] = C._V_['width']; | |
| 1393 | - C._O_['height'] = C._V_['height']; | |
| 1394 | - C._O_['awidth'] = C._V_['videoWidth']; | |
| 1395 | - C._O_['aheight'] = C._V_['videoHeight']; | |
| 1396 | - if (C._V_.defaultMuted) { | |
| 1397 | - C.returnStatus('volumechange:0', 1); | |
| 1398 | - C._O_['mute'] = true; | |
| 1399 | - C._O_['volume'] = 0; | |
| 1400 | - } else { | |
| 1401 | - C._O_['mute'] = false; | |
| 1402 | - C._O_['volume'] = C._V_['volume'] * 100; | |
| 1403 | - C.returnStatus('volumechange:'+C._V_['volume'] * 100, 1); | |
| 1404 | - } | |
| 1405 | - if (parseInt(C.getVars('p')) == 1) { | |
| 1406 | - C.playHandler(); | |
| 1407 | - } | |
| 1408 | - if(C.ATAll){ | |
| 1409 | - C.ATAll(C._V_['duration']); | |
| 1410 | - } | |
| 1411 | - }, | |
| 1412 | - errorHandler: function() { | |
| 1413 | - CKobject.returnStatus('error', 1); | |
| 1414 | - }, | |
| 1415 | - playHandler: function() { | |
| 1416 | - var C = CKobject; | |
| 1417 | - if (C._V_.paused) { | |
| 1418 | - C.returnStatus('pause', 1); | |
| 1419 | - C.addO('play', false); | |
| 1420 | - if(C._I_!=null){ | |
| 1421 | - clearInterval(C._I_); | |
| 1422 | - C._I_=null; | |
| 1423 | - } | |
| 1424 | - } else { | |
| 1425 | - C.returnStatus('play', 1); | |
| 1426 | - C.addO('play', true); | |
| 1427 | - if (!C._P_) { | |
| 1428 | - C.returnStatus('play', 1); | |
| 1429 | - C._P_ = true; | |
| 1430 | - } | |
| 1431 | - C._I_ = setInterval(C.playTime, parseInt( C.getSn('setup', 37))); | |
| 1432 | - if(!C._G_){ | |
| 1433 | - C._G_=true; | |
| 1434 | - for(var k in C._A_){ | |
| 1435 | - if(k=='g' && C._A_[k]){ | |
| 1436 | - var g=parseInt(C._A_[k]); | |
| 1437 | - C.videoSeek(g); | |
| 1438 | - } | |
| 1439 | - } | |
| 1440 | - } | |
| 1441 | - if(!C._Y_){ | |
| 1442 | - C._Y_=true; | |
| 1443 | - for(var k in C._A_){ | |
| 1444 | - if(k=='j' && C._A_[k]){ | |
| 1445 | - var j=parseInt(C._A_[k]); | |
| 1446 | - if(j>0){ | |
| 1447 | - C._J_=j; | |
| 1448 | - } | |
| 1449 | - else{ | |
| 1450 | - C._J_=parseInt(C._O_['totalTime'])+j; | |
| 1451 | - } | |
| 1452 | - } | |
| 1453 | - } | |
| 1454 | - } | |
| 1455 | - } | |
| 1456 | - }, | |
| 1457 | - html5Click: function(){ | |
| 1458 | - //console.log(this); | |
| 1459 | - var C = CKobject; | |
| 1460 | - if(C.getVars('m')!='' && C.getVars('m')!=null){ | |
| 1461 | - window.open(C.getVars('m')); | |
| 1462 | - } | |
| 1463 | - }, | |
| 1464 | - returnStatus: function(s, j) { | |
| 1465 | - var h = s; | |
| 1466 | - if (this._H_ == 3) { | |
| 1467 | - h = this._E_['p'] +'->'+ h; | |
| 1468 | - } | |
| 1469 | - if (this._M_ && j <= this._H_ ) { | |
| 1470 | - this._L_(h); | |
| 1471 | - } | |
| 1472 | - }, | |
| 1473 | - addO: function(s, z) { | |
| 1474 | - this._O_[s] = z; | |
| 1475 | - }, | |
| 1476 | - getStatus: function() { | |
| 1477 | - return this._O_; | |
| 1478 | - }, | |
| 1479 | - playTime: function() { | |
| 1480 | - var C = CKobject; | |
| 1481 | - var t = C._V_['currentTime']; | |
| 1482 | - C._O_['time'] = t; | |
| 1483 | - if(C._J_>0 && t>C._J_){ | |
| 1484 | - C._J_=0; | |
| 1485 | - C.videoSeek(C._O_['totaltime']); | |
| 1486 | - } | |
| 1487 | - C.returnStatus('time:' + t, 1); | |
| 1488 | - } | |
| 1489 | - } | |
| 1490 | - window.CKobject = CKobject; | |
| 1 | +/* | |
| 2 | +------------------------------------------------------------------------- | |
| 3 | + 说明: | |
| 4 | + 正式使用时可以把该文件的注释全部去掉,节省加载时间 | |
| 5 | + ckplayer6.8,有问题请访问http://www.ckplayer.com | |
| 6 | + 请注意,该文件为UTF-8编码,不需要改变编码即可使用于各种编码形式的网站内 | |
| 7 | +------------------------------------------------------------------------- | |
| 8 | +第一部分,加载插件 | |
| 9 | +以下为加载的插件部份 | |
| 10 | +插件的设置参数说明: | |
| 11 | + 1、插件名称 | |
| 12 | + 2、水平对齐方式(0左,1中,2右) | |
| 13 | + 3、垂直对齐方式(0上,1中,2下) | |
| 14 | + 4、水平方向位置偏移量 | |
| 15 | + 5、垂直方向位置偏移量 | |
| 16 | + 6、插件的等级,0=普通图片插件且跟随控制栏隐藏而隐藏,显示而显示,1=普通图片插件且永久显示,2=swf插件,默认显示,3=swf插件,默认隐藏,swf插件都可以交互 | |
| 17 | + 7、插件是否绑定在控制栏上,0不绑定,1绑定,当值是1的时候该插件将会随着控制栏一起隐藏或缓动 | |
| 18 | + 8、插件为swf并且可交互时,默认调用的类所在的包名称,详细说明可以到帮助手册里查看,默认无 | |
| 19 | + 插件名称不能相同,对此的详细说明请到网站查看 | |
| 20 | +*/ | |
| 21 | +function ckcpt() { | |
| 22 | + var cpt = ''; | |
| 23 | + return cpt; | |
| 24 | +} | |
| 25 | +/* | |
| 26 | +插件的定义结束 | |
| 27 | +以下是对播放器功能进行配置 | |
| 28 | +*/ | |
| 29 | +function ckstyle() { //定义总的风格 | |
| 30 | + var ck = { | |
| 31 | + cpath: '', | |
| 32 | + /* | |
| 33 | + 播放器风格压缩包文件的路径,默认的是style.swf | |
| 34 | + 如果调用不出来可以试着设置成绝对路径试试 | |
| 35 | + 如果不知道路径并且使用的是默认配置,可以直接留空,播放器会 | |
| 36 | + */ | |
| 37 | + language: '', | |
| 38 | + /*播放器所使用的语言配置文件,需要和播放器在同目录下,默认是language.xml*/ | |
| 39 | + flashvars: '', | |
| 40 | + /* | |
| 41 | + 这里是用来做为对flashvars值的补充,除了c和x二个参数以外的设置都可以在这里进行配置 | |
| 42 | + 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 | |
| 43 | + 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3*/ | |
| 44 | + setup: '1,1,1,1,1,2,0,1,2,0,0,1,200,0,2,1,0,1,1,1,1,10,3,0,1,2,3000,0,0,0,0,1,1,1,1,1,1,250,0,90,0,0,0', | |
| 45 | + /* | |
| 46 | + 这是配置文件里比较重要的一个参数,共有N个功能控制参数,并且以后会继续的增加,各控制参数以英文逗号(,)隔开。下面列出各参数的说明: | |
| 47 | + 1、鼠标经过按钮是否使用手型,0普通鼠标,1手型鼠标,2是只有按钮手型,3是控制栏手型 | |
| 48 | + 2、是否支持单击暂停,0不支持,1是支持 | |
| 49 | + 3、是否支持双击全屏,0不支持,1是支持 | |
| 50 | + 4、在播放前置广告时是否同时加载视频,0不加载,1加载 | |
| 51 | + 5、广告显示的参考对象,0是参考视频区域,1是参考播放器区域 | |
| 52 | + 6、广告大小的调整方式,只针对swf和图片有效,视频是自动缩放的 | |
| 53 | + 0=自动调整大小,意思是说大的话就变小,小的话就变大 | |
| 54 | + 1=是大的化变小,小的话不变 | |
| 55 | + 2=是什么也不变,就这么大 | |
| 56 | + 3=是跟参考对像(第5个控制)参数设置的一样宽高 | |
| 57 | + 7、前置广告播放顺序,0是顺序播放,1是随机播放,>1则随机取所有广告中的(N-1)个进行播放 | |
| 58 | + 8、对于视频广告是否采用修正,0是不使用,1是使用,如果是1,则用户在网速慢的情况下会按设定的倒计时进行播放广告,计时结束则放正片(比较人性化),设置成0的话,则强制播放完广告才能播放正片 | |
| 59 | + 9、是否开启滚动文字广告,0是不开启,1是开启且不使用关闭按钮,2是开启并且使用关闭按钮,开启后将在加载视频的时候加载滚动文字广告 | |
| 60 | + 10、视频的调整方式 | |
| 61 | + 0=是自动调整大小,意思是说大的话就变小,小的话就变大,同时保持长宽比例不变 | |
| 62 | + 1=是大的化变小,小的话不变 | |
| 63 | + 2=是什么也不变,就这么大 | |
| 64 | + 3=是跟参考对像(pm_video的设置)参数设置的一样宽高 | |
| 65 | + 11、是否在多视频时分段加载,0不是,1是 | |
| 66 | + 12、缩放视频时是否进行平滑处理,0不是,1是 | |
| 67 | + 13、视频缓冲时间,单位:毫秒,建议不超过300 | |
| 68 | + 14、初始图片调整方式( | |
| 69 | + 0=是自动调整大小,意思是说大的话就变小,小的话就变大,同时保持长宽比例不变 | |
| 70 | + 1=是大的化变小,小的话不变 | |
| 71 | + 2=是什么也不变,就这么大 | |
| 72 | + 3=是跟pm_video参数设置的一样宽高 | |
| 73 | + 15、暂停广告调整方式( | |
| 74 | + 0=是自动调整大小,意思是说大的话就变小,小的话就变大,同时保持长宽比例不变 | |
| 75 | + 1=是大的化变小,小的话不变 | |
| 76 | + 2=是什么也不变,就这么大 | |
| 77 | + 3=是跟pm_video参数设置的一样宽 | |
| 78 | + 16、暂停广告是否使用关闭广告设置,0不使用,1使用 | |
| 79 | + 17、缓冲时是否播放广告,0是不显示,1是显示并同时隐藏掉缓冲图标和进度,2是显示并不隐藏缓冲图标 | |
| 80 | + 18、是否支持键盘空格键控制播放和暂停0不支持,1支持 | |
| 81 | + 19、是否支持键盘左右方向键控制快进快退0不支持,1支持 | |
| 82 | + 20、是否支持键盘上下方向键控制音量0不支持,1支持 | |
| 83 | + 21、播放器返回js全部监听函数的等级,0-2,等级越高,返回的参数越多 | |
| 84 | + 0=不返回全部监听事件 | |
| 85 | + 1=返回监听,但不在控制台输出 | |
| 86 | + 2=返回监听,并且在控制台同步输出 | |
| 87 | + 3=返回全部监听事件,并且在参数前加上"播放器ID->",用于多播放器的监听 | |
| 88 | + 22、快进和快退的秒数 | |
| 89 | + 23、界面上图片元素加载失败重新加载次数 | |
| 90 | + 24、开启加载皮肤压缩文件包的加载进度提示 | |
| 91 | + 25、使用隐藏控制栏时显示简单进度条的功能,0是不使用,1是使用,2是只在普通状态下使用 | |
| 92 | + 26、控制栏隐藏设置(0不隐藏,1全屏时隐藏,2都隐藏 | |
| 93 | + 27、控制栏隐藏延时时间,即在鼠标离开控制栏后多少毫秒后隐藏控制栏 | |
| 94 | + 28、滚动文字广告左右滚动时是否采用无缝,默认0采用,1是不采用 | |
| 95 | + 29、0是正常状态,1是控制栏默认隐藏,播放状态下鼠标经过播放器显示控制栏,2是一直隐藏控制栏 | |
| 96 | + 30、在播放rtmp视频时暂停后点击播放是否采用重新链接的方式,这里一共分0-2三个等级 | |
| 97 | + 31、当采用网址形式(flashvars里s=1/2时)读取视频地址时是采用默认0=get方法,1=post方式 | |
| 98 | + 32、是否启用播放按钮和暂停按钮 | |
| 99 | + 33、是否启用中间暂停按钮 | |
| 100 | + 34、是否启用静音按钮 | |
| 101 | + 35、是否启用全屏按钮 | |
| 102 | + 36、是否启用进度调节栏,0不启用,1是启用,2是只能前进(向右拖动),3是只能后退,4是只能前进但能回到第一次拖动时的位置,5是看过的地方可以随意拖动, | |
| 103 | + 37、是否启用调节音量 | |
| 104 | + 38、计算时间的间隔,毫秒 | |
| 105 | + 39、前置logo至少显示的时间,单位:毫秒 | |
| 106 | + 40、前置视频广告的默认音量 | |
| 107 | + 41、当s=3/4时加载插件是否从压缩包里加载,0不是,1是 | |
| 108 | + 42、加载风格是否采用加密方式传送,该功能普通用户不能使用 | |
| 109 | + 43、在s=1/2时,调用地址里的地址是否是相对地址(相对于调用文件),0不是,1是 | |
| 110 | + */ | |
| 111 | + pm_bg: '0x000000,100,230,180', | |
| 112 | + /*播放器整体的背景配置,请注意,这里只是一个初始化的设置,如果需要真正的改动播放器的背景和最小宽高,需要在风格文件里找到相同的参数进行更改。 | |
| 113 | + 1、整体背景颜色 | |
| 114 | + 2、背景透明度 | |
| 115 | + 3、播放器最小宽度 | |
| 116 | + 4、播放器最小高度 | |
| 117 | + 这里只是初始化时的设置,最终加载完播放器后显示的效果需要在style.swf/style.xml里设置该参数 | |
| 118 | + */ | |
| 119 | + mylogo: 'logo.swf', | |
| 120 | + /* | |
| 121 | + 视频加载前显示的logo文件,不使用设置成null,即mylogo='null'; | |
| 122 | + */ | |
| 123 | + pm_mylogo: '1,1,-100,-55', | |
| 124 | + /* | |
| 125 | + 视频加载前显示的logo文件(mylogo参数的)的位置 | |
| 126 | + 本软件所有的四个参数控制位置的方式全部都是统一的意思,如下 | |
| 127 | + 1、水平对齐方式,0是左,1是中,2是右 | |
| 128 | + 2、垂直对齐方式,0是上,1是中,2是下 | |
| 129 | + 3、水平偏移量,举例说明,如果第1个参数设置成0左对齐,第3个偏移量设置成10,就是离左边10个像素,第一个参数设置成2,偏移量如果设置的是正值就会移到播放器外面,只有设置成负值才行,设置成-1,按钮就会跑到播放器外面 | |
| 130 | + 4、垂直偏移量 | |
| 131 | + */ | |
| 132 | + /* logo: 'cklogo.png',*/ | |
| 133 | + logo='null', | |
| 134 | + /* | |
| 135 | + 默认右上角一直显示的logo,不使用设置成null,即logo='null'; | |
| 136 | + */ | |
| 137 | + pm_logo: '2,0,-100,20', | |
| 138 | + /* | |
| 139 | + 播放器右上角的logo的位置 | |
| 140 | + 1、水平对齐方式,0是左,1是中,2是右 | |
| 141 | + 2、垂直对齐方式,0是上,1是中,2是下 | |
| 142 | + 3、水平偏移量 | |
| 143 | + 4、垂直偏移量 | |
| 144 | + 以下是播放器自带的二个插件 | |
| 145 | + */ | |
| 146 | + control_rel: 'related.swf,ckplayer/related.xml,0', | |
| 147 | + /* | |
| 148 | + 视频结束显示精彩视频的插件 | |
| 149 | + 1、视频播放结束后显示相关精彩视频的插件文件(注意,视频结束动作设置成3时(即var flashvars={e:3})有效), | |
| 150 | + 2、xml文件是调用精彩视频的示例文件,可以自定义文件类型(比如asp,php,jsp,.net只要输出的是xml格式就行),实际使用中一定要注意第二个参数的路径要正确 | |
| 151 | + 3、第三个参数是设置配置文件的编码,0是默认的utf-8,1是gbk2312 | |
| 152 | + */ | |
| 153 | + control_pv: 'Preview.swf,105,2000', | |
| 154 | + /* | |
| 155 | + 视频预览插件 | |
| 156 | + 1、插件文件名称(该插件和上面的精彩视频的插件都是放在风格压缩包里的) | |
| 157 | + 2、离进度栏的高(指的是插件的顶部离进度栏的位置) | |
| 158 | + 3、延迟时间(该处设置鼠标经过进度栏停顿多少毫秒后才显示插件) | |
| 159 | + 建议一定要设置延时时间,不然当鼠标在进度栏上划过的时候就会读取视频地址进行预览,很占资源 | |
| 160 | + */ | |
| 161 | + pm_repc: '', | |
| 162 | + /* | |
| 163 | + 视频地址替换符,该功能主要是用来做简单加密的功能,使用方法很简单,请注意,只针对f值是视频地址的时候有效,其它地方不能使用。具体的请查看http://www.ckplayer.com/manual.php?id=4#title_25 | |
| 164 | + */ | |
| 165 | + pm_spac: '|', | |
| 166 | + /* | |
| 167 | + 视频地址间隔符,这里主要是播放多段视频时使用普通调用方式或网址调用方式时使用的。默认使用|,如果视频地址里本身存在|的话需要另外设置一个间隔符,注意,即使只有一个视频也需要设置。另外在使用rtmp协议播放视频的时候,如果视频存在多级目录的话,这里要改成其它的符号,因为rtmp协议的视频地址多级的话也需要用到|隔开流地址和实例地址 | |
| 168 | + */ | |
| 169 | + pm_fpac: 'file->f', | |
| 170 | + /* | |
| 171 | + 该参数的功能是把自定义的flashvars里的变量替换成ckplayer里对应的变量,默认的参数的意思是把flashvars里的file值替换成f值,因为ckplayer里只认f值,多个替换之间用竖线隔开 | |
| 172 | + */ | |
| 173 | + pm_advtime: '2,0,-110,10,0,300,0', | |
| 174 | + /* | |
| 175 | + 前置广告倒计时文本位置,播放前置 广告时有个倒计时的显示文本框,这里是设置该文本框的位置和宽高,对齐方式的。一共7个参数,分别表示: | |
| 176 | + 1、水平对齐方式,0是左对齐,1是中间对齐,2是右对齐 | |
| 177 | + 2、垂直对齐方式,0是上对齐,1是中间对齐,2是低部对齐 | |
| 178 | + 3、水平位置偏移量 | |
| 179 | + 4、垂直位置偏移量 | |
| 180 | + 5、文字对齐方式,0是左对齐,1是中间对齐,2是右对齐,3是默认对齐 | |
| 181 | + 6、文本框宽席 | |
| 182 | + 7、文本框高度 | |
| 183 | + */ | |
| 184 | + pm_advstatus: '1,2,2,-200,-40', | |
| 185 | + /* | |
| 186 | + 前置广告静音按钮,静音按钮只在是视频广告时显示,当然也可以控制不显示 | |
| 187 | + 1、是否显示0不显示,1显示 | |
| 188 | + 2、水平对齐方式 | |
| 189 | + 3、垂直对齐方式 | |
| 190 | + 4、水平偏移量 | |
| 191 | + 5、垂直偏移量 | |
| 192 | + */ | |
| 193 | + pm_advjp: '1,1,2,2,-100,-40', | |
| 194 | + /* | |
| 195 | + 前置广告跳过广告按钮的位置 | |
| 196 | + 1、是否显示0不显示,1是显示 | |
| 197 | + 2、跳过按钮触发对象(值0/1,0是直接跳转,1是触发js:function ckadjump(){}) | |
| 198 | + 3、水平对齐方式 | |
| 199 | + 4、垂直对齐方式 | |
| 200 | + 5、水平偏移量 | |
| 201 | + 6、垂直偏移量 | |
| 202 | + */ | |
| 203 | + pm_padvc: '2,0,-13,-13', | |
| 204 | + /* | |
| 205 | + 暂停广告的关闭按钮的位置 | |
| 206 | + 1、水平对齐方式 | |
| 207 | + 2、垂直对齐方式 | |
| 208 | + 3、水平偏移量 | |
| 209 | + 4、垂直偏移量 | |
| 210 | + */ | |
| 211 | + pm_advms: '2,2,-46,-67', | |
| 212 | + /* | |
| 213 | + 滚动广告关闭按钮位置 | |
| 214 | + 1、水平对齐方式 | |
| 215 | + 2、垂直对齐方式 | |
| 216 | + 3、水平偏移量 | |
| 217 | + 4、垂直偏移量 | |
| 218 | + */ | |
| 219 | + pm_zip: '1,1,-20,-8,1,0,0', | |
| 220 | + /* | |
| 221 | + 加载皮肤压缩包时提示文字的位置 | |
| 222 | + 1、水平对齐方式,0是左对齐,1是中间对齐,2是右对齐 | |
| 223 | + 2、垂直对齐方式,0是上对齐,1是中间对齐,2是低部对齐 | |
| 224 | + 3、水平位置偏移量 | |
| 225 | + 4、垂直位置偏移量 | |
| 226 | + 5、文字对齐方式,0是左对齐,1是中间对齐,2是右对齐,3是默认对齐 | |
| 227 | + 6、文本框宽席 | |
| 228 | + 7、文本框高度 | |
| 229 | + */ | |
| 230 | + //pm_advmarquee: '1,2,50,-60,50,18,0,0x000000,50,0,20,1,15,2000', | |
| 231 | + pm_advmarquee: '1,2,50,-70,50,20,0,0x000000,50,0,20,1,30,2000', | |
| 232 | + /* | |
| 233 | + 滚动广告的控制,要使用的话需要在setup里的第9个参数设置成1 | |
| 234 | + 这里分二种情况,前六个参数是定位控制,第7个参数是设置定位方式(0:相对定位,1:绝对定位) | |
| 235 | + 第一种情况:第7个参数是0的时候,相对定位,就是播放器长宽变化的时候,控制栏也跟着变 | |
| 236 | + 1、默认1:中间对齐 | |
| 237 | + 2、上中下对齐(0是上,1是中,2是下) | |
| 238 | + 3、离左边的距离 | |
| 239 | + 4、Y轴偏移量 | |
| 240 | + 5、离右边的距离 | |
| 241 | + 6、高度 | |
| 242 | + 7、定位方式 | |
| 243 | + 第二种情况:第7个参数是1的时候,绝对定位,就是播放器长宽变化的时候,控制栏不跟着变,这种方式一般使用在控制栏大小不变的时候 | |
| 244 | + 1、左中右对齐方式(0是左,1是中间,2是右) | |
| 245 | + 2、上中下对齐(0是上,1是中,2是下) | |
| 246 | + 3、x偏移量 | |
| 247 | + 4、y偏移量 | |
| 248 | + 5、宽度 | |
| 249 | + 6、高度 | |
| 250 | + 7、定位方式 | |
| 251 | + 以上是前7个参数的作用 | |
| 252 | + 8、是文字广告的背景色 | |
| 253 | + 9、置背景色的透明度 | |
| 254 | + 10、控制滚动方向,0是水平滚动(包括左右),1是上下滚动(包括向上和向下) | |
| 255 | + 11、移动的单位时长,即移动单位像素所需要的时长,毫秒 | |
| 256 | + 12、移动的单位像素,正数同左/上,负数向右/下 | |
| 257 | + 13、是行高,这个在设置向上或向下滚动的时候有用处 | |
| 258 | + 14、控制向上或向下滚动时每次停止的时间 | |
| 259 | + */ | |
| 260 | + pm_glowfilter:'1,0x01485d, 100, 6, 3, 10, 1, 0, 0', | |
| 261 | + /* | |
| 262 | + 滚动文字广告是否采用发光滤镜 | |
| 263 | + 1、是否使用发光滤镜,0是不采用,1是使用 | |
| 264 | + 2、(default = 0xFF0000) — 光晕颜色,采用十六进制格式 0xRRGGBB。 默认值为 0xFF0000 | |
| 265 | + 3、(default = 100) — 颜色的 Alpha 透明度值。 有效值为 0 到 100。 例如,25 设置透明度为 25% | |
| 266 | + 4、(default = 6.0) — 水平模糊量。 有效值为 0 到 255(浮点)。 2 的乘方值(如 2、4、8、16 和 32)经过优化,呈现速度比其它值更快 | |
| 267 | + 5、(default = 6.0) — 垂直模糊量。 有效值为 0 到 255(浮点)。 2 的乘方值(如 2、4、8、16 和 32)经过优化,呈现速度比其它值更快 | |
| 268 | + 6、(default = 2) —光晕的强度。 该值越高,光晕的颜色越深,而且发光与背景之间的对比度也越强。 有效值为 0 到 255 | |
| 269 | + 7、(default = 1) — 应用滤镜的次数 | |
| 270 | + 8、(default = 0) — 指定发光是否为内侧发光。 值 1 指定发光是内侧发光。 值 0 指定发光是外侧发光(对象外缘周围的发光) | |
| 271 | + 9、(default = 0) — 指定对象是否具有挖空效果。 值为 1 将使对象的填充变为透明,并显示文档的背景颜色 | |
| 272 | + */ | |
| 273 | + advmarquee: escape('{a href="http://www.ckplayer.com"}{font color="#FFFFFF" size="12" face="Microsoft YaHei"}这里可以放文字广告,播放器默认使用这里设置的广告内容,如果不想在这里使用可以清空这里的内容,如果想在页面中实时定义滚动文字广告内容,可以清空这里的内容,然后在页面中设置广告函数。{/font}{/a}'), | |
| 274 | + /* | |
| 275 | + 该处是滚动文字广告的内容,如果不想在这里设置,就把这里清空并且在页面中使用js的函数定义function ckmarqueeadv(){return '广告内容'} | |
| 276 | + */ | |
| 277 | + mainfuntion:'', | |
| 278 | + /* | |
| 279 | + 当flashvars里s=3/4时,调用的函数包名称,默认为空,调用时间轴上的函数setAppObj | |
| 280 | + */ | |
| 281 | + flashplayer:'', | |
| 282 | + /* | |
| 283 | + 当flashvars里的s=3/4时,也可以把swf文件放在这里 | |
| 284 | + */ | |
| 285 | + calljs:'ckplayer_status,ckadjump,playerstop,ckmarqueeadv', | |
| 286 | + /* | |
| 287 | + 1、全局监听返回结果的函数 | |
| 288 | + 2、跳过广告的函数 | |
| 289 | + 3、播放结束时调用的js函数 | |
| 290 | + 4、加载滚动文字广告的函 | |
| 291 | + */ | |
| 292 | + myweb: escape(''), | |
| 293 | + /* | |
| 294 | + ------------------------------------------------------------------------------------------------------------------ | |
| 295 | + 以下内容部份是和插件相关的配置,请注意,自定义插件以及其配置的命名方式要注意,不要和系统的相重复,不然就会替换掉系统的相关设置,删除相关插件的话也可以同时删除相关的配置 | |
| 296 | + ------------------------------------------------------------------------------------------------------------------ | |
| 297 | + 以下内容定义自定义插件的相关配置,这里也可以自定义任何自己的插件需要配置的内容,当然,如果你某个插件不使用的话,也可以删除相关的配置 | |
| 298 | + ------------------------------------------------------------------------------------------------------------------ | |
| 299 | + */ | |
| 300 | + cpt_lights: '1', | |
| 301 | + /* | |
| 302 | + 该处定义是否使用开关灯,使用开灯效果时调用页面的js函数function closelights(){},关灯调用 function closelights(){}; | |
| 303 | + */ | |
| 304 | + cpt_share: 'ckplayer/share.xml', | |
| 305 | + /* | |
| 306 | + 分享插件调用的配置文件地址,此设设置成空,则不启用分享按钮 | |
| 307 | + 调用插件开始 | |
| 308 | + */ | |
| 309 | + cpt_list: ckcpt() | |
| 310 | + /* | |
| 311 | + ckcpt()是本文件最上方的定义插件的函数 | |
| 312 | + */ | |
| 313 | + } | |
| 314 | + return ck; | |
| 315 | +} | |
| 316 | +/* | |
| 317 | +html5部分开始 | |
| 318 | +以下代码是支持html5的,如果你不需要,可以删除。 | |
| 319 | +html5代码块的代码可以随意更改以适合你的应用,欢迎到论坛交流更改心得 | |
| 320 | +*/ | |
| 321 | +(function() { | |
| 322 | + var CKobject = { | |
| 323 | + _K_: function(d){return document.getElementById(d);}, | |
| 324 | + _T_: false, | |
| 325 | + _M_: false, | |
| 326 | + _G_: false, | |
| 327 | + _Y_: false, | |
| 328 | + _I_: null, | |
| 329 | + _J_: 0, | |
| 330 | + _O_: {}, | |
| 331 | + uaMatch:function(u,rMsie,rFirefox,rOpera,rChrome,rSafari,rSafari2,mozilla,mobile){ | |
| 332 | + var match = rMsie.exec(u); | |
| 333 | + if (match != null) { | |
| 334 | + return { | |
| 335 | + b: 'IE', | |
| 336 | + v: match[2] || '0' | |
| 337 | + } | |
| 338 | + } | |
| 339 | + match = rFirefox.exec(u); | |
| 340 | + if (match != null) { | |
| 341 | + return { | |
| 342 | + b: match[1] || '', | |
| 343 | + v: match[2] || '0' | |
| 344 | + } | |
| 345 | + } | |
| 346 | + match = rOpera.exec(u); | |
| 347 | + if (match != null) { | |
| 348 | + return { | |
| 349 | + b: match[1] || '', | |
| 350 | + v: match[2] || '0' | |
| 351 | + } | |
| 352 | + } | |
| 353 | + match = rChrome.exec(u); | |
| 354 | + if (match != null) { | |
| 355 | + return { | |
| 356 | + b: match[1] || '', | |
| 357 | + v: match[2] || '0' | |
| 358 | + } | |
| 359 | + } | |
| 360 | + match = rSafari.exec(u); | |
| 361 | + if (match != null) { | |
| 362 | + return { | |
| 363 | + b: match[2] || '', | |
| 364 | + v: match[1] || '0' | |
| 365 | + } | |
| 366 | + } | |
| 367 | + match = rSafari2.exec(u); | |
| 368 | + if (match != null) { | |
| 369 | + return { | |
| 370 | + b: match[1] || '', | |
| 371 | + v: match[2] || '0' | |
| 372 | + } | |
| 373 | + } | |
| 374 | + match = mozilla.exec(u); | |
| 375 | + if (match != null) { | |
| 376 | + return { | |
| 377 | + b: match[1] || '', | |
| 378 | + v: match[2] || '0' | |
| 379 | + } | |
| 380 | + } | |
| 381 | + match = mobile.exec(u); | |
| 382 | + if (match != null) { | |
| 383 | + return { | |
| 384 | + b: match[1] || '', | |
| 385 | + v: match[2] || '0' | |
| 386 | + } | |
| 387 | + } | |
| 388 | + else { | |
| 389 | + return { | |
| 390 | + b: 'unknown', | |
| 391 | + v: '0' | |
| 392 | + } | |
| 393 | + } | |
| 394 | + }, | |
| 395 | + browser: function() { | |
| 396 | + var u = navigator.userAgent, | |
| 397 | + rMsie = /(msie\s|trident.*rv:)([\w.]+)/, | |
| 398 | + rFirefox = /(firefox)\/([\w.]+)/, | |
| 399 | + rOpera = /(opera).+version\/([\w.]+)/, | |
| 400 | + rChrome = /(chrome)\/([\w.]+)/, | |
| 401 | + rSafari = /version\/([\w.]+).*(safari)/, | |
| 402 | + rSafari2 = /(safari)\/([\w.]+)/, | |
| 403 | + mozilla = /(mozilla)\/([\w.]+)/, | |
| 404 | + mobile = /(mobile)\/([\w.]+)/; | |
| 405 | + var c = u.toLowerCase(); | |
| 406 | + var d = this.uaMatch(c,rMsie,rFirefox,rOpera,rChrome,rSafari,rSafari2,mozilla,mobile); | |
| 407 | + if (d.b) { | |
| 408 | + b = d.b; | |
| 409 | + v = d.v; | |
| 410 | + } | |
| 411 | + return {B: b, V: v}; | |
| 412 | + }, | |
| 413 | + Platform: function() { | |
| 414 | + var w = ''; | |
| 415 | + var u = navigator.userAgent, | |
| 416 | + app = navigator.appVersion; | |
| 417 | + var b = { | |
| 418 | + iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, | |
| 419 | + iPad: u.indexOf('iPad') > -1, | |
| 420 | + ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), | |
| 421 | + android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, | |
| 422 | + webKit: u.indexOf('AppleWebKit') > -1, | |
| 423 | + trident: u.indexOf('Trident') > -1, | |
| 424 | + gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, | |
| 425 | + presto: u.indexOf('Presto') > -1, | |
| 426 | + mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/), | |
| 427 | + webApp: u.indexOf('Safari') == -1 | |
| 428 | + }; | |
| 429 | + for (var k in b) { | |
| 430 | + if (b[k]) { | |
| 431 | + w = k; | |
| 432 | + break; | |
| 433 | + } | |
| 434 | + } | |
| 435 | + return w; | |
| 436 | + }, | |
| 437 | + isHTML5:function(){ | |
| 438 | + return !!document.createElement('video').canPlayType; | |
| 439 | + }, | |
| 440 | + getType:function(){ | |
| 441 | + return this._T_; | |
| 442 | + }, | |
| 443 | + getVideo: function() { | |
| 444 | + var v = ''; | |
| 445 | + var s = this._E_['v']; | |
| 446 | + if (s && s.length>1) { | |
| 447 | + for (var i = 0; i < s.length; i++) { | |
| 448 | + var a = s[i].split('->'); | |
| 449 | + if (a.length >= 1 && a[0] != '') { | |
| 450 | + v += '<source src="' + a[0] + '"'; | |
| 451 | + } | |
| 452 | + if (a.length >= 2 && a[1] != '') { | |
| 453 | + v += ' type="' + a[1] + '"'; | |
| 454 | + } | |
| 455 | + v += '>'; | |
| 456 | + } | |
| 457 | + } | |
| 458 | + return v; | |
| 459 | + }, | |
| 460 | + getVars: function(k) { | |
| 461 | + var o=this._A_; | |
| 462 | + if (typeof(o) == 'undefined') { | |
| 463 | + return null; | |
| 464 | + } | |
| 465 | + if (k in o) { | |
| 466 | + return o[k]; | |
| 467 | + } else { | |
| 468 | + return null; | |
| 469 | + } | |
| 470 | + }, | |
| 471 | + getParams: function() { | |
| 472 | + var p = ''; | |
| 473 | + if (this._A_) { | |
| 474 | + if (parseInt(this.getVars('p')) == 1) { | |
| 475 | + p += ' autoplay="autoplay"'; | |
| 476 | + } | |
| 477 | + if (parseInt(this.getVars('e')) == 1) { | |
| 478 | + p += ' loop="loop"'; | |
| 479 | + } | |
| 480 | + if (parseInt(this.getVars('p')) == 2) { | |
| 481 | + p += ' preload="metadata"'; | |
| 482 | + } | |
| 483 | + if (this.getVars('i')) { | |
| 484 | + p += ' poster="' + this.getVars('i') + '"'; | |
| 485 | + } | |
| 486 | + } | |
| 487 | + return p; | |
| 488 | + }, | |
| 489 | + getpath: function(z) { | |
| 490 | + var f='CDEFGHIJKLMNOPQRSTUVWXYZcdefghijklmnopqrstuvwxyz'; | |
| 491 | + var w=z.substr(0,1); | |
| 492 | + if(f.indexOf(w)>-1 && (z.substr(0,4)==w+'://' || z.substr(0,4)==w+':\\')){ | |
| 493 | + return z; | |
| 494 | + } | |
| 495 | + var d = unescape(window.location.href).replace('file:///', ''); | |
| 496 | + var k = parseInt(document.location.port); | |
| 497 | + var u = document.location.protocol + '//' + document.location.hostname; | |
| 498 | + var l = '', | |
| 499 | + e = '', | |
| 500 | + t = ''; | |
| 501 | + var s = 0; | |
| 502 | + var r = unescape(z).split('//'); | |
| 503 | + if (r.length > 0) { | |
| 504 | + l = r[0] + '//' | |
| 505 | + } | |
| 506 | + var h = 'http|https|ftp|rtsp|mms|ftp|rtmp|file'; | |
| 507 | + var a = h.split('|'); | |
| 508 | + if (k != 80 && k) { | |
| 509 | + u += ':' + k; | |
| 510 | + } | |
| 511 | + for (i = 0; i < a.length; i++) { | |
| 512 | + if ((a[i] + '://') == l) { | |
| 513 | + s = 1; | |
| 514 | + break; | |
| 515 | + } | |
| 516 | + } | |
| 517 | + if (s == 0) { | |
| 518 | + if (z.substr(0, 1) == '/') { | |
| 519 | + t = u + z; | |
| 520 | + } else { | |
| 521 | + e = d.substring(0, d.lastIndexOf('/') + 1).replace('\\', '/'); | |
| 522 | + var w = z.replace('../', './'); | |
| 523 | + var u = w.split('./'); | |
| 524 | + var n = u.length; | |
| 525 | + var r = w.replace('./', ''); | |
| 526 | + var q = e.split('/'); | |
| 527 | + var j = q.length - n; | |
| 528 | + for (i = 0; i < j; i++) { | |
| 529 | + t += q[i] + '/'; | |
| 530 | + } | |
| 531 | + t += r; | |
| 532 | + } | |
| 533 | + } else { | |
| 534 | + t = z; | |
| 535 | + } | |
| 536 | + return t; | |
| 537 | + }, | |
| 538 | + getXhr: function() { | |
| 539 | + var x; | |
| 540 | + try { | |
| 541 | + x = new ActiveXObject('Msxml2.XMLHTTP'); | |
| 542 | + } catch(e) { | |
| 543 | + try { | |
| 544 | + x = new ActiveXObject('Microsoft.XMLHTTP'); | |
| 545 | + } catch(e) { | |
| 546 | + x = false; | |
| 547 | + } | |
| 548 | + } | |
| 549 | + if (!x && typeof XMLHttpRequest != 'undefined') { | |
| 550 | + x = new XMLHttpRequest(); | |
| 551 | + } | |
| 552 | + return x; | |
| 553 | + }, | |
| 554 | + getX: function(){ | |
| 555 | + var f='ckstyle()'; | |
| 556 | + if (this.getVars('x') && parseInt(this.getVars('c'))!=1 ) { | |
| 557 | + f=this.getVars('x')+'()'; | |
| 558 | + } | |
| 559 | + try { | |
| 560 | + if (typeof(eval(f)) == 'object') { | |
| 561 | + this._X_ = eval(f); | |
| 562 | + } | |
| 563 | + } catch(e) { | |
| 564 | + try { | |
| 565 | + if (typeof(eval(ckstyle)) == 'object') { | |
| 566 | + this._X_ = ckstyle(); | |
| 567 | + } | |
| 568 | + } catch(e) { | |
| 569 | + this._X_ = ckstyle(); | |
| 570 | + } | |
| 571 | + } | |
| 572 | + }, | |
| 573 | + getSn: function(s, n) { | |
| 574 | + if(n>=0){ | |
| 575 | + return this._X_[s].split(',')[n]; | |
| 576 | + } | |
| 577 | + else{ | |
| 578 | + return this._X_[s]; | |
| 579 | + } | |
| 580 | + }, | |
| 581 | + getUrl: function(L, B) { | |
| 582 | + var C = this; | |
| 583 | + var b = ['get', 'utf-8']; | |
| 584 | + if (L && L.length == 2) { | |
| 585 | + var a = L[0]; | |
| 586 | + var c = L[1].split('/'); | |
| 587 | + if (c.length >= 2) { | |
| 588 | + b[0] = c[1]; | |
| 589 | + } | |
| 590 | + if (c.length >= 3) { | |
| 591 | + b[1] = c[2]; | |
| 592 | + } | |
| 593 | + this.ajax(b[0], b[1], a, | |
| 594 | + function(s) { | |
| 595 | + if (s && s != 'error') { | |
| 596 | + var d = '', | |
| 597 | + e = s; | |
| 598 | + if (s.indexOf('}') > -1) { | |
| 599 | + var f = s.split('}'); | |
| 600 | + for (var i = 0; i < f.length - 1; i++) { | |
| 601 | + d += f[i] + '}'; | |
| 602 | + var h = f[i].replace('{', '').split('->'); | |
| 603 | + if (h.length == 2) { | |
| 604 | + C._A_[h[0]] = h[1]; | |
| 605 | + } | |
| 606 | + } | |
| 607 | + e = f[f.length - 1]; | |
| 608 | + } | |
| 609 | + C._E_['v'] = e.split(','); | |
| 610 | + if (B) { | |
| 611 | + C.showHtml5(); | |
| 612 | + } else { | |
| 613 | + C.changeParams(d); | |
| 614 | + C.newAdr(); | |
| 615 | + } | |
| 616 | + } | |
| 617 | + }); | |
| 618 | + } | |
| 619 | + }, | |
| 620 | + getflashvars: function(s) { | |
| 621 | + var v = '', | |
| 622 | + i = 0; | |
| 623 | + if (s) { | |
| 624 | + for (var k in s) { | |
| 625 | + if (i > 0) { | |
| 626 | + v += '&'; | |
| 627 | + } | |
| 628 | + if (k == 'f' && s[k] && ! this.getSn('pm_repc',-1)) { | |
| 629 | + s[k] = this.getpath(s[k]); | |
| 630 | + if (s[k].indexOf('&') > -1) { | |
| 631 | + s[k] = encodeURIComponent(s[k]); | |
| 632 | + } | |
| 633 | + } | |
| 634 | + if (k == 'y' && s[k]) { | |
| 635 | + s[k] = this.getpath(s[k]); | |
| 636 | + } | |
| 637 | + v += k + '=' + s[k]; | |
| 638 | + i++; | |
| 639 | + } | |
| 640 | + } | |
| 641 | + return v; | |
| 642 | + }, | |
| 643 | + getparam: function(s) { | |
| 644 | + var w = '', | |
| 645 | + v = '', | |
| 646 | + o = { | |
| 647 | + allowScriptAccess: 'always', | |
| 648 | + allowFullScreen: true, | |
| 649 | + quality: 'high', | |
| 650 | + bgcolor: '#000' | |
| 651 | + }; | |
| 652 | + if (s) { | |
| 653 | + for (var k in s) { | |
| 654 | + o[k] = s[k]; | |
| 655 | + } | |
| 656 | + } | |
| 657 | + for (var e in o) { | |
| 658 | + w += e + '="' + o[e] + '" '; | |
| 659 | + v += '<param name="' + e + '" value="' + o[e] + '" />'; | |
| 660 | + } | |
| 661 | + w = w.replace('movie=', 'src='); | |
| 662 | + return { | |
| 663 | + w: w, | |
| 664 | + v: v | |
| 665 | + }; | |
| 666 | + }, | |
| 667 | + getObjectById: function(s) { | |
| 668 | + var C = this; | |
| 669 | + if (C._T_) { | |
| 670 | + C._V_=C._K_(s) | |
| 671 | + return C ; | |
| 672 | + } | |
| 673 | + var x = null, | |
| 674 | + y = C._K_(s), | |
| 675 | + r = 'embed'; | |
| 676 | + if (y && y.nodeName == 'OBJECT') { | |
| 677 | + if (typeof y.SetVariable != 'undefined') { | |
| 678 | + x= y; | |
| 679 | + } else { | |
| 680 | + var z = y.getElementsByTagName(r)[0]; | |
| 681 | + if (z) { | |
| 682 | + x= z; | |
| 683 | + } | |
| 684 | + } | |
| 685 | + } | |
| 686 | + return x; | |
| 687 | + }, | |
| 688 | + ajax: function(b, u, s, f) { | |
| 689 | + var x = this.getXhr(); | |
| 690 | + var a = [], | |
| 691 | + m = ''; | |
| 692 | + if (b == 'get') { | |
| 693 | + if (s.indexOf('?') > -1) { | |
| 694 | + m = s + '&t=' + new Date().getTime(); | |
| 695 | + } else { | |
| 696 | + m = s + '?t=' + new Date().getTime(); | |
| 697 | + } | |
| 698 | + x.open('get', m); | |
| 699 | + } else { | |
| 700 | + a = s.split('?'); | |
| 701 | + s = a[0], | |
| 702 | + m = a[1]; | |
| 703 | + x.open('post', s, true); | |
| 704 | + } | |
| 705 | + x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); | |
| 706 | + x.setRequestHeader('charset', u); | |
| 707 | + if (b == 'post') { | |
| 708 | + x.send(m); | |
| 709 | + } else { | |
| 710 | + x.send(null); | |
| 711 | + } | |
| 712 | + x.onreadystatechange = function() { | |
| 713 | + if (x.readyState == 4) { | |
| 714 | + var g = x.responseText; | |
| 715 | + if (g != '') { | |
| 716 | + f(g); | |
| 717 | + } else { | |
| 718 | + f(null); | |
| 719 | + } | |
| 720 | + } | |
| 721 | + } | |
| 722 | + }, | |
| 723 | + addListener: function(e, f) { | |
| 724 | + var o=this._V_; | |
| 725 | + switch(e){ | |
| 726 | + case 'time': | |
| 727 | + e='timeupdate'; | |
| 728 | + this.AT=f; | |
| 729 | + f=this.addListenerTime; | |
| 730 | + break; | |
| 731 | + case 'totaltime': | |
| 732 | + this.ATAll=f; | |
| 733 | + return; | |
| 734 | + break; | |
| 735 | + default: | |
| 736 | + break; | |
| 737 | + } | |
| 738 | + //console.log(typeof(f)); | |
| 739 | + if(typeof(f)=='string'){ | |
| 740 | + f=eval(f); | |
| 741 | + } | |
| 742 | + if (o.addEventListener) { | |
| 743 | + try{ | |
| 744 | + o.addEventListener(e, f, false); | |
| 745 | + } | |
| 746 | + catch (e) { | |
| 747 | + this.getNot(); | |
| 748 | + } | |
| 749 | + } | |
| 750 | + else if (o.attachEvent) { | |
| 751 | + try{ | |
| 752 | + o.attachEvent('on' + e, f); | |
| 753 | + } | |
| 754 | + catch(e){ | |
| 755 | + this.getNot(); | |
| 756 | + } | |
| 757 | + } | |
| 758 | + else { | |
| 759 | + o['on' + e] = f; | |
| 760 | + } | |
| 761 | + }, | |
| 762 | + removeListener: function( e, f) { | |
| 763 | + var o=this._V_; | |
| 764 | + switch(e){ | |
| 765 | + case 'time': | |
| 766 | + e='timeupdate'; | |
| 767 | + this.AT=null; | |
| 768 | + break; | |
| 769 | + case 'totaltime': | |
| 770 | + this.ATAll=null; | |
| 771 | + return; | |
| 772 | + break; | |
| 773 | + default: | |
| 774 | + break; | |
| 775 | + } | |
| 776 | + if(typeof(f)=='string'){ | |
| 777 | + f=eval(f); | |
| 778 | + } | |
| 779 | + if (o.removeEventListener) { | |
| 780 | + try{ | |
| 781 | + o.removeEventListener(e, f, false); | |
| 782 | + } | |
| 783 | + catch(e){ | |
| 784 | + this.getNot(); | |
| 785 | + } | |
| 786 | + } | |
| 787 | + else if (o.detachEvent) { | |
| 788 | + try{ | |
| 789 | + o.detachEvent('on' + e, f); | |
| 790 | + } | |
| 791 | + catch(e){ | |
| 792 | + this.getNot(); | |
| 793 | + } | |
| 794 | + } | |
| 795 | + else { | |
| 796 | + o['on' + e] = null; | |
| 797 | + } | |
| 798 | + }, | |
| 799 | + Flash: function() { | |
| 800 | + var f = false,v = 0; | |
| 801 | + if (document.all || this.browser()['B'].toLowerCase().indexOf('ie')>-1) { | |
| 802 | + try { | |
| 803 | + var s = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); | |
| 804 | + f = true; | |
| 805 | + var z = s.GetVariable('$version'); | |
| 806 | + v = parseInt(z.split(' ')[1].split(',')[0]); | |
| 807 | + } catch(e) {} | |
| 808 | + } else { | |
| 809 | + if (navigator.plugins && navigator.plugins.length > 0) { | |
| 810 | + var s = navigator.plugins['Shockwave Flash']; | |
| 811 | + if (s) { | |
| 812 | + f = true; | |
| 813 | + var w = s.description.split(' '); | |
| 814 | + for (var i = 0; i < w.length; ++i) { | |
| 815 | + if (isNaN(parseInt(w[i]))) continue; | |
| 816 | + v = parseInt(w[i]); | |
| 817 | + } | |
| 818 | + } | |
| 819 | + } | |
| 820 | + } | |
| 821 | + return { | |
| 822 | + f: f, | |
| 823 | + v: v | |
| 824 | + }; | |
| 825 | + }, | |
| 826 | + embed:function(f,d,i,w,h,b,v,e,p,j){ | |
| 827 | + var s=['all']; | |
| 828 | + if(b){ | |
| 829 | + if(this.isHTML5()){ | |
| 830 | + this.embedHTML5(d,i,w,h,e,v,s,j); | |
| 831 | + } | |
| 832 | + else{ | |
| 833 | + this.embedSWF(f,d,i,w,h,v,p); | |
| 834 | + } | |
| 835 | + } | |
| 836 | + else{ | |
| 837 | + if(this.Flash()['f'] && parseInt(this.Flash()['v'])>10){ | |
| 838 | + this.embedSWF(f,d,i,w,h,v,p); | |
| 839 | + } | |
| 840 | + else if(this.isHTML5()){ | |
| 841 | + this.embedHTML5(d,i,w,h,e,v,s,j); | |
| 842 | + } | |
| 843 | + else{ | |
| 844 | + this.embedSWF(f,d,i,w,h,v,p); | |
| 845 | + } | |
| 846 | + } | |
| 847 | + }, | |
| 848 | + embedSWF: function(C, D, N, W, H, V, P) { | |
| 849 | + if (!N) { | |
| 850 | + N = 'ckplayer_a1' | |
| 851 | + } | |
| 852 | + if (!P) { | |
| 853 | + P = { | |
| 854 | + bgcolor: '#FFF', | |
| 855 | + allowFullScreen: true, | |
| 856 | + allowScriptAccess: 'always', | |
| 857 | + wmode:'transparent' | |
| 858 | + }; | |
| 859 | + } | |
| 860 | + this._A_=V; | |
| 861 | + this.getX(); | |
| 862 | + var u = 'undefined', | |
| 863 | + g = false, | |
| 864 | + j = document, | |
| 865 | + r = 'http://www.macromedia.com/go/getflashplayer', | |
| 866 | + t = '<a href="' + r + '" target="_blank">请点击此处下载安装最新的flash插件</a>', | |
| 867 | + error = { | |
| 868 | + w: '您的网页不符合w3c标准,无法显示播放器', | |
| 869 | + f: '您没有安装flash插件,无法播放视频,' + t, | |
| 870 | + v: '您的flash插件版本过低,无法播放视频,' + t | |
| 871 | + }, | |
| 872 | + w3c = typeof j.getElementById != u && typeof j.getElementsByTagName != u && typeof j.createElement != u, | |
| 873 | + i = 'id="' + N + '" name="' + N + '" ', | |
| 874 | + s = '', | |
| 875 | + l = ''; | |
| 876 | + P['movie'] = C; | |
| 877 | + P['flashvars'] = this.getflashvars(V); | |
| 878 | + if(W==-1){ | |
| 879 | + d=true; | |
| 880 | + this._K_(D).style.width='100%'; | |
| 881 | + W='100%'; | |
| 882 | + } | |
| 883 | + s += '<object pluginspage="http://www.macromedia.com/go/getflashplayer" '; | |
| 884 | + s += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '; | |
| 885 | + s += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=11,3,0,0" '; | |
| 886 | + s += 'width="' + W + '" '; | |
| 887 | + s += 'height="' + H + '" '; | |
| 888 | + s += i; | |
| 889 | + s += 'align="middle">'; | |
| 890 | + s += this.getparam(P)['v']; | |
| 891 | + s += '<embed '; | |
| 892 | + s += this.getparam(P)['w']; | |
| 893 | + s += ' width="' + W + '" height="' + H + '" name="' + N + '" id="' + N + '" align="middle" ' + i; | |
| 894 | + s += 'type="application/x-shockwave-flash" pluginspage="' + r + '" />'; | |
| 895 | + s += '</object>'; | |
| 896 | + if (!w3c) { | |
| 897 | + l = error['w']; | |
| 898 | + g = true; | |
| 899 | + } else { | |
| 900 | + if (!this.Flash()['f']) { | |
| 901 | + l = error['f']; | |
| 902 | + g = true; | |
| 903 | + } else { | |
| 904 | + if (this.Flash()['v'] < 11) { | |
| 905 | + l = error['v']; | |
| 906 | + g = true; | |
| 907 | + } else { | |
| 908 | + l = s; | |
| 909 | + this._T_=false; | |
| 910 | + } | |
| 911 | + } | |
| 912 | + } | |
| 913 | + if (l) { | |
| 914 | + this._K_(D).innerHTML = l; | |
| 915 | + } | |
| 916 | + if (g){ | |
| 917 | + this._K_(D).style.color = '#0066cc'; | |
| 918 | + this._K_(D).style.lineHeight = this._K_(D).style.height; | |
| 919 | + this._K_(D).style.textAlign= 'center'; | |
| 920 | + } | |
| 921 | + }, | |
| 922 | + embedHTML5: function(C, P, W, H, V, A, S, J) { | |
| 923 | + this._E_ = { | |
| 924 | + c: C, | |
| 925 | + p: P, | |
| 926 | + w: W, | |
| 927 | + h: H, | |
| 928 | + v: V, | |
| 929 | + s: S, | |
| 930 | + j: J==undefined || J?true:false | |
| 931 | + }; | |
| 932 | + this._A_ = A; | |
| 933 | + this.getX(); | |
| 934 | + b = this.browser()['B'], | |
| 935 | + v = this.browser()['V'], | |
| 936 | + x = v.split('.'), | |
| 937 | + t = x[0], | |
| 938 | + m = b + v, | |
| 939 | + n = b + t, | |
| 940 | + w = '', | |
| 941 | + s = false, | |
| 942 | + f = this.Flash()['f'], | |
| 943 | + a = false; | |
| 944 | + if (!S) { | |
| 945 | + S = ['iPad', 'iPhone', 'ios']; | |
| 946 | + } | |
| 947 | + for (var i = 0; i < S.length; i++) { | |
| 948 | + w = S[i]; | |
| 949 | + if (w.toLowerCase() == 'all') { | |
| 950 | + s = true; | |
| 951 | + break; | |
| 952 | + } | |
| 953 | + if (w.toLowerCase() == 'all+false' && !f) { | |
| 954 | + s = true; | |
| 955 | + break; | |
| 956 | + } | |
| 957 | + if (w.indexOf('+') > -1) { | |
| 958 | + w = w.split('+')[0]; | |
| 959 | + a = true; | |
| 960 | + } else { | |
| 961 | + a = false; | |
| 962 | + } | |
| 963 | + if (this.Platform() == w || m == w || n == w || b == w) { | |
| 964 | + if (a) { | |
| 965 | + if (!f) { | |
| 966 | + s = true; | |
| 967 | + break; | |
| 968 | + } | |
| 969 | + }else { | |
| 970 | + s = true; | |
| 971 | + break; | |
| 972 | + } | |
| 973 | + } | |
| 974 | + } | |
| 975 | + if (s) { | |
| 976 | + if (V) { | |
| 977 | + var l = V[0].split('->'); | |
| 978 | + if (l && l.length == 2 && l[1].indexOf('ajax') > -1) { | |
| 979 | + this.getUrl(l, true); | |
| 980 | + return; | |
| 981 | + } | |
| 982 | + } | |
| 983 | + this.showHtml5(); | |
| 984 | + } | |
| 985 | + }, | |
| 986 | + status: function() { | |
| 987 | + this._H_ = parseInt(this.getSn('setup', 20)); | |
| 988 | + var f='ckplayer_status'; | |
| 989 | + if (this.getSn('calljs', 0)!='') { | |
| 990 | + f=this.getSn('calljs', 0); | |
| 991 | + } | |
| 992 | + try { | |
| 993 | + if (typeof(eval(f)) == 'function') { | |
| 994 | + this._L_=eval(f); | |
| 995 | + this._M_=true; | |
| 996 | + return true; | |
| 997 | + } | |
| 998 | + } catch(e) { | |
| 999 | + try { | |
| 1000 | + if (typeof(eval(ckplayer_status)) == 'function') { | |
| 1001 | + this._L_=ckplayer_status; | |
| 1002 | + this._M_=true; | |
| 1003 | + return true; | |
| 1004 | + } | |
| 1005 | + } catch(e) { | |
| 1006 | + return false; | |
| 1007 | + } | |
| 1008 | + } | |
| 1009 | + return false; | |
| 1010 | + }, | |
| 1011 | + showHtml5: function() { | |
| 1012 | + var C = this; | |
| 1013 | + var p = C._E_['p'], | |
| 1014 | + a = C._E_['v'], | |
| 1015 | + c = C._E_['c'], | |
| 1016 | + j = '', | |
| 1017 | + b = false; | |
| 1018 | + var s = this._E_['v']; | |
| 1019 | + var w=C._E_['w'],h=C._E_['h']; | |
| 1020 | + var d=false; | |
| 1021 | + var r=''; | |
| 1022 | + if(s.length==1){ | |
| 1023 | + r=' src="'+s[0].split('->')[0]+'"'; | |
| 1024 | + } | |
| 1025 | + if(w==-1){ | |
| 1026 | + d=true; | |
| 1027 | + C._K_(c).style.width='100%'; | |
| 1028 | + w='100%'; | |
| 1029 | + } | |
| 1030 | + if(w.toString().indexOf('%')>-1){ | |
| 1031 | + w='100%'; | |
| 1032 | + } | |
| 1033 | + if(h.toString().indexOf('%')>-1){ | |
| 1034 | + h='100%'; | |
| 1035 | + } | |
| 1036 | + if(C._E_['j']){ | |
| 1037 | + j=' controls="controls"'; | |
| 1038 | + } | |
| 1039 | + var v = '<video'+j+r+' id="' + p + '" width="' + w + '" height="' + h + '"' + C.getParams() + ' webkit-playsinline>' + C.getVideo() + '</video>'; | |
| 1040 | + C._K_(c).innerHTML = v; | |
| 1041 | + C._K_(c).style.backgroundColor = '#000'; | |
| 1042 | + C._V_ = C._K_(p); | |
| 1043 | + if(!d){ | |
| 1044 | + C._K_(c).style.width=C._E_['w'].toString().indexOf('%')>-1?(C._K_(c).offsetWidth*parseInt(C._E_['w'])*0.01)+'px':C._V_.width+'px'; | |
| 1045 | + C._K_(c).style.height=C._E_['h'].toString().indexOf('%')>-1?(C._K_(c).offsetHeight*parseInt(C._E_['h'])*0.01)+'px':C._V_.height+'px'; | |
| 1046 | + } | |
| 1047 | + C._P_ = false; | |
| 1048 | + C._T_ = true; | |
| 1049 | + if (C.getVars('loaded')!='') { | |
| 1050 | + var f=C.getVars('loaded')+'()'; | |
| 1051 | + try { | |
| 1052 | + if (typeof(eval(f)) == 'function') { | |
| 1053 | + eval(f); | |
| 1054 | + } | |
| 1055 | + } catch(e) { | |
| 1056 | + try { | |
| 1057 | + if (typeof(eval(loadedHandler)) == 'function') { | |
| 1058 | + loadedHandler(); | |
| 1059 | + } | |
| 1060 | + } catch(e) { | |
| 1061 | + } | |
| 1062 | + } | |
| 1063 | + } | |
| 1064 | + C.status(); | |
| 1065 | + C.addListener('play', C.playHandler); | |
| 1066 | + C.addListener('pause', C.playHandler); | |
| 1067 | + C.addListener('error', C.errorHandler); | |
| 1068 | + C.addListener('emptied', C.errorHandler); | |
| 1069 | + C.addListener('loadedmetadata', C.loadedMetadataHandler); | |
| 1070 | + C.addListener('ended', C.endedHandler); | |
| 1071 | + C.addListener('volumechange', C.volumeChangeHandler); | |
| 1072 | + if((C.getVars('m')!='' && C.getVars('m')!=null) || parseInt( C.getSn('setup', 0))>0){ | |
| 1073 | + C._K_(c).style.cursor='pointer'; | |
| 1074 | + } | |
| 1075 | + if((C.getVars('m')!='' && C.getVars('m')!=null) || parseInt( C.getSn('setup', 1))==1){ | |
| 1076 | + C.addListener('click', C.html5Click); | |
| 1077 | + } | |
| 1078 | + }, | |
| 1079 | + addListenerTime:function(){ | |
| 1080 | + var C = CKobject; | |
| 1081 | + if(C.AT){ | |
| 1082 | + C.AT(C._V_['currentTime']); | |
| 1083 | + } | |
| 1084 | + }, | |
| 1085 | + videoPlay: function() { | |
| 1086 | + if (this._T_) { | |
| 1087 | + this._V_.play(); | |
| 1088 | + } | |
| 1089 | + }, | |
| 1090 | + videoPause: function() { | |
| 1091 | + if (this._T_) { | |
| 1092 | + this._V_.pause(); | |
| 1093 | + } | |
| 1094 | + }, | |
| 1095 | + playOrPause: function() { | |
| 1096 | + if (this._T_) { | |
| 1097 | + if (this._V_.paused) { | |
| 1098 | + this._V_.play(); | |
| 1099 | + } else { | |
| 1100 | + this._V_.pause(); | |
| 1101 | + } | |
| 1102 | + } | |
| 1103 | + }, | |
| 1104 | + fastNext: function() { | |
| 1105 | + if (this._T_) { | |
| 1106 | + this._V_['currentTime'] = this._V_['currentTime'] + 10; | |
| 1107 | + } | |
| 1108 | + }, | |
| 1109 | + fastBack: function() { | |
| 1110 | + if (this._T_) { | |
| 1111 | + this._V_['currentTime'] = this._V_['currentTime'] - 10; | |
| 1112 | + } | |
| 1113 | + }, | |
| 1114 | + changeVolume: function(n) { | |
| 1115 | + if(n<0 || n>100){ | |
| 1116 | + return; | |
| 1117 | + } | |
| 1118 | + if (this._T_) { | |
| 1119 | + this._V_['volume'] = n * 0.01; | |
| 1120 | + } | |
| 1121 | + }, | |
| 1122 | + videoSeek: function(t) { | |
| 1123 | + if (this._T_) { | |
| 1124 | + this._V_['currentTime'] = t; | |
| 1125 | + } | |
| 1126 | + }, | |
| 1127 | + newAddress: function(u) { | |
| 1128 | + var s = []; | |
| 1129 | + if (u) { | |
| 1130 | + s = this.isHtml5New(u); | |
| 1131 | + } else { | |
| 1132 | + return; | |
| 1133 | + } | |
| 1134 | + if (s && this._T_) { | |
| 1135 | + this.changeParams(u); | |
| 1136 | + var l = s[0].split('->'); | |
| 1137 | + if (l && l.length == 2 && l[1].indexOf('ajax') > -1) { | |
| 1138 | + this.getUrl(l, false); | |
| 1139 | + return; | |
| 1140 | + } | |
| 1141 | + this._E_['v'] = s; | |
| 1142 | + this.newAdr(); | |
| 1143 | + } | |
| 1144 | + }, | |
| 1145 | + quitFullScreen:function() { | |
| 1146 | + if(document.cancelFullScreen) { | |
| 1147 | + document.cancelFullScreen(); | |
| 1148 | + } | |
| 1149 | + else if(document.mozCancelFullScreen) { | |
| 1150 | + document.mozCancelFullScreen(); | |
| 1151 | + } else if(document.webkitCancelFullScreen) { | |
| 1152 | + document.webkitCancelFullScreen(); | |
| 1153 | + } | |
| 1154 | + | |
| 1155 | + }, | |
| 1156 | + changeStatus:function(n){ | |
| 1157 | + this._H_=n; | |
| 1158 | + }, | |
| 1159 | + newAdr: function() { | |
| 1160 | + var s = this._E_['v']; | |
| 1161 | + this._V_.pause(); | |
| 1162 | + if(s.length==1){ | |
| 1163 | + this._V_.src=s[0].split('->')[0]; | |
| 1164 | + } | |
| 1165 | + else{ | |
| 1166 | + this._V_['innerHTML'] = this.getVideo(); | |
| 1167 | + } | |
| 1168 | + this._V_.load(); | |
| 1169 | + }, | |
| 1170 | + isHtml5New: function(s) { | |
| 1171 | + if (s.indexOf('html5') == -1) { | |
| 1172 | + return false; | |
| 1173 | + } | |
| 1174 | + var a = s.replace(/{/g, ''); | |
| 1175 | + var b = a.split('}'); | |
| 1176 | + var c = ''; | |
| 1177 | + for (var i = 0; i < b.length; i++) { | |
| 1178 | + if (b[i].indexOf('html5') > -1) { | |
| 1179 | + c = b[i].replace('html5->', '').split(','); | |
| 1180 | + break; | |
| 1181 | + } | |
| 1182 | + } | |
| 1183 | + return c; | |
| 1184 | + }, | |
| 1185 | + changeParams: function(f) { | |
| 1186 | + if (f) { | |
| 1187 | + var a = f.replace(/{/g, ''); | |
| 1188 | + var b = a.split('}'); | |
| 1189 | + var c = ''; | |
| 1190 | + for (var i = 0; i < b.length; i++) { | |
| 1191 | + var d = b[i].split('->'); | |
| 1192 | + if(d.length == 2){ | |
| 1193 | + switch(d[0]){ | |
| 1194 | + case 'p': | |
| 1195 | + if(parseInt(d[1]) == 1){ | |
| 1196 | + this._V_.autoplay = true; | |
| 1197 | + } | |
| 1198 | + else if(parseInt(d[1]) == 2){ | |
| 1199 | + this._V_.preload = 'metadata'; | |
| 1200 | + } | |
| 1201 | + else{ | |
| 1202 | + this._V_.autoplay = false; | |
| 1203 | + if(this._I_!=null){ | |
| 1204 | + clearInterval(this._I_); | |
| 1205 | + this._I_=null; | |
| 1206 | + } | |
| 1207 | + } | |
| 1208 | + break; | |
| 1209 | + case 'e': | |
| 1210 | + if(parseInt(d[1]) == 1){ | |
| 1211 | + this._V_.loop = true; | |
| 1212 | + } | |
| 1213 | + else{ | |
| 1214 | + this._V_.loop = false; | |
| 1215 | + } | |
| 1216 | + break; | |
| 1217 | + case 'i': | |
| 1218 | + this._V_.poster = d[1]; | |
| 1219 | + break; | |
| 1220 | + default: | |
| 1221 | + break; | |
| 1222 | + } | |
| 1223 | + } | |
| 1224 | + } | |
| 1225 | + } | |
| 1226 | + }, | |
| 1227 | + frontAdPause: function(s) { | |
| 1228 | + this.getNot(); | |
| 1229 | + }, | |
| 1230 | + frontAdUnload: function() { | |
| 1231 | + this.getNot(); | |
| 1232 | + }, | |
| 1233 | + changeFace: function(s) { | |
| 1234 | + this.getNot(); | |
| 1235 | + }, | |
| 1236 | + plugin: function(a, b, c, d, e, f, g) { | |
| 1237 | + this.getNot(); | |
| 1238 | + }, | |
| 1239 | + videoClear: function() { | |
| 1240 | + this.getNot(); | |
| 1241 | + }, | |
| 1242 | + videoBrightness: function(s) { | |
| 1243 | + this.getNot(); | |
| 1244 | + }, | |
| 1245 | + videoContrast: function(s) { | |
| 1246 | + this.getNot(); | |
| 1247 | + }, | |
| 1248 | + videoSaturation: function(s) { | |
| 1249 | + this.getNot(); | |
| 1250 | + }, | |
| 1251 | + videoSetHue: function(s) { | |
| 1252 | + this.getNot(); | |
| 1253 | + }, | |
| 1254 | + videoWAndH: function(a, b) { | |
| 1255 | + this.getNot(); | |
| 1256 | + }, | |
| 1257 | + videoWHXY: function(a, b, c, d) { | |
| 1258 | + this.getNot(); | |
| 1259 | + }, | |
| 1260 | + changeFlashvars: function(a) { | |
| 1261 | + this.getNot(); | |
| 1262 | + }, | |
| 1263 | + changeMyObject: function(a, b) { | |
| 1264 | + this.getNot(); | |
| 1265 | + }, | |
| 1266 | + getMyObject: function(a, b) { | |
| 1267 | + this.getNot(); | |
| 1268 | + }, | |
| 1269 | + changeeFace: function() { | |
| 1270 | + this.getNot(); | |
| 1271 | + }, | |
| 1272 | + changeStyle: function(a, b) { | |
| 1273 | + this.getNot(); | |
| 1274 | + }, | |
| 1275 | + promptLoad: function() { | |
| 1276 | + this.getNot(); | |
| 1277 | + }, | |
| 1278 | + promptUnload: function() { | |
| 1279 | + this.getNot(); | |
| 1280 | + }, | |
| 1281 | + marqueeLoad: function(a,b) { | |
| 1282 | + this.getNot(); | |
| 1283 | + }, | |
| 1284 | + marqueeClose: function(s) { | |
| 1285 | + this.getNot(); | |
| 1286 | + }, | |
| 1287 | + videoError: function(s) { | |
| 1288 | + this.getNot(); | |
| 1289 | + }, | |
| 1290 | + formatUrl: function(s) { | |
| 1291 | + this.getNot(); | |
| 1292 | + }, | |
| 1293 | + sendJS: function(s) { | |
| 1294 | + this.getNot(); | |
| 1295 | + }, | |
| 1296 | + plugAttribute: function(s) { | |
| 1297 | + this.getNot(); | |
| 1298 | + }, | |
| 1299 | + errorTextShow: function(s) { | |
| 1300 | + this.getNot(); | |
| 1301 | + }, | |
| 1302 | + openUrl: function(s) { | |
| 1303 | + window.open(s); | |
| 1304 | + }, | |
| 1305 | + jsonParse: function(s) { | |
| 1306 | + this.getNot(); | |
| 1307 | + }, | |
| 1308 | + promptShow: function(s,x,y) { | |
| 1309 | + this.getNot(); | |
| 1310 | + }, | |
| 1311 | + screenShot: function(s,x,y,x2,y2) { | |
| 1312 | + this.getNot(); | |
| 1313 | + }, | |
| 1314 | + fullScreen: function() { | |
| 1315 | + this.getNot(); | |
| 1316 | + }, | |
| 1317 | + allowFull: function() { | |
| 1318 | + this.getNot(); | |
| 1319 | + }, | |
| 1320 | + loadButton: function() { | |
| 1321 | + this.getNot(); | |
| 1322 | + }, | |
| 1323 | + getFile: function() { | |
| 1324 | + this.getNot(); | |
| 1325 | + }, | |
| 1326 | + textBoxShow:function() { | |
| 1327 | + this.getNot(); | |
| 1328 | + }, | |
| 1329 | + loadElement: function() { | |
| 1330 | + this.getNot(); | |
| 1331 | + }, | |
| 1332 | + textBoxClose: function() { | |
| 1333 | + this.getNot(); | |
| 1334 | + }, | |
| 1335 | + textBoxTween: function() { | |
| 1336 | + this.getNot(); | |
| 1337 | + }, | |
| 1338 | + getNot: function() { | |
| 1339 | + var s='The ckplayer\'s API for HTML5 does not exist'; | |
| 1340 | + return s; | |
| 1341 | + }, | |
| 1342 | + volumeChangeHandler: function() { | |
| 1343 | + var C = CKobject; | |
| 1344 | + if (C._V_.muted) { | |
| 1345 | + C.returnStatus('volumechange:0', 1); | |
| 1346 | + C._O_['volume'] = 0; | |
| 1347 | + C._O_['mute'] = true; | |
| 1348 | + } else { | |
| 1349 | + C._O_['mute'] = false; | |
| 1350 | + C._O_['volume'] = C._V_['volume'] * 100; | |
| 1351 | + C.returnStatus('volumechange:'+C._V_['volume'] * 100, 1); | |
| 1352 | + } | |
| 1353 | + }, | |
| 1354 | + endedHandler: function() { | |
| 1355 | + var C = CKobject; | |
| 1356 | + var e=parseInt(C.getVars('e')); | |
| 1357 | + C.returnStatus('ended', 1); | |
| 1358 | + if(C._I_){ | |
| 1359 | + clearInterval(C._I_); | |
| 1360 | + C._I_=null; | |
| 1361 | + } | |
| 1362 | + if ( e!= 0 && e !=4 && e !=6) { | |
| 1363 | + return; | |
| 1364 | + } | |
| 1365 | + if(e==6){ | |
| 1366 | + this.quitFullScreen(); | |
| 1367 | + } | |
| 1368 | + var f='playerstop()'; | |
| 1369 | + if (C.getSn('calljs', 2)!='') { | |
| 1370 | + f=C.getSn('calljs', 2)+'()'; | |
| 1371 | + } | |
| 1372 | + try { | |
| 1373 | + if (typeof(eval(f)) == 'function') { | |
| 1374 | + eval(f); | |
| 1375 | + return; | |
| 1376 | + } | |
| 1377 | + } catch(e) { | |
| 1378 | + try { | |
| 1379 | + if (typeof(eval(playerstop)) == 'function') { | |
| 1380 | + playerstop(); | |
| 1381 | + return; | |
| 1382 | + } | |
| 1383 | + } catch(e) { | |
| 1384 | + return; | |
| 1385 | + } | |
| 1386 | + } | |
| 1387 | + }, | |
| 1388 | + loadedMetadataHandler: function() { | |
| 1389 | + var C = CKobject; | |
| 1390 | + C.returnStatus('loadedmetadata', 1); | |
| 1391 | + C._O_['totalTime'] = C._V_['duration']; | |
| 1392 | + C._O_['width'] = C._V_['width']; | |
| 1393 | + C._O_['height'] = C._V_['height']; | |
| 1394 | + C._O_['awidth'] = C._V_['videoWidth']; | |
| 1395 | + C._O_['aheight'] = C._V_['videoHeight']; | |
| 1396 | + if (C._V_.defaultMuted) { | |
| 1397 | + C.returnStatus('volumechange:0', 1); | |
| 1398 | + C._O_['mute'] = true; | |
| 1399 | + C._O_['volume'] = 0; | |
| 1400 | + } else { | |
| 1401 | + C._O_['mute'] = false; | |
| 1402 | + C._O_['volume'] = C._V_['volume'] * 100; | |
| 1403 | + C.returnStatus('volumechange:'+C._V_['volume'] * 100, 1); | |
| 1404 | + } | |
| 1405 | + if (parseInt(C.getVars('p')) == 1) { | |
| 1406 | + C.playHandler(); | |
| 1407 | + } | |
| 1408 | + if(C.ATAll){ | |
| 1409 | + C.ATAll(C._V_['duration']); | |
| 1410 | + } | |
| 1411 | + }, | |
| 1412 | + errorHandler: function() { | |
| 1413 | + CKobject.returnStatus('error', 1); | |
| 1414 | + }, | |
| 1415 | + playHandler: function() { | |
| 1416 | + var C = CKobject; | |
| 1417 | + if (C._V_.paused) { | |
| 1418 | + C.returnStatus('pause', 1); | |
| 1419 | + C.addO('play', false); | |
| 1420 | + if(C._I_!=null){ | |
| 1421 | + clearInterval(C._I_); | |
| 1422 | + C._I_=null; | |
| 1423 | + } | |
| 1424 | + } else { | |
| 1425 | + C.returnStatus('play', 1); | |
| 1426 | + C.addO('play', true); | |
| 1427 | + if (!C._P_) { | |
| 1428 | + C.returnStatus('play', 1); | |
| 1429 | + C._P_ = true; | |
| 1430 | + } | |
| 1431 | + C._I_ = setInterval(C.playTime, parseInt( C.getSn('setup', 37))); | |
| 1432 | + if(!C._G_){ | |
| 1433 | + C._G_=true; | |
| 1434 | + for(var k in C._A_){ | |
| 1435 | + if(k=='g' && C._A_[k]){ | |
| 1436 | + var g=parseInt(C._A_[k]); | |
| 1437 | + C.videoSeek(g); | |
| 1438 | + } | |
| 1439 | + } | |
| 1440 | + } | |
| 1441 | + if(!C._Y_){ | |
| 1442 | + C._Y_=true; | |
| 1443 | + for(var k in C._A_){ | |
| 1444 | + if(k=='j' && C._A_[k]){ | |
| 1445 | + var j=parseInt(C._A_[k]); | |
| 1446 | + if(j>0){ | |
| 1447 | + C._J_=j; | |
| 1448 | + } | |
| 1449 | + else{ | |
| 1450 | + C._J_=parseInt(C._O_['totalTime'])+j; | |
| 1451 | + } | |
| 1452 | + } | |
| 1453 | + } | |
| 1454 | + } | |
| 1455 | + } | |
| 1456 | + }, | |
| 1457 | + html5Click: function(){ | |
| 1458 | + //console.log(this); | |
| 1459 | + var C = CKobject; | |
| 1460 | + if(C.getVars('m')!='' && C.getVars('m')!=null){ | |
| 1461 | + window.open(C.getVars('m')); | |
| 1462 | + } | |
| 1463 | + }, | |
| 1464 | + returnStatus: function(s, j) { | |
| 1465 | + var h = s; | |
| 1466 | + if (this._H_ == 3) { | |
| 1467 | + h = this._E_['p'] +'->'+ h; | |
| 1468 | + } | |
| 1469 | + if (this._M_ && j <= this._H_ ) { | |
| 1470 | + this._L_(h); | |
| 1471 | + } | |
| 1472 | + }, | |
| 1473 | + addO: function(s, z) { | |
| 1474 | + this._O_[s] = z; | |
| 1475 | + }, | |
| 1476 | + getStatus: function() { | |
| 1477 | + return this._O_; | |
| 1478 | + }, | |
| 1479 | + playTime: function() { | |
| 1480 | + var C = CKobject; | |
| 1481 | + var t = C._V_['currentTime']; | |
| 1482 | + C._O_['time'] = t; | |
| 1483 | + if(C._J_>0 && t>C._J_){ | |
| 1484 | + C._J_=0; | |
| 1485 | + C.videoSeek(C._O_['totaltime']); | |
| 1486 | + } | |
| 1487 | + C.returnStatus('time:' + t, 1); | |
| 1488 | + } | |
| 1489 | + } | |
| 1490 | + window.CKobject = CKobject; | |
| 1491 | 1491 | })(); |
| 1492 | 1492 | \ No newline at end of file | ... | ... |
src/main/webapp/static/assets/ckplayer_back/ckplayer.xml
| 1 | -<?xml version="1.0" encoding="utf-8"?> | |
| 2 | -<ckplayer> | |
| 3 | - <style> | |
| 4 | - <cpath></cpath> | |
| 5 | - <!-- | |
| 6 | - 播放器风格压缩包文件的路径,默认的是style.swf | |
| 7 | - 如果调用不出来可以试着设置成绝对路径试试 | |
| 8 | - 如果不知道路径并且使用的是默认配置,可以直接留空,播放器会自动寻找 | |
| 9 | - --> | |
| 10 | - <language></language> | |
| 11 | - <!-- | |
| 12 | - 播放器所使用的语言配置文件,需要和播放器在同目录下,默认是language.xml | |
| 13 | - --> | |
| 14 | - <flashvars>{b->1}{p->1}</flashvars> | |
| 15 | - <!-- | |
| 16 | - 这里是用来做为对flashvars值的补充,除了c和x二个参数以外的设置都可以在这里进行配置 | |
| 17 | - 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 | |
| 18 | - 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 | |
| 19 | - --> | |
| 20 | - <setup>1,1,1,1,1,2,0,1,2,0,0,1,200,0,2,1,0,1,1,1,0,10,3,0,1,2,3000,0,0,0,0,1,1,1,1,1,1,250,0,90,0,0,0</setup> | |
| 21 | - <!-- | |
| 22 | - 这是配置文件里比较重要的一个参数,共有N个功能控制参数,并且以后会继续的增加,各控制参数以英文逗号(,)隔开。下面列出各参数的说明: | |
| 23 | - 1、鼠标经过按钮是否使用手型,0普通鼠标,1手型鼠标,2是只有按钮手型,3是控制栏手型 | |
| 24 | - 2、是否支持单击暂停,0不支持,1是支持 | |
| 25 | - 3、是否支持双击全屏,0不支持,1是支持 | |
| 26 | - 4、在播放前置广告时是否同时加载视频,0不加载,1加载 | |
| 27 | - 5、广告显示的参考对象,0是参考视频区域,1是参考播放器区域 | |
| 28 | - 6、广告大小的调整方式,只针对swf和图片有效,视频是自动缩放的 | |
| 29 | - 0=自动调整大小,意思是说大的话就变小,小的话就变大 | |
| 30 | - 1=是大的化变小,小的话不变 | |
| 31 | - 2=是什么也不变,就这么大 | |
| 32 | - 3=是跟参考对像(第5个控制)参数设置的一样宽高 | |
| 33 | - 7、前置广告播放顺序,0是顺序播放,1是随机播放,>1则随机取所有广告中的(N-1)个进行播放 | |
| 34 | - 8、对于视频广告是否采用修正,0是不使用,1是使用,如果是1,则用户在网速慢的情况下会按设定的倒计时进行播放广告,计时结束则放正片(比较人性化),设置成0的话,则强制播放完广告才能播放正片 | |
| 35 | - 9、是否开启滚动文字广告,0是不开启,1是开启且不使用关闭按钮,2是开启并且使用关闭按钮,开启后将在加载视频的时候加载滚动文字广告 | |
| 36 | - 10、视频的调整方式 | |
| 37 | - 0=是自动调整大小,意思是说大的话就变小,小的话就变大,同时保持长宽比例不变 | |
| 38 | - 1=是大的化变小,小的话不变 | |
| 39 | - 2=是什么也不变,就这么大 | |
| 40 | - 3=是跟参考对像(pm_video的设置)参数设置的一样宽高 | |
| 41 | - 11、是否在多视频时分段加载,0不是,1是 | |
| 42 | - 12、缩放视频时是否进行平滑处理,0不是,1是 | |
| 43 | - 13、视频缓冲时间,单位:毫秒,建议不超过300 | |
| 44 | - 14、初始图片调整方式( | |
| 45 | - 0=是自动调整大小,意思是说大的话就变小,小的话就变大,同时保持长宽比例不变 | |
| 46 | - 1=是大的化变小,小的话不变 | |
| 47 | - 2=是什么也不变,就这么大 | |
| 48 | - 3=是跟pm_video参数设置的一样宽高 | |
| 49 | - 15、暂停广告调整方式( | |
| 50 | - 0=是自动调整大小,意思是说大的话就变小,小的话就变大,同时保持长宽比例不变 | |
| 51 | - 1=是大的化变小,小的话不变 | |
| 52 | - 2=是什么也不变,就这么大 | |
| 53 | - 3=是跟pm_video参数设置的一样宽 | |
| 54 | - 16、暂停广告是否使用关闭广告设置,0不使用,1使用 | |
| 55 | - 17、缓冲时是否播放广告,0是不显示,1是显示并同时隐藏掉缓冲图标和进度,2是显示并不隐藏缓冲图标 | |
| 56 | - 18、是否支持键盘空格键控制播放和暂停0不支持,1支持 | |
| 57 | - 19、是否支持键盘左右方向键控制快进快退0不支持,1支持 | |
| 58 | - 20、是否支持键盘上下方向键控制音量0不支持,1支持 | |
| 59 | - 21、播放器返回js全部监听函数的等级,0-2,等级越高,返回的参数越多 | |
| 60 | - 0=不返回全部监听事件 | |
| 61 | - 1=返回监听,但不在控制台输出 | |
| 62 | - 2=返回监听,并且在控制台同步输出 | |
| 63 | - 3=返回全部监听事件,并且在参数前加上"播放器ID->",用于多播放器的监听 | |
| 64 | - 22、快进和快退的秒数 | |
| 65 | - 23、界面上图片元素加载失败重新加载次数 | |
| 66 | - 24、开启加载皮肤压缩文件包的加载进度提示 | |
| 67 | - 25、使用隐藏控制栏时显示简单进度条的功能,0是不使用,1是使用,2是只在普通状态下使用 | |
| 68 | - 26、控制栏隐藏设置(0不隐藏,1全屏时隐藏,2都隐藏 | |
| 69 | - 27、控制栏隐藏延时时间,即在鼠标离开控制栏后多少毫秒后隐藏控制栏 | |
| 70 | - 28、滚动文字广告左右滚动时是否采用无缝,默认0采用,1是不采用 | |
| 71 | - 29、0是正常状态,1是控制栏默认隐藏,播放状态下鼠标经过播放器显示控制栏,2是一直隐藏控制栏 | |
| 72 | - 30、在播放rtmp视频时暂停后点击播放是否采用重新链接的方式,这里一共分0-2三个等级 | |
| 73 | - 31、当采用网址形式(flashvars里s=1/2时)读取视频地址时是采用默认0=get方法,1=post方式 | |
| 74 | - 32、是否启用播放按钮和暂停按钮 | |
| 75 | - 33、是否启用中间暂停按钮 | |
| 76 | - 34、是否启用静音按钮 | |
| 77 | - 35、是否启用全屏按钮 | |
| 78 | - 36、是否启用进度调节栏,0不启用,1是启用,2是只能前进(向右拖动),3是只能后退,4是只能前进但能回到第一次拖动时的位置,5是看过的地方可以随意拖动, | |
| 79 | - 37、是否启用调节音量 | |
| 80 | - 38、计算时间的间隔,毫秒 | |
| 81 | - 39、前置logo至少显示的时间,单位:毫秒 | |
| 82 | - 40、前置视频广告的默认音量 | |
| 83 | - 41、当s=3/4时加载插件是否从压缩包里加载,0不是,1是 | |
| 84 | - 42、加载风格是否采用加密方式传送,该功能普通用户不能使用,并且需要下载ckplayer-SN版 | |
| 85 | - 43、在s=1/2时,调用地址里的地址是否是相对地址(相对于调用文件),0不是,1是 | |
| 86 | - --> | |
| 87 | - <pm_bg>0x000000,100,230,180</pm_bg> | |
| 88 | - <!--播放器整体的背景配置 | |
| 89 | - 1、整体背景颜色 | |
| 90 | - 2、背景透明度 | |
| 91 | - 3、播放器最小宽度 | |
| 92 | - 4、播放器最小高度 | |
| 93 | - 这里只是初始化时的设置,最终加载完播放器后显示的效果需要在style.swf/style.xml里设置该参数 | |
| 94 | - --> | |
| 95 | - <mylogo>logo.swf</mylogo> | |
| 96 | - <!-- | |
| 97 | - 视频加载前显示的logo文件,不使用设置成<mylogo>null</mylogo> | |
| 98 | - --> | |
| 99 | - <pm_mylogo>1,1,-100,-55</pm_mylogo> | |
| 100 | - <!-- | |
| 101 | - 视频加载前显示的logo文件(mylogo参数的)的位置 | |
| 102 | - 本软件所有的四个参数控制位置的方式全部都是统一的意思,如下 | |
| 103 | - 1、水平对齐方式,0是左,1是中,2是右 | |
| 104 | - 2、垂直对齐方式,0是上,1是中,2是下 | |
| 105 | - 3、水平偏移量,举例说明,如果第1个参数设置成0左对齐,第3个偏移量设置成10,就是离左边10个像素,第一个参数设置成2,偏移量如果设置的是正值就会移到播放器外面,只有设置成负值才行,设置成-1,按钮就会跑到播放器外面 | |
| 106 | - 4、垂直偏移量 | |
| 107 | - --> | |
| 108 | - <logo>cklogo.png</logo> | |
| 109 | - <!-- | |
| 110 | - 默认右上角一直显示的logo,不使用设置成<logo>null</logo> | |
| 111 | - --> | |
| 112 | - <pm_logo>2,0,-100,20</pm_logo> | |
| 113 | - <!-- | |
| 114 | - 播放器右上角的logo的位置 | |
| 115 | - 1、水平对齐方式,0是左,1是中,2是右 | |
| 116 | - 2、垂直对齐方式,0是上,1是中,2是下 | |
| 117 | - 3、水平偏移量 | |
| 118 | - 4、垂直偏移量 | |
| 119 | - 以下是播放器自带的二个插件 | |
| 120 | - --> | |
| 121 | - <control_rel>related.swf,related.xml,0</control_rel> | |
| 122 | - <!-- | |
| 123 | - 1、视频播放结束后显示相关精彩视频的插件文件(注意,视频结束动作设置成3时(即var flashvars={e:3})有效), | |
| 124 | - 2、xml文件是调用精彩视频的示例文件,可以自定义文件类型(比如asp,php,jsp,.net只要输出的是xml格式就行),实际使用中一定要注意第二个参数的路径要正确 | |
| 125 | - 3、第三个参数是设置配置文件的编码,0是默认的utf-8,1是gbk2312 | |
| 126 | - --> | |
| 127 | - <control_pv>Preview.swf,105,2000</control_pv> | |
| 128 | - <!-- | |
| 129 | - 视频预览插件 | |
| 130 | - 1、插件文件名称(该插件和上面的精彩视频的插件都是放在风格压缩包里的) | |
| 131 | - 2、离进度栏的高(指的是插件的顶部离进度栏的位置) | |
| 132 | - 3、延迟时间(该处设置鼠标经过进度栏停顿多少毫秒后才显示插件) | |
| 133 | - 建议一定要设置延时时间,不然当鼠标在进度栏上划过的时候就会读取视频地址进行预览,很占资源 | |
| 134 | - --> | |
| 135 | - <pm_repc></pm_repc> | |
| 136 | - <!-- | |
| 137 | - 视频地址替换符,该功能主要是用来做简单加密的功能,使用方法很简单,请注意,只针对f值是视频地址的时候有效,其它地方不能使用。具体的请查看http://www.ckplayer.com/manual.php?id=4#title_25 | |
| 138 | - --> | |
| 139 | - <pm_spac>|</pm_spac> | |
| 140 | - <!-- | |
| 141 | - 视频地址间隔符,这里主要是播放多段视频时使用普通调用方式或网址调用方式时使用的。默认使用|,如果视频地址里本身存在|的话需要另外设置一个间隔符,注意,即使只有一个视频也需要设置。另外在使用rtmp协议播放视频的时候,如果视频存在多级目录的话,这里要改成其它的符号,因为rtmp协议的视频地址多级的话也需要用到|隔开流地址和实例地址 | |
| 142 | - --> | |
| 143 | - <pm_fpac>file->f</pm_fpac> | |
| 144 | - <!-- | |
| 145 | - 该参数的功能是把自定义的flashvars里的变量替换成ckplayer里对应的变量,默认的参数的意思是把flashvars里的file值替换成f值,因为ckplayer里只认f值,多个替换之间用竖线隔开 | |
| 146 | - --> | |
| 147 | - <pm_advtime>2,0,-110,10,0,300,0</pm_advtime> | |
| 148 | - <!-- | |
| 149 | - 前置广告倒计时文本位置,播放前置 广告时有个倒计时的显示文本框,这里是设置该文本框的位置和宽高,对齐方式的。一共7个参数,分别表示: | |
| 150 | - 1、水平对齐方式,0是左对齐,1是中间对齐,2是右对齐 | |
| 151 | - 2、垂直对齐方式,0是上对齐,1是中间对齐,2是低部对齐 | |
| 152 | - 3、水平位置偏移量 | |
| 153 | - 4、垂直位置偏移量 | |
| 154 | - 5、文字对齐方式,0是左对齐,1是中间对齐,2是右对齐,3是默认对齐 | |
| 155 | - 6、文本框宽席 | |
| 156 | - 7、文本框高度 | |
| 157 | - --> | |
| 158 | - <pm_advstatus>1,2,2,-200,-40</pm_advstatus> | |
| 159 | - <!-- | |
| 160 | - 前置广告静音按钮,静音按钮只在是视频广告时显示,当然也可以控制不显示 | |
| 161 | - 1、是否显示0不显示,1显示 | |
| 162 | - 2、水平对齐方式 | |
| 163 | - 3、垂直对齐方式 | |
| 164 | - 4、水平偏移量 | |
| 165 | - 5、垂直偏移量 | |
| 166 | - --> | |
| 167 | - <pm_advjp>1,0,2,2,-100,-40</pm_advjp> | |
| 168 | - <!-- | |
| 169 | - 前置广告跳过广告按钮的位置 | |
| 170 | - 1、是否显示0不显示,1是显示 | |
| 171 | - 2、跳过按钮触发对象(值0/1,0是直接跳转,1是触发js:function ckadjump(){}) | |
| 172 | - 3、水平对齐方式 | |
| 173 | - 4、垂直对齐方式 | |
| 174 | - 5、水平偏移量 | |
| 175 | - 6、垂直偏移量 | |
| 176 | - --> | |
| 177 | - <pm_padvc>2,0,-13,-13</pm_padvc> | |
| 178 | - <!-- | |
| 179 | - 暂停广告的关闭按钮的位置 | |
| 180 | - 1、水平对齐方式 | |
| 181 | - 2、垂直对齐方式 | |
| 182 | - 3、水平偏移量 | |
| 183 | - 4、垂直偏移量 | |
| 184 | - --> | |
| 185 | - <pm_advms>2,2,-46,-67</pm_advms> | |
| 186 | - <!-- | |
| 187 | - 滚动广告关闭按钮位置 | |
| 188 | - 1、水平对齐方式 | |
| 189 | - 2、垂直对齐方式 | |
| 190 | - 3、水平偏移量 | |
| 191 | - 4、垂直偏移量 | |
| 192 | - --> | |
| 193 | - <pm_zip>1,1,-20,-8,1,0,0</pm_zip> | |
| 194 | - <!-- | |
| 195 | - 加载皮肤压缩包时提示文字的位置 | |
| 196 | - 1、水平对齐方式,0是左对齐,1是中间对齐,2是右对齐 | |
| 197 | - 2、垂直对齐方式,0是上对齐,1是中间对齐,2是低部对齐 | |
| 198 | - 3、水平位置偏移量 | |
| 199 | - 4、垂直位置偏移量 | |
| 200 | - 5、文字对齐方式,0是左对齐,1是中间对齐,2是右对齐,3是默认对齐 | |
| 201 | - 6、文本框宽席 | |
| 202 | - 7、文本框高度 | |
| 203 | - --> | |
| 204 | - <pm_advmarquee>1,2,50,-70,50,18,0,0x000000,50,0,20,1,30,2000</pm_advmarquee> | |
| 205 | - <!-- | |
| 206 | - 滚动广告的控制,要使用的话需要在setup里的第9个参数设置成1 | |
| 207 | - 这里分二种情况,前六个参数是定位控制,第7个参数是设置定位方式(0:相对定位,1:绝对定位) | |
| 208 | - 第一种情况:第7个参数是0的时候,相对定位,就是播放器长宽变化的时候,控制栏也跟着变 | |
| 209 | - 1、默认1:中间对齐 | |
| 210 | - 2、上中下对齐(0是上,1是中,2是下) | |
| 211 | - 3、离左边的距离 | |
| 212 | - 4、Y轴偏移量 | |
| 213 | - 5、离右边的距离 | |
| 214 | - 6、高度 | |
| 215 | - 7、定位方式 | |
| 216 | - 第二种情况:第7个参数是1的时候,绝对定位,就是播放器长宽变化的时候,控制栏不跟着变,这种方式一般使用在控制栏大小不变的时候 | |
| 217 | - 1、左中右对齐方式(0是左,1是中间,2是右) | |
| 218 | - 2、上中下对齐(0是上,1是中,2是下) | |
| 219 | - 3、x偏移量 | |
| 220 | - 4、y偏移量 | |
| 221 | - 5、宽度 | |
| 222 | - 6、高度 | |
| 223 | - 7、定位方式 | |
| 224 | - 以上是前7个参数的作用 | |
| 225 | - 8、是文字广告的背景色 | |
| 226 | - 9、置背景色的透明度 | |
| 227 | - 10、控制滚动方向,0是水平滚动(包括左右),1是上下滚动(包括向上和向下) | |
| 228 | - 11、移动的单位时长,即移动单位像素所需要的时长,毫秒 | |
| 229 | - 12、移动的单位像素,正数同左/上,负数向右/下 | |
| 230 | - 13、是行高,这个在设置向上或向下滚动的时候有用处 | |
| 231 | - 14、控制向上或向下滚动时每次停止的时间 | |
| 232 | - --> | |
| 233 | - <pm_glowfilter>0,0x01485d, 100, 6, 3, 10, 1, 0, 0</pm_glowfilter> | |
| 234 | - <!--滚动文字广告是否采用发光滤镜 | |
| 235 | - 1、是否使用发光滤镜,0是不采用,1是使用 | |
| 236 | - 2、(default = 0xFF0000) — 光晕颜色,采用十六进制格式 0xRRGGBB。 默认值为 0xFF0000 | |
| 237 | - 3、(default = 100) — 颜色的 Alpha 透明度值。 有效值为 0 到 100。 例如,25 设置透明度为 25% | |
| 238 | - 4、(default = 6.0) — 水平模糊量。 有效值为 0 到 255(浮点)。 2 的乘方值(如 2、4、8、16 和 32)经过优化,呈现速度比其它值更快 | |
| 239 | - 5、(default = 6.0) — 垂直模糊量。 有效值为 0 到 255(浮点)。 2 的乘方值(如 2、4、8、16 和 32)经过优化,呈现速度比其它值更快 | |
| 240 | - 6、(default = 2) — 印记或跨页的强度。 该值越高,压印的颜色越深,而且发光与背景之间的对比度也越强。 有效值为 0 到 255 | |
| 241 | - 7、(default = 1) — 应用滤镜的次数 | |
| 242 | - 8、(default = 0) — 指定发光是否为内侧发光。 值 1 指定发光是内侧发光。 值 0 指定发光是外侧发光(对象外缘周围的发光) | |
| 243 | - 9、(default = 0) — 指定对象是否具有挖空效果。 值为 1 将使对象的填充变为透明,并显示文档的背景颜色背景颜色。 | |
| 244 | - --> | |
| 245 | - <advmarquee>{a href='http://www.ckplayer.com'}{font color='#FFFFFF' size='12'}这里可以放文字广告,为什么要在这里放呢,{/font}{/a}{a href='http://www.ckplayer.com'}{font color='#FFFFFF' size='12'}是因为如果你想在站外调用视频并且有文字广告的话,{/a}{br}就得在这里才能被加载,在js里是不能补加载的,{br}默认使用这里的广告,如果不想在这里使用可以清空这里的内容</advmarquee> | |
| 246 | - <!-- | |
| 247 | - 该处是滚动文字广告的内容,如果不想在这里设置,就把这里清空并且在页面中使用js的函数定义function ckmarqueeadv(){return '广告内容'} | |
| 248 | - --> | |
| 249 | - <mainfuntion></mainfuntion> | |
| 250 | - <!-- | |
| 251 | - 当flashvars里s=3/4时,调用的函数包名称,默认为空,调用时间轴上的函数setAppObj | |
| 252 | - --> | |
| 253 | - <flashplayer></flashplayer> | |
| 254 | - <!-- | |
| 255 | - 当flashvars里的s=3/4时,也可以把swf文件放在这里 | |
| 256 | - --> | |
| 257 | - <calljs>ckplayer_status,ckadjump,playerstop,ckmarqueeadv</calljs> | |
| 258 | - <!-- | |
| 259 | - 1、全局监听返回结果的函数 | |
| 260 | - 2、跳过广告的函数 | |
| 261 | - 3、播放结束时调用的js函数 | |
| 262 | - 4、加载滚动文字广告的函数 | |
| 263 | - --> | |
| 264 | - <myweb></myweb> | |
| 265 | - | |
| 266 | - <!-- | |
| 267 | - 以下内容部份是和插件相关的配置,请注意,自定义插件以及其配置的命名方式要注意,不要和系统的相重复,不然就会替换掉系统的相关设置,删除相关插件的话也可以同时删除相关的配置 | |
| 268 | - 以下内容定义自定义插件的相关配置,这里也可以自定义任何自己的插件需要配置的内容,当然,如果你某个插件不使用的话,也可以删除相关的配置 | |
| 269 | - --> | |
| 270 | - <cpt_lights>0</cpt_lights> | |
| 271 | - <!-- | |
| 272 | - 该处定义是否使用开关灯,使用开灯效果时调用页面的js函数function closelights(){},关灯调用 function closelights(){}; | |
| 273 | - --> | |
| 274 | - <cpt_share>/ckplayer/share.xml</cpt_share> | |
| 275 | - <!-- | |
| 276 | - 分享插件调用的配置文件地址,此设设置成空,则不启用分享按钮 | |
| 277 | - 调用插件开始 | |
| 278 | - --> | |
| 279 | - </style> | |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<ckplayer> | |
| 3 | + <style> | |
| 4 | + <cpath></cpath> | |
| 5 | + <!-- | |
| 6 | + 播放器风格压缩包文件的路径,默认的是style.swf | |
| 7 | + 如果调用不出来可以试着设置成绝对路径试试 | |
| 8 | + 如果不知道路径并且使用的是默认配置,可以直接留空,播放器会自动寻找 | |
| 9 | + --> | |
| 10 | + <language></language> | |
| 11 | + <!-- | |
| 12 | + 播放器所使用的语言配置文件,需要和播放器在同目录下,默认是language.xml | |
| 13 | + --> | |
| 14 | + <flashvars>{b->1}{p->1}</flashvars> | |
| 15 | + <!-- | |
| 16 | + 这里是用来做为对flashvars值的补充,除了c和x二个参数以外的设置都可以在这里进行配置 | |
| 17 | + 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 | |
| 18 | + 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 | |
| 19 | + --> | |
| 20 | + <setup>1,1,1,1,1,2,0,1,2,0,0,1,200,0,2,1,0,1,1,1,0,10,3,0,1,2,3000,0,0,0,0,1,1,1,1,1,1,250,0,90,0,0,0</setup> | |
| 21 | + <!-- | |
| 22 | + 这是配置文件里比较重要的一个参数,共有N个功能控制参数,并且以后会继续的增加,各控制参数以英文逗号(,)隔开。下面列出各参数的说明: | |
| 23 | + 1、鼠标经过按钮是否使用手型,0普通鼠标,1手型鼠标,2是只有按钮手型,3是控制栏手型 | |
| 24 | + 2、是否支持单击暂停,0不支持,1是支持 | |
| 25 | + 3、是否支持双击全屏,0不支持,1是支持 | |
| 26 | + 4、在播放前置广告时是否同时加载视频,0不加载,1加载 | |
| 27 | + 5、广告显示的参考对象,0是参考视频区域,1是参考播放器区域 | |
| 28 | + 6、广告大小的调整方式,只针对swf和图片有效,视频是自动缩放的 | |
| 29 | + 0=自动调整大小,意思是说大的话就变小,小的话就变大 | |
| 30 | + 1=是大的化变小,小的话不变 | |
| 31 | + 2=是什么也不变,就这么大 | |
| 32 | + 3=是跟参考对像(第5个控制)参数设置的一样宽高 | |
| 33 | + 7、前置广告播放顺序,0是顺序播放,1是随机播放,>1则随机取所有广告中的(N-1)个进行播放 | |
| 34 | + 8、对于视频广告是否采用修正,0是不使用,1是使用,如果是1,则用户在网速慢的情况下会按设定的倒计时进行播放广告,计时结束则放正片(比较人性化),设置成0的话,则强制播放完广告才能播放正片 | |
| 35 | + 9、是否开启滚动文字广告,0是不开启,1是开启且不使用关闭按钮,2是开启并且使用关闭按钮,开启后将在加载视频的时候加载滚动文字广告 | |
| 36 | + 10、视频的调整方式 | |
| 37 | + 0=是自动调整大小,意思是说大的话就变小,小的话就变大,同时保持长宽比例不变 | |
| 38 | + 1=是大的化变小,小的话不变 | |
| 39 | + 2=是什么也不变,就这么大 | |
| 40 | + 3=是跟参考对像(pm_video的设置)参数设置的一样宽高 | |
| 41 | + 11、是否在多视频时分段加载,0不是,1是 | |
| 42 | + 12、缩放视频时是否进行平滑处理,0不是,1是 | |
| 43 | + 13、视频缓冲时间,单位:毫秒,建议不超过300 | |
| 44 | + 14、初始图片调整方式( | |
| 45 | + 0=是自动调整大小,意思是说大的话就变小,小的话就变大,同时保持长宽比例不变 | |
| 46 | + 1=是大的化变小,小的话不变 | |
| 47 | + 2=是什么也不变,就这么大 | |
| 48 | + 3=是跟pm_video参数设置的一样宽高 | |
| 49 | + 15、暂停广告调整方式( | |
| 50 | + 0=是自动调整大小,意思是说大的话就变小,小的话就变大,同时保持长宽比例不变 | |
| 51 | + 1=是大的化变小,小的话不变 | |
| 52 | + 2=是什么也不变,就这么大 | |
| 53 | + 3=是跟pm_video参数设置的一样宽 | |
| 54 | + 16、暂停广告是否使用关闭广告设置,0不使用,1使用 | |
| 55 | + 17、缓冲时是否播放广告,0是不显示,1是显示并同时隐藏掉缓冲图标和进度,2是显示并不隐藏缓冲图标 | |
| 56 | + 18、是否支持键盘空格键控制播放和暂停0不支持,1支持 | |
| 57 | + 19、是否支持键盘左右方向键控制快进快退0不支持,1支持 | |
| 58 | + 20、是否支持键盘上下方向键控制音量0不支持,1支持 | |
| 59 | + 21、播放器返回js全部监听函数的等级,0-2,等级越高,返回的参数越多 | |
| 60 | + 0=不返回全部监听事件 | |
| 61 | + 1=返回监听,但不在控制台输出 | |
| 62 | + 2=返回监听,并且在控制台同步输出 | |
| 63 | + 3=返回全部监听事件,并且在参数前加上"播放器ID->",用于多播放器的监听 | |
| 64 | + 22、快进和快退的秒数 | |
| 65 | + 23、界面上图片元素加载失败重新加载次数 | |
| 66 | + 24、开启加载皮肤压缩文件包的加载进度提示 | |
| 67 | + 25、使用隐藏控制栏时显示简单进度条的功能,0是不使用,1是使用,2是只在普通状态下使用 | |
| 68 | + 26、控制栏隐藏设置(0不隐藏,1全屏时隐藏,2都隐藏 | |
| 69 | + 27、控制栏隐藏延时时间,即在鼠标离开控制栏后多少毫秒后隐藏控制栏 | |
| 70 | + 28、滚动文字广告左右滚动时是否采用无缝,默认0采用,1是不采用 | |
| 71 | + 29、0是正常状态,1是控制栏默认隐藏,播放状态下鼠标经过播放器显示控制栏,2是一直隐藏控制栏 | |
| 72 | + 30、在播放rtmp视频时暂停后点击播放是否采用重新链接的方式,这里一共分0-2三个等级 | |
| 73 | + 31、当采用网址形式(flashvars里s=1/2时)读取视频地址时是采用默认0=get方法,1=post方式 | |
| 74 | + 32、是否启用播放按钮和暂停按钮 | |
| 75 | + 33、是否启用中间暂停按钮 | |
| 76 | + 34、是否启用静音按钮 | |
| 77 | + 35、是否启用全屏按钮 | |
| 78 | + 36、是否启用进度调节栏,0不启用,1是启用,2是只能前进(向右拖动),3是只能后退,4是只能前进但能回到第一次拖动时的位置,5是看过的地方可以随意拖动, | |
| 79 | + 37、是否启用调节音量 | |
| 80 | + 38、计算时间的间隔,毫秒 | |
| 81 | + 39、前置logo至少显示的时间,单位:毫秒 | |
| 82 | + 40、前置视频广告的默认音量 | |
| 83 | + 41、当s=3/4时加载插件是否从压缩包里加载,0不是,1是 | |
| 84 | + 42、加载风格是否采用加密方式传送,该功能普通用户不能使用,并且需要下载ckplayer-SN版 | |
| 85 | + 43、在s=1/2时,调用地址里的地址是否是相对地址(相对于调用文件),0不是,1是 | |
| 86 | + --> | |
| 87 | + <pm_bg>0x000000,100,230,180</pm_bg> | |
| 88 | + <!--播放器整体的背景配置 | |
| 89 | + 1、整体背景颜色 | |
| 90 | + 2、背景透明度 | |
| 91 | + 3、播放器最小宽度 | |
| 92 | + 4、播放器最小高度 | |
| 93 | + 这里只是初始化时的设置,最终加载完播放器后显示的效果需要在style.swf/style.xml里设置该参数 | |
| 94 | + --> | |
| 95 | + <mylogo>logo.swf</mylogo> | |
| 96 | + <!-- | |
| 97 | + 视频加载前显示的logo文件,不使用设置成<mylogo>null</mylogo> | |
| 98 | + --> | |
| 99 | + <pm_mylogo>1,1,-100,-55</pm_mylogo> | |
| 100 | + <!-- | |
| 101 | + 视频加载前显示的logo文件(mylogo参数的)的位置 | |
| 102 | + 本软件所有的四个参数控制位置的方式全部都是统一的意思,如下 | |
| 103 | + 1、水平对齐方式,0是左,1是中,2是右 | |
| 104 | + 2、垂直对齐方式,0是上,1是中,2是下 | |
| 105 | + 3、水平偏移量,举例说明,如果第1个参数设置成0左对齐,第3个偏移量设置成10,就是离左边10个像素,第一个参数设置成2,偏移量如果设置的是正值就会移到播放器外面,只有设置成负值才行,设置成-1,按钮就会跑到播放器外面 | |
| 106 | + 4、垂直偏移量 | |
| 107 | + --> | |
| 108 | + <logo>cklogo.png</logo> | |
| 109 | + <!-- | |
| 110 | + 默认右上角一直显示的logo,不使用设置成<logo>null</logo> | |
| 111 | + --> | |
| 112 | + <pm_logo>2,0,-100,20</pm_logo> | |
| 113 | + <!-- | |
| 114 | + 播放器右上角的logo的位置 | |
| 115 | + 1、水平对齐方式,0是左,1是中,2是右 | |
| 116 | + 2、垂直对齐方式,0是上,1是中,2是下 | |
| 117 | + 3、水平偏移量 | |
| 118 | + 4、垂直偏移量 | |
| 119 | + 以下是播放器自带的二个插件 | |
| 120 | + --> | |
| 121 | + <control_rel>related.swf,related.xml,0</control_rel> | |
| 122 | + <!-- | |
| 123 | + 1、视频播放结束后显示相关精彩视频的插件文件(注意,视频结束动作设置成3时(即var flashvars={e:3})有效), | |
| 124 | + 2、xml文件是调用精彩视频的示例文件,可以自定义文件类型(比如asp,php,jsp,.net只要输出的是xml格式就行),实际使用中一定要注意第二个参数的路径要正确 | |
| 125 | + 3、第三个参数是设置配置文件的编码,0是默认的utf-8,1是gbk2312 | |
| 126 | + --> | |
| 127 | + <control_pv>Preview.swf,105,2000</control_pv> | |
| 128 | + <!-- | |
| 129 | + 视频预览插件 | |
| 130 | + 1、插件文件名称(该插件和上面的精彩视频的插件都是放在风格压缩包里的) | |
| 131 | + 2、离进度栏的高(指的是插件的顶部离进度栏的位置) | |
| 132 | + 3、延迟时间(该处设置鼠标经过进度栏停顿多少毫秒后才显示插件) | |
| 133 | + 建议一定要设置延时时间,不然当鼠标在进度栏上划过的时候就会读取视频地址进行预览,很占资源 | |
| 134 | + --> | |
| 135 | + <pm_repc></pm_repc> | |
| 136 | + <!-- | |
| 137 | + 视频地址替换符,该功能主要是用来做简单加密的功能,使用方法很简单,请注意,只针对f值是视频地址的时候有效,其它地方不能使用。具体的请查看http://www.ckplayer.com/manual.php?id=4#title_25 | |
| 138 | + --> | |
| 139 | + <pm_spac>|</pm_spac> | |
| 140 | + <!-- | |
| 141 | + 视频地址间隔符,这里主要是播放多段视频时使用普通调用方式或网址调用方式时使用的。默认使用|,如果视频地址里本身存在|的话需要另外设置一个间隔符,注意,即使只有一个视频也需要设置。另外在使用rtmp协议播放视频的时候,如果视频存在多级目录的话,这里要改成其它的符号,因为rtmp协议的视频地址多级的话也需要用到|隔开流地址和实例地址 | |
| 142 | + --> | |
| 143 | + <pm_fpac>file->f</pm_fpac> | |
| 144 | + <!-- | |
| 145 | + 该参数的功能是把自定义的flashvars里的变量替换成ckplayer里对应的变量,默认的参数的意思是把flashvars里的file值替换成f值,因为ckplayer里只认f值,多个替换之间用竖线隔开 | |
| 146 | + --> | |
| 147 | + <pm_advtime>2,0,-110,10,0,300,0</pm_advtime> | |
| 148 | + <!-- | |
| 149 | + 前置广告倒计时文本位置,播放前置 广告时有个倒计时的显示文本框,这里是设置该文本框的位置和宽高,对齐方式的。一共7个参数,分别表示: | |
| 150 | + 1、水平对齐方式,0是左对齐,1是中间对齐,2是右对齐 | |
| 151 | + 2、垂直对齐方式,0是上对齐,1是中间对齐,2是低部对齐 | |
| 152 | + 3、水平位置偏移量 | |
| 153 | + 4、垂直位置偏移量 | |
| 154 | + 5、文字对齐方式,0是左对齐,1是中间对齐,2是右对齐,3是默认对齐 | |
| 155 | + 6、文本框宽席 | |
| 156 | + 7、文本框高度 | |
| 157 | + --> | |
| 158 | + <pm_advstatus>1,2,2,-200,-40</pm_advstatus> | |
| 159 | + <!-- | |
| 160 | + 前置广告静音按钮,静音按钮只在是视频广告时显示,当然也可以控制不显示 | |
| 161 | + 1、是否显示0不显示,1显示 | |
| 162 | + 2、水平对齐方式 | |
| 163 | + 3、垂直对齐方式 | |
| 164 | + 4、水平偏移量 | |
| 165 | + 5、垂直偏移量 | |
| 166 | + --> | |
| 167 | + <pm_advjp>1,0,2,2,-100,-40</pm_advjp> | |
| 168 | + <!-- | |
| 169 | + 前置广告跳过广告按钮的位置 | |
| 170 | + 1、是否显示0不显示,1是显示 | |
| 171 | + 2、跳过按钮触发对象(值0/1,0是直接跳转,1是触发js:function ckadjump(){}) | |
| 172 | + 3、水平对齐方式 | |
| 173 | + 4、垂直对齐方式 | |
| 174 | + 5、水平偏移量 | |
| 175 | + 6、垂直偏移量 | |
| 176 | + --> | |
| 177 | + <pm_padvc>2,0,-13,-13</pm_padvc> | |
| 178 | + <!-- | |
| 179 | + 暂停广告的关闭按钮的位置 | |
| 180 | + 1、水平对齐方式 | |
| 181 | + 2、垂直对齐方式 | |
| 182 | + 3、水平偏移量 | |
| 183 | + 4、垂直偏移量 | |
| 184 | + --> | |
| 185 | + <pm_advms>2,2,-46,-67</pm_advms> | |
| 186 | + <!-- | |
| 187 | + 滚动广告关闭按钮位置 | |
| 188 | + 1、水平对齐方式 | |
| 189 | + 2、垂直对齐方式 | |
| 190 | + 3、水平偏移量 | |
| 191 | + 4、垂直偏移量 | |
| 192 | + --> | |
| 193 | + <pm_zip>1,1,-20,-8,1,0,0</pm_zip> | |
| 194 | + <!-- | |
| 195 | + 加载皮肤压缩包时提示文字的位置 | |
| 196 | + 1、水平对齐方式,0是左对齐,1是中间对齐,2是右对齐 | |
| 197 | + 2、垂直对齐方式,0是上对齐,1是中间对齐,2是低部对齐 | |
| 198 | + 3、水平位置偏移量 | |
| 199 | + 4、垂直位置偏移量 | |
| 200 | + 5、文字对齐方式,0是左对齐,1是中间对齐,2是右对齐,3是默认对齐 | |
| 201 | + 6、文本框宽席 | |
| 202 | + 7、文本框高度 | |
| 203 | + --> | |
| 204 | + <pm_advmarquee>1,2,50,-70,50,18,0,0x000000,50,0,20,1,30,2000</pm_advmarquee> | |
| 205 | + <!-- | |
| 206 | + 滚动广告的控制,要使用的话需要在setup里的第9个参数设置成1 | |
| 207 | + 这里分二种情况,前六个参数是定位控制,第7个参数是设置定位方式(0:相对定位,1:绝对定位) | |
| 208 | + 第一种情况:第7个参数是0的时候,相对定位,就是播放器长宽变化的时候,控制栏也跟着变 | |
| 209 | + 1、默认1:中间对齐 | |
| 210 | + 2、上中下对齐(0是上,1是中,2是下) | |
| 211 | + 3、离左边的距离 | |
| 212 | + 4、Y轴偏移量 | |
| 213 | + 5、离右边的距离 | |
| 214 | + 6、高度 | |
| 215 | + 7、定位方式 | |
| 216 | + 第二种情况:第7个参数是1的时候,绝对定位,就是播放器长宽变化的时候,控制栏不跟着变,这种方式一般使用在控制栏大小不变的时候 | |
| 217 | + 1、左中右对齐方式(0是左,1是中间,2是右) | |
| 218 | + 2、上中下对齐(0是上,1是中,2是下) | |
| 219 | + 3、x偏移量 | |
| 220 | + 4、y偏移量 | |
| 221 | + 5、宽度 | |
| 222 | + 6、高度 | |
| 223 | + 7、定位方式 | |
| 224 | + 以上是前7个参数的作用 | |
| 225 | + 8、是文字广告的背景色 | |
| 226 | + 9、置背景色的透明度 | |
| 227 | + 10、控制滚动方向,0是水平滚动(包括左右),1是上下滚动(包括向上和向下) | |
| 228 | + 11、移动的单位时长,即移动单位像素所需要的时长,毫秒 | |
| 229 | + 12、移动的单位像素,正数同左/上,负数向右/下 | |
| 230 | + 13、是行高,这个在设置向上或向下滚动的时候有用处 | |
| 231 | + 14、控制向上或向下滚动时每次停止的时间 | |
| 232 | + --> | |
| 233 | + <pm_glowfilter>0,0x01485d, 100, 6, 3, 10, 1, 0, 0</pm_glowfilter> | |
| 234 | + <!--滚动文字广告是否采用发光滤镜 | |
| 235 | + 1、是否使用发光滤镜,0是不采用,1是使用 | |
| 236 | + 2、(default = 0xFF0000) — 光晕颜色,采用十六进制格式 0xRRGGBB。 默认值为 0xFF0000 | |
| 237 | + 3、(default = 100) — 颜色的 Alpha 透明度值。 有效值为 0 到 100。 例如,25 设置透明度为 25% | |
| 238 | + 4、(default = 6.0) — 水平模糊量。 有效值为 0 到 255(浮点)。 2 的乘方值(如 2、4、8、16 和 32)经过优化,呈现速度比其它值更快 | |
| 239 | + 5、(default = 6.0) — 垂直模糊量。 有效值为 0 到 255(浮点)。 2 的乘方值(如 2、4、8、16 和 32)经过优化,呈现速度比其它值更快 | |
| 240 | + 6、(default = 2) — 印记或跨页的强度。 该值越高,压印的颜色越深,而且发光与背景之间的对比度也越强。 有效值为 0 到 255 | |
| 241 | + 7、(default = 1) — 应用滤镜的次数 | |
| 242 | + 8、(default = 0) — 指定发光是否为内侧发光。 值 1 指定发光是内侧发光。 值 0 指定发光是外侧发光(对象外缘周围的发光) | |
| 243 | + 9、(default = 0) — 指定对象是否具有挖空效果。 值为 1 将使对象的填充变为透明,并显示文档的背景颜色背景颜色。 | |
| 244 | + --> | |
| 245 | + <advmarquee>{a href='http://www.ckplayer.com'}{font color='#FFFFFF' size='12'}这里可以放文字广告,为什么要在这里放呢,{/font}{/a}{a href='http://www.ckplayer.com'}{font color='#FFFFFF' size='12'}是因为如果你想在站外调用视频并且有文字广告的话,{/a}{br}就得在这里才能被加载,在js里是不能补加载的,{br}默认使用这里的广告,如果不想在这里使用可以清空这里的内容</advmarquee> | |
| 246 | + <!-- | |
| 247 | + 该处是滚动文字广告的内容,如果不想在这里设置,就把这里清空并且在页面中使用js的函数定义function ckmarqueeadv(){return '广告内容'} | |
| 248 | + --> | |
| 249 | + <mainfuntion></mainfuntion> | |
| 250 | + <!-- | |
| 251 | + 当flashvars里s=3/4时,调用的函数包名称,默认为空,调用时间轴上的函数setAppObj | |
| 252 | + --> | |
| 253 | + <flashplayer></flashplayer> | |
| 254 | + <!-- | |
| 255 | + 当flashvars里的s=3/4时,也可以把swf文件放在这里 | |
| 256 | + --> | |
| 257 | + <calljs>ckplayer_status,ckadjump,playerstop,ckmarqueeadv</calljs> | |
| 258 | + <!-- | |
| 259 | + 1、全局监听返回结果的函数 | |
| 260 | + 2、跳过广告的函数 | |
| 261 | + 3、播放结束时调用的js函数 | |
| 262 | + 4、加载滚动文字广告的函数 | |
| 263 | + --> | |
| 264 | + <myweb></myweb> | |
| 265 | + | |
| 266 | + <!-- | |
| 267 | + 以下内容部份是和插件相关的配置,请注意,自定义插件以及其配置的命名方式要注意,不要和系统的相重复,不然就会替换掉系统的相关设置,删除相关插件的话也可以同时删除相关的配置 | |
| 268 | + 以下内容定义自定义插件的相关配置,这里也可以自定义任何自己的插件需要配置的内容,当然,如果你某个插件不使用的话,也可以删除相关的配置 | |
| 269 | + --> | |
| 270 | + <cpt_lights>0</cpt_lights> | |
| 271 | + <!-- | |
| 272 | + 该处定义是否使用开关灯,使用开灯效果时调用页面的js函数function closelights(){},关灯调用 function closelights(){}; | |
| 273 | + --> | |
| 274 | + <cpt_share>/ckplayer/share.xml</cpt_share> | |
| 275 | + <!-- | |
| 276 | + 分享插件调用的配置文件地址,此设设置成空,则不启用分享按钮 | |
| 277 | + 调用插件开始 | |
| 278 | + --> | |
| 279 | + </style> | |
| 280 | 280 | </ckplayer> |
| 281 | 281 | \ No newline at end of file | ... | ... |
src/main/webapp/static/assets/ckplayer_back/language.xml
| 1 | -<?xml version="1.0" encoding="utf-8"?> | |
| 2 | - <ckplayer> | |
| 3 | - <style> | |
| 4 | - <pr_zip>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}已加载[$prtage]%{/font}</pr_zip> | |
| 5 | - <!-- | |
| 6 | - 加载皮肤包进度提示的文字,[$prtage]会被替换成加载百分比 | |
| 7 | - --> | |
| 8 | - <pr_load>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}已加载[$prtage]%{/font}</pr_load> | |
| 9 | - <!-- | |
| 10 | - 当调用多段视频时,并且没有配置好各段视频的时间和字节数的情况下,播放器需要先读取各段视频的元数据进行计算,此时需要显示一个加载进度告诉用户已计算的情况。 | |
| 11 | - --> | |
| 12 | - <pr_noload>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}加载失败{/font}</pr_noload> | |
| 13 | - <!-- | |
| 14 | - 加载视频失败时显示的内容 | |
| 15 | - --> | |
| 16 | - <pr_buffer>{font color='#FFFFFF' face='Arial' size='12'}[$buffer]%{/font}</pr_buffer> | |
| 17 | - <!-- | |
| 18 | - 视频缓冲时显示的提示,[$buffer]会被替换成缓冲的百分比数字部份 | |
| 19 | - --> | |
| 20 | - <pr_play>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}点击播放{/font}</pr_play> | |
| 21 | - <!-- | |
| 22 | - 鼠标经过播放按钮时的提示,支持html | |
| 23 | - --> | |
| 24 | - <pr_pause>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}点击暂停{/font}</pr_pause> | |
| 25 | - <!-- | |
| 26 | - 鼠标经过暂停按钮时的提示,支持html | |
| 27 | - --> | |
| 28 | - <pr_mute>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}点击静音{/font}</pr_mute> | |
| 29 | - <!-- | |
| 30 | - 鼠标经过静音按钮时的提示,支持html | |
| 31 | - --> | |
| 32 | - <pr_nomute>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}取消静音{/font}</pr_nomute> | |
| 33 | - <!-- | |
| 34 | - 鼠标经过取消静音按钮时的提示,支持html | |
| 35 | - --> | |
| 36 | - <pr_full>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}点击全屏{/font}</pr_full> | |
| 37 | - <!-- | |
| 38 | - 鼠标经过全屏按钮时的提示,支持html | |
| 39 | - --> | |
| 40 | - <pr_nofull>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}退出全屏{/font}</pr_nofull> | |
| 41 | - <!-- | |
| 42 | - 鼠标经过退出全屏按钮时的提示,支持html | |
| 43 | - --> | |
| 44 | - <pr_fastf>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}快进{/font}</pr_fastf> | |
| 45 | - <!-- | |
| 46 | - 鼠标经过快进按钮时的提示,支持html | |
| 47 | - --> | |
| 48 | - <pr_fastr>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}快退{/font}</pr_fastr> | |
| 49 | - <!-- | |
| 50 | - 鼠标经过快退按钮时的提示,支持html | |
| 51 | - --> | |
| 52 | - <pr_time>{font color='#FFFFFF' face='Arial' size='16'}[$Time]{/font}</pr_time> | |
| 53 | - <!-- | |
| 54 | - 鼠标经过进度栏时提示当前点上时间的,[$Time]会被替换成时间,支持html | |
| 55 | - --> | |
| 56 | - <pr_volume>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}音量:[$Volume]%{/font}</pr_volume> | |
| 57 | - <!-- | |
| 58 | - 鼠标经过音量调节框或调整音量时提示,[$Volume]会自动替换音量值(0-100) | |
| 59 | - --> | |
| 60 | - <pr_clockwait>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}00:00 / 00:00{/font}</pr_clockwait> | |
| 61 | - <!-- | |
| 62 | - 在默认不加载视频,即m=1的时候,同时并没有设置视频的时间和字节,即o和w值的时候,pr_clock和pr_clock2里的所有内容被替换成这里设置的值 | |
| 63 | - --> | |
| 64 | - <pr_live>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}视频直播中{/font}</pr_live> | |
| 65 | - <!-- | |
| 66 | - 在直播的情况下显示的文字 | |
| 67 | - --> | |
| 68 | - <pr_adv>{font color='#FFFFFF' size='12' face='Microsoft YaHei,微软雅黑'}广告剩余:{font color='#FF0000' size='15' face='Arial'}{b}[$Second]{/b}{/font} 秒{/font}</pr_adv> | |
| 69 | - <!-- | |
| 70 | - 广告倒计时显示的内容,[$Second]将会显示倒计时的秒数 | |
| 71 | - --> | |
| 72 | - <pr_prompt>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}[$prompt]{/font}</pr_prompt> | |
| 73 | - <!-- | |
| 74 | - 提示点文字 | |
| 75 | - --> | |
| 76 | - <pr_cksetup>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}设置{/font}</pr_cksetup> | |
| 77 | - <!-- | |
| 78 | - 鼠标经过设置提示的文字(该定义为插件所用) | |
| 79 | - --> | |
| 80 | - </style> | |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | + <ckplayer> | |
| 3 | + <style> | |
| 4 | + <pr_zip>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}已加载[$prtage]%{/font}</pr_zip> | |
| 5 | + <!-- | |
| 6 | + 加载皮肤包进度提示的文字,[$prtage]会被替换成加载百分比 | |
| 7 | + --> | |
| 8 | + <pr_load>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}已加载[$prtage]%{/font}</pr_load> | |
| 9 | + <!-- | |
| 10 | + 当调用多段视频时,并且没有配置好各段视频的时间和字节数的情况下,播放器需要先读取各段视频的元数据进行计算,此时需要显示一个加载进度告诉用户已计算的情况。 | |
| 11 | + --> | |
| 12 | + <pr_noload>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}加载失败{/font}</pr_noload> | |
| 13 | + <!-- | |
| 14 | + 加载视频失败时显示的内容 | |
| 15 | + --> | |
| 16 | + <pr_buffer>{font color='#FFFFFF' face='Arial' size='12'}[$buffer]%{/font}</pr_buffer> | |
| 17 | + <!-- | |
| 18 | + 视频缓冲时显示的提示,[$buffer]会被替换成缓冲的百分比数字部份 | |
| 19 | + --> | |
| 20 | + <pr_play>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}点击播放{/font}</pr_play> | |
| 21 | + <!-- | |
| 22 | + 鼠标经过播放按钮时的提示,支持html | |
| 23 | + --> | |
| 24 | + <pr_pause>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}点击暂停{/font}</pr_pause> | |
| 25 | + <!-- | |
| 26 | + 鼠标经过暂停按钮时的提示,支持html | |
| 27 | + --> | |
| 28 | + <pr_mute>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}点击静音{/font}</pr_mute> | |
| 29 | + <!-- | |
| 30 | + 鼠标经过静音按钮时的提示,支持html | |
| 31 | + --> | |
| 32 | + <pr_nomute>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}取消静音{/font}</pr_nomute> | |
| 33 | + <!-- | |
| 34 | + 鼠标经过取消静音按钮时的提示,支持html | |
| 35 | + --> | |
| 36 | + <pr_full>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}点击全屏{/font}</pr_full> | |
| 37 | + <!-- | |
| 38 | + 鼠标经过全屏按钮时的提示,支持html | |
| 39 | + --> | |
| 40 | + <pr_nofull>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}退出全屏{/font}</pr_nofull> | |
| 41 | + <!-- | |
| 42 | + 鼠标经过退出全屏按钮时的提示,支持html | |
| 43 | + --> | |
| 44 | + <pr_fastf>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}快进{/font}</pr_fastf> | |
| 45 | + <!-- | |
| 46 | + 鼠标经过快进按钮时的提示,支持html | |
| 47 | + --> | |
| 48 | + <pr_fastr>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}快退{/font}</pr_fastr> | |
| 49 | + <!-- | |
| 50 | + 鼠标经过快退按钮时的提示,支持html | |
| 51 | + --> | |
| 52 | + <pr_time>{font color='#FFFFFF' face='Arial' size='16'}[$Time]{/font}</pr_time> | |
| 53 | + <!-- | |
| 54 | + 鼠标经过进度栏时提示当前点上时间的,[$Time]会被替换成时间,支持html | |
| 55 | + --> | |
| 56 | + <pr_volume>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}音量:[$Volume]%{/font}</pr_volume> | |
| 57 | + <!-- | |
| 58 | + 鼠标经过音量调节框或调整音量时提示,[$Volume]会自动替换音量值(0-100) | |
| 59 | + --> | |
| 60 | + <pr_clockwait>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}00:00 / 00:00{/font}</pr_clockwait> | |
| 61 | + <!-- | |
| 62 | + 在默认不加载视频,即m=1的时候,同时并没有设置视频的时间和字节,即o和w值的时候,pr_clock和pr_clock2里的所有内容被替换成这里设置的值 | |
| 63 | + --> | |
| 64 | + <pr_live>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}视频直播中{/font}</pr_live> | |
| 65 | + <!-- | |
| 66 | + 在直播的情况下显示的文字 | |
| 67 | + --> | |
| 68 | + <pr_adv>{font color='#FFFFFF' size='12' face='Microsoft YaHei,微软雅黑'}广告剩余:{font color='#FF0000' size='15' face='Arial'}{b}[$Second]{/b}{/font} 秒{/font}</pr_adv> | |
| 69 | + <!-- | |
| 70 | + 广告倒计时显示的内容,[$Second]将会显示倒计时的秒数 | |
| 71 | + --> | |
| 72 | + <pr_prompt>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}[$prompt]{/font}</pr_prompt> | |
| 73 | + <!-- | |
| 74 | + 提示点文字 | |
| 75 | + --> | |
| 76 | + <pr_cksetup>{font color='#FFFFFF' face='Microsoft YaHei,微软雅黑' size='14'}设置{/font}</pr_cksetup> | |
| 77 | + <!-- | |
| 78 | + 鼠标经过设置提示的文字(该定义为插件所用) | |
| 79 | + --> | |
| 80 | + </style> | |
| 81 | 81 | </ckplayer> |
| 82 | 82 | \ No newline at end of file | ... | ... |
src/main/webapp/static/assets/ckplayer_back/related.xml
| 1 | -<?xml version="1.0" encoding="utf-8"?> | |
| 2 | -<ckplayer> | |
| 3 | -<title>{font color="#FFDD00" face="Microsoft YaHei,微软雅黑" size="14"}精彩视频推荐{/font}</title> | |
| 4 | - <!--左上角的标题说明文字,支持html--> | |
| 5 | - <area>600,400,0xFFDD00,20</area> | |
| 6 | - <!-- | |
| 7 | - 该插件在播放中的区域控制 | |
| 8 | - 固定尺寸,精彩视频区域会固定大小并且保持剧中 | |
| 9 | - 1:宽 | |
| 10 | - 2:高 | |
| 11 | - 3:边框色 | |
| 12 | - 4:边框透明度 | |
| 13 | - --> | |
| 14 | - <image>120,90</image> | |
| 15 | - <!--图片的宽,高--> | |
| 16 | - <distance>150,175,100</distance> | |
| 17 | - <!-- | |
| 18 | - 1:横排图片之间的距离,前一个图片的左边到后一个图片的左边的距离 | |
| 19 | - 2:竖排图片之间距离,上一个图片的上边到下一个图片的上边距离,这里需要特别注意,因为图片显示区域是总区域-40的高度,默认的即<area>的高400-40=360,所以比如你的图片想一列显示二个,则该参数需要设置成360/2=180 | |
| 20 | - 3:文字距离图片上方的距离 | |
| 21 | - 只要设置好这三个参数,图片的位置就可以固定住了 | |
| 22 | - --> | |
| 23 | - <rep_title>{a href="[url]" target="_blank"}{font color="#FFFFFF" face="新宋体"}[title]{/font}{/a}</rep_title> | |
| 24 | - <!--标题替换规则--> | |
| 25 | - <style>a{color:#FFFFFF;}a:hover{color:#FF0000;}</style> | |
| 26 | - <!--文本样式--> | |
| 27 | - <size>120,42,3</size> | |
| 28 | - <!--文本的宽度,高度,行和行之间距离--> | |
| 29 | - <relatedlist> | |
| 30 | - <related> | |
| 31 | - <img>temp/1.jpg</img> | |
| 32 | - <url>http://www.ckplayer.com/</url> | |
| 33 | - <title>1:这里调用的文件配置在ckplayer/related.xml里</title> | |
| 34 | - </related> | |
| 35 | - <related> | |
| 36 | - <img>temp/2.jpg</img> | |
| 37 | - <url>http://www.ckplayer.com/</url> | |
| 38 | - <title>2:支持多页调用</title> | |
| 39 | - </related> | |
| 40 | - <related> | |
| 41 | - <img>temp/3.jpg</img> | |
| 42 | - <url>http://www.ckplayer.com/</url> | |
| 43 | - <title>3:文本请保持在二行,不能多于三行,多于三行将不显示</title> | |
| 44 | - </related> | |
| 45 | - <related> | |
| 46 | - <img>temp/4.jpg</img> | |
| 47 | - <url>http://www.ckplayer.com/</url> | |
| 48 | - <title>4:支持多行调用,多页调用</title> | |
| 49 | - </related> | |
| 50 | - <related> | |
| 51 | - <img>temp/5.jpg</img> | |
| 52 | - <url>http://www.ckplayer.com/</url> | |
| 53 | - <title>5:感谢对ckplayer的支持</title> | |
| 54 | - </related> | |
| 55 | - <related> | |
| 56 | - <img>temp/6.jpg</img> | |
| 57 | - <url>http://www.ckplayer.com/</url> | |
| 58 | - <title>6:最多两行,请不要超过二行</title> | |
| 59 | - </related> | |
| 60 | - <related> | |
| 61 | - <img>temp/3.jpg</img> | |
| 62 | - <url>http://www.ckplayer.com/</url> | |
| 63 | - <title>7:这里调用的文件配置在ckplayer/related.xml里</title> | |
| 64 | - </related> | |
| 65 | - <related> | |
| 66 | - <img>temp/5.jpg</img> | |
| 67 | - <url>http://www.ckplayer.com/</url> | |
| 68 | - <title>8:支持多页调用</title> | |
| 69 | - </related> | |
| 70 | - <related> | |
| 71 | - <img>temp/4.jpg</img> | |
| 72 | - <url>http://www.ckplayer.com/</url> | |
| 73 | - <title>9:文本请保持在二行,不能多于三行,多于三行将不显示</title> | |
| 74 | - </related> | |
| 75 | - <related> | |
| 76 | - <img>temp/1.jpg</img> | |
| 77 | - <url>http://www.ckplayer.com/</url> | |
| 78 | - <title>10:支持多行调用,多页调用</title> | |
| 79 | - </related> | |
| 80 | - <related> | |
| 81 | - <img>temp/2.jpg</img> | |
| 82 | - <url>http://www.ckplayer.com/</url> | |
| 83 | - <title>11:感谢对ckplayer的支持</title> | |
| 84 | - </related> | |
| 85 | - <related> | |
| 86 | - <img>temp/6.jpg</img> | |
| 87 | - <url>http://www.ckplayer.com/</url> | |
| 88 | - <title>12:最多两行,请不要超过二行</title> | |
| 89 | - </related> | |
| 90 | - <related> | |
| 91 | - <img>temp/5.jpg</img> | |
| 92 | - <url>http://www.ckplayer.com/</url> | |
| 93 | - <title>13:这里调用的文件配置在ckplayer/related.xml里</title> | |
| 94 | - </related> | |
| 95 | - <related> | |
| 96 | - <img>temp/4.jpg</img> | |
| 97 | - <url>http://www.ckplayer.com/</url> | |
| 98 | - <title>14:支持多页调用</title> | |
| 99 | - </related> | |
| 100 | - <related> | |
| 101 | - <img>temp/6.jpg</img> | |
| 102 | - <url>http://www.ckplayer.com/</url> | |
| 103 | - <title>15:文本请保持在二行,不能多于三行,多于三行将不显示</title> | |
| 104 | - </related> | |
| 105 | - <related> | |
| 106 | - <img>temp/3.jpg</img> | |
| 107 | - <url>http://www.ckplayer.com/</url> | |
| 108 | - <title>16:支持多行调用,多页调用</title> | |
| 109 | - </related> | |
| 110 | - <related> | |
| 111 | - <img>temp/1.jpg</img> | |
| 112 | - <url>http://www.ckplayer.com/</url> | |
| 113 | - <title>17:感谢对ckplayer的支持</title> | |
| 114 | - </related> | |
| 115 | - <related> | |
| 116 | - <img>temp/2.jpg</img> | |
| 117 | - <url>http://www.ckplayer.com/</url> | |
| 118 | - <title>18:最多两行,请不要超过二行</title> | |
| 119 | - </related> | |
| 120 | - </relatedlist> | |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<ckplayer> | |
| 3 | +<title>{font color="#FFDD00" face="Microsoft YaHei,微软雅黑" size="14"}精彩视频推荐{/font}</title> | |
| 4 | + <!--左上角的标题说明文字,支持html--> | |
| 5 | + <area>600,400,0xFFDD00,20</area> | |
| 6 | + <!-- | |
| 7 | + 该插件在播放中的区域控制 | |
| 8 | + 固定尺寸,精彩视频区域会固定大小并且保持剧中 | |
| 9 | + 1:宽 | |
| 10 | + 2:高 | |
| 11 | + 3:边框色 | |
| 12 | + 4:边框透明度 | |
| 13 | + --> | |
| 14 | + <image>120,90</image> | |
| 15 | + <!--图片的宽,高--> | |
| 16 | + <distance>150,175,100</distance> | |
| 17 | + <!-- | |
| 18 | + 1:横排图片之间的距离,前一个图片的左边到后一个图片的左边的距离 | |
| 19 | + 2:竖排图片之间距离,上一个图片的上边到下一个图片的上边距离,这里需要特别注意,因为图片显示区域是总区域-40的高度,默认的即<area>的高400-40=360,所以比如你的图片想一列显示二个,则该参数需要设置成360/2=180 | |
| 20 | + 3:文字距离图片上方的距离 | |
| 21 | + 只要设置好这三个参数,图片的位置就可以固定住了 | |
| 22 | + --> | |
| 23 | + <rep_title>{a href="[url]" target="_blank"}{font color="#FFFFFF" face="新宋体"}[title]{/font}{/a}</rep_title> | |
| 24 | + <!--标题替换规则--> | |
| 25 | + <style>a{color:#FFFFFF;}a:hover{color:#FF0000;}</style> | |
| 26 | + <!--文本样式--> | |
| 27 | + <size>120,42,3</size> | |
| 28 | + <!--文本的宽度,高度,行和行之间距离--> | |
| 29 | + <relatedlist> | |
| 30 | + <related> | |
| 31 | + <img>temp/1.jpg</img> | |
| 32 | + <url>http://www.ckplayer.com/</url> | |
| 33 | + <title>1:这里调用的文件配置在ckplayer/related.xml里</title> | |
| 34 | + </related> | |
| 35 | + <related> | |
| 36 | + <img>temp/2.jpg</img> | |
| 37 | + <url>http://www.ckplayer.com/</url> | |
| 38 | + <title>2:支持多页调用</title> | |
| 39 | + </related> | |
| 40 | + <related> | |
| 41 | + <img>temp/3.jpg</img> | |
| 42 | + <url>http://www.ckplayer.com/</url> | |
| 43 | + <title>3:文本请保持在二行,不能多于三行,多于三行将不显示</title> | |
| 44 | + </related> | |
| 45 | + <related> | |
| 46 | + <img>temp/4.jpg</img> | |
| 47 | + <url>http://www.ckplayer.com/</url> | |
| 48 | + <title>4:支持多行调用,多页调用</title> | |
| 49 | + </related> | |
| 50 | + <related> | |
| 51 | + <img>temp/5.jpg</img> | |
| 52 | + <url>http://www.ckplayer.com/</url> | |
| 53 | + <title>5:感谢对ckplayer的支持</title> | |
| 54 | + </related> | |
| 55 | + <related> | |
| 56 | + <img>temp/6.jpg</img> | |
| 57 | + <url>http://www.ckplayer.com/</url> | |
| 58 | + <title>6:最多两行,请不要超过二行</title> | |
| 59 | + </related> | |
| 60 | + <related> | |
| 61 | + <img>temp/3.jpg</img> | |
| 62 | + <url>http://www.ckplayer.com/</url> | |
| 63 | + <title>7:这里调用的文件配置在ckplayer/related.xml里</title> | |
| 64 | + </related> | |
| 65 | + <related> | |
| 66 | + <img>temp/5.jpg</img> | |
| 67 | + <url>http://www.ckplayer.com/</url> | |
| 68 | + <title>8:支持多页调用</title> | |
| 69 | + </related> | |
| 70 | + <related> | |
| 71 | + <img>temp/4.jpg</img> | |
| 72 | + <url>http://www.ckplayer.com/</url> | |
| 73 | + <title>9:文本请保持在二行,不能多于三行,多于三行将不显示</title> | |
| 74 | + </related> | |
| 75 | + <related> | |
| 76 | + <img>temp/1.jpg</img> | |
| 77 | + <url>http://www.ckplayer.com/</url> | |
| 78 | + <title>10:支持多行调用,多页调用</title> | |
| 79 | + </related> | |
| 80 | + <related> | |
| 81 | + <img>temp/2.jpg</img> | |
| 82 | + <url>http://www.ckplayer.com/</url> | |
| 83 | + <title>11:感谢对ckplayer的支持</title> | |
| 84 | + </related> | |
| 85 | + <related> | |
| 86 | + <img>temp/6.jpg</img> | |
| 87 | + <url>http://www.ckplayer.com/</url> | |
| 88 | + <title>12:最多两行,请不要超过二行</title> | |
| 89 | + </related> | |
| 90 | + <related> | |
| 91 | + <img>temp/5.jpg</img> | |
| 92 | + <url>http://www.ckplayer.com/</url> | |
| 93 | + <title>13:这里调用的文件配置在ckplayer/related.xml里</title> | |
| 94 | + </related> | |
| 95 | + <related> | |
| 96 | + <img>temp/4.jpg</img> | |
| 97 | + <url>http://www.ckplayer.com/</url> | |
| 98 | + <title>14:支持多页调用</title> | |
| 99 | + </related> | |
| 100 | + <related> | |
| 101 | + <img>temp/6.jpg</img> | |
| 102 | + <url>http://www.ckplayer.com/</url> | |
| 103 | + <title>15:文本请保持在二行,不能多于三行,多于三行将不显示</title> | |
| 104 | + </related> | |
| 105 | + <related> | |
| 106 | + <img>temp/3.jpg</img> | |
| 107 | + <url>http://www.ckplayer.com/</url> | |
| 108 | + <title>16:支持多行调用,多页调用</title> | |
| 109 | + </related> | |
| 110 | + <related> | |
| 111 | + <img>temp/1.jpg</img> | |
| 112 | + <url>http://www.ckplayer.com/</url> | |
| 113 | + <title>17:感谢对ckplayer的支持</title> | |
| 114 | + </related> | |
| 115 | + <related> | |
| 116 | + <img>temp/2.jpg</img> | |
| 117 | + <url>http://www.ckplayer.com/</url> | |
| 118 | + <title>18:最多两行,请不要超过二行</title> | |
| 119 | + </related> | |
| 120 | + </relatedlist> | |
| 121 | 121 | </ckplayer> |
| 122 | 122 | \ No newline at end of file | ... | ... |
src/main/webapp/static/assets/ckplayer_back/share.xml
| 1 | -<?xml version="1.0" encoding="utf-8"?> | |
| 2 | -<ckplayer> | |
| 3 | - <share_html> | |
| 4 | - {embed src="贵站网址,在ckplayer/share.xml里修改/ckplayer/ckplayer.swf" flashvars="[$share]" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" allowFullscreen="true" type="application/x-shockwave-flash"}{/embed} | |
| 5 | - </share_html> | |
| 6 | - <share_flash> | |
| 7 | - 贵站网址/ckplayer/ckplayer.swf?[$share] | |
| 8 | - </share_flash> | |
| 9 | - <share_flashvars> | |
| 10 | - f,my_url,my_pic,a | |
| 11 | - </share_flashvars> | |
| 12 | - <share_path>ckplayer/share/</share_path><!--分享图片的文件夹地址--> | |
| 13 | - <share_replace> | |
| 14 | - </share_replace> | |
| 15 | - <share_permit>0</share_permit><!--是否有视听许可证,默认0没有,1是有--> | |
| 16 | - <share_uuid> | |
| 17 | - c25cf02c-1705-412d-bd4b-77a10b380f08 | |
| 18 | - </share_uuid> | |
| 19 | - <share_button> | |
| 20 | - <share> | |
| 21 | - <id>qqmb</id> | |
| 22 | - <img>qq.png</img> | |
| 23 | - <coordinate>20,50</coordinate> | |
| 24 | - </share> | |
| 25 | - <share> | |
| 26 | - <id>sinaminiblog</id> | |
| 27 | - <img>sina.png</img> | |
| 28 | - <coordinate>101,50</coordinate> | |
| 29 | - </share> | |
| 30 | - <share> | |
| 31 | - <id>qzone</id> | |
| 32 | - <img>qzone.png</img> | |
| 33 | - <coordinate>182,50</coordinate> | |
| 34 | - </share> | |
| 35 | - <share> | |
| 36 | - <id>renren</id> | |
| 37 | - <img>rr.png</img> | |
| 38 | - <coordinate>263,50</coordinate> | |
| 39 | - </share> | |
| 40 | - <share> | |
| 41 | - <id>kaixin001</id> | |
| 42 | - <img>kaixin001.png</img> | |
| 43 | - <coordinate>20,85</coordinate> | |
| 44 | - </share> | |
| 45 | - <share> | |
| 46 | - <id>tianya</id> | |
| 47 | - <img>tianya.png</img> | |
| 48 | - <coordinate>101,85</coordinate> | |
| 49 | - </share> | |
| 50 | - <share> | |
| 51 | - <id>feixin</id> | |
| 52 | - <img>feixin.png</img> | |
| 53 | - <coordinate>182,85</coordinate> | |
| 54 | - </share> | |
| 55 | - <share> | |
| 56 | - <id>msn</id> | |
| 57 | - <img>msn.png</img> | |
| 58 | - <coordinate>263,85</coordinate> | |
| 59 | - </share> | |
| 60 | - </share_button> | |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<ckplayer> | |
| 3 | + <share_html> | |
| 4 | + {embed src="贵站网址,在ckplayer/share.xml里修改/ckplayer/ckplayer.swf" flashvars="[$share]" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" allowFullscreen="true" type="application/x-shockwave-flash"}{/embed} | |
| 5 | + </share_html> | |
| 6 | + <share_flash> | |
| 7 | + 贵站网址/ckplayer/ckplayer.swf?[$share] | |
| 8 | + </share_flash> | |
| 9 | + <share_flashvars> | |
| 10 | + f,my_url,my_pic,a | |
| 11 | + </share_flashvars> | |
| 12 | + <share_path>ckplayer/share/</share_path><!--分享图片的文件夹地址--> | |
| 13 | + <share_replace> | |
| 14 | + </share_replace> | |
| 15 | + <share_permit>0</share_permit><!--是否有视听许可证,默认0没有,1是有--> | |
| 16 | + <share_uuid> | |
| 17 | + c25cf02c-1705-412d-bd4b-77a10b380f08 | |
| 18 | + </share_uuid> | |
| 19 | + <share_button> | |
| 20 | + <share> | |
| 21 | + <id>qqmb</id> | |
| 22 | + <img>qq.png</img> | |
| 23 | + <coordinate>20,50</coordinate> | |
| 24 | + </share> | |
| 25 | + <share> | |
| 26 | + <id>sinaminiblog</id> | |
| 27 | + <img>sina.png</img> | |
| 28 | + <coordinate>101,50</coordinate> | |
| 29 | + </share> | |
| 30 | + <share> | |
| 31 | + <id>qzone</id> | |
| 32 | + <img>qzone.png</img> | |
| 33 | + <coordinate>182,50</coordinate> | |
| 34 | + </share> | |
| 35 | + <share> | |
| 36 | + <id>renren</id> | |
| 37 | + <img>rr.png</img> | |
| 38 | + <coordinate>263,50</coordinate> | |
| 39 | + </share> | |
| 40 | + <share> | |
| 41 | + <id>kaixin001</id> | |
| 42 | + <img>kaixin001.png</img> | |
| 43 | + <coordinate>20,85</coordinate> | |
| 44 | + </share> | |
| 45 | + <share> | |
| 46 | + <id>tianya</id> | |
| 47 | + <img>tianya.png</img> | |
| 48 | + <coordinate>101,85</coordinate> | |
| 49 | + </share> | |
| 50 | + <share> | |
| 51 | + <id>feixin</id> | |
| 52 | + <img>feixin.png</img> | |
| 53 | + <coordinate>182,85</coordinate> | |
| 54 | + </share> | |
| 55 | + <share> | |
| 56 | + <id>msn</id> | |
| 57 | + <img>msn.png</img> | |
| 58 | + <coordinate>263,85</coordinate> | |
| 59 | + </share> | |
| 60 | + </share_button> | |
| 61 | 61 | </ckplayer> |
| 62 | 62 | \ No newline at end of file | ... | ... |
src/main/webapp/static/assets/cnlive/js/common.js
| 1 | -/** | |
| 2 | - * | |
| 3 | - * 自主 公共 js 方法 | |
| 4 | - */ | |
| 5 | -// 下一页 | |
| 6 | -function next_page(pageNum) { | |
| 7 | - window.location.href = "" + pageNum; | |
| 8 | -} | |
| 9 | - | |
| 10 | -// 提示 | |
| 11 | -function showTip(succ) { | |
| 12 | - if (succ) { | |
| 13 | - $("#info_tab_span").show(); | |
| 14 | - $("#info_tab").html("操作成功"); | |
| 15 | - } else { | |
| 16 | - $("#info_tab_span").show(); | |
| 17 | - $("#info_tab").html("操作失败!"); | |
| 18 | - } | |
| 19 | -} | |
| 20 | - | |
| 21 | -function showTipWidthMsg(succ, msg) { | |
| 22 | - if (succ) { | |
| 23 | - $("#info_tab_span").show(); | |
| 24 | - $("#info_tab_span").html(msg); | |
| 25 | - } else { | |
| 26 | - $("#info_tab_span").hide(); | |
| 27 | - } | |
| 28 | -} | |
| 29 | - | |
| 30 | -$.format = function(source, params) { | |
| 31 | - if (arguments.length == 1) | |
| 32 | - return function() { | |
| 33 | - var args = $.makeArray(arguments); | |
| 34 | - args.unshift(source); | |
| 35 | - return $.format.apply(this, args); | |
| 36 | - }; | |
| 37 | - if (arguments.length > 2 && params.constructor != Array) { | |
| 38 | - params = $.makeArray(arguments).slice(1); | |
| 39 | - } | |
| 40 | - if (params.constructor != Array) { | |
| 41 | - params = [ params ]; | |
| 42 | - } | |
| 43 | - $.each(params, function(i, n) { | |
| 44 | - source = source.replace(new RegExp("\\{" + i + "\\}", "g"), n); | |
| 45 | - }); | |
| 46 | - return source; | |
| 47 | -}; | |
| 48 | - | |
| 49 | - | |
| 50 | -Date.prototype.format = function(format) { | |
| 51 | - var o = { | |
| 52 | - "M+": this.getMonth() + 1, //month | |
| 53 | - "d+": this.getDate(), //day | |
| 54 | - "h+": this.getHours(), //hour | |
| 55 | - "m+": this.getMinutes(), //minute | |
| 56 | - "s+": this.getSeconds(), //second | |
| 57 | - "q+": Math.floor((this.getMonth() + 3) / 3), //quarter | |
| 58 | - "S": this.getMilliseconds() //millisecond | |
| 59 | - } | |
| 60 | - if (/(y+)/.test(format)) format = format.replace(RegExp.$1, | |
| 61 | -(this.getFullYear() + "").substr(4 - RegExp.$1.length)); | |
| 62 | - for (var k in o) if (new RegExp("(" + k + ")").test(format)) | |
| 63 | - format = format.replace(RegExp.$1, | |
| 64 | -RegExp.$1.length == 1 ? o[k] : | |
| 65 | - ("00" + o[k]).substr(("" + o[k]).length)); | |
| 66 | - return format; | |
| 67 | -} | |
| 1 | +/** | |
| 2 | + * | |
| 3 | + * 自主 公共 js 方法 | |
| 4 | + */ | |
| 5 | +// 下一页 | |
| 6 | +function next_page(pageNum) { | |
| 7 | + window.location.href = "" + pageNum; | |
| 8 | +} | |
| 9 | + | |
| 10 | +// 提示 | |
| 11 | +function showTip(succ) { | |
| 12 | + if (succ) { | |
| 13 | + $("#info_tab_span").show(); | |
| 14 | + $("#info_tab").html("操作成功"); | |
| 15 | + } else { | |
| 16 | + $("#info_tab_span").show(); | |
| 17 | + $("#info_tab").html("操作失败!"); | |
| 18 | + } | |
| 19 | +} | |
| 20 | + | |
| 21 | +function showTipWidthMsg(succ, msg) { | |
| 22 | + if (succ) { | |
| 23 | + $("#info_tab_span").show(); | |
| 24 | + $("#info_tab_span").html(msg); | |
| 25 | + } else { | |
| 26 | + $("#info_tab_span").hide(); | |
| 27 | + } | |
| 28 | +} | |
| 29 | + | |
| 30 | +$.format = function(source, params) { | |
| 31 | + if (arguments.length == 1) | |
| 32 | + return function() { | |
| 33 | + var args = $.makeArray(arguments); | |
| 34 | + args.unshift(source); | |
| 35 | + return $.format.apply(this, args); | |
| 36 | + }; | |
| 37 | + if (arguments.length > 2 && params.constructor != Array) { | |
| 38 | + params = $.makeArray(arguments).slice(1); | |
| 39 | + } | |
| 40 | + if (params.constructor != Array) { | |
| 41 | + params = [ params ]; | |
| 42 | + } | |
| 43 | + $.each(params, function(i, n) { | |
| 44 | + source = source.replace(new RegExp("\\{" + i + "\\}", "g"), n); | |
| 45 | + }); | |
| 46 | + return source; | |
| 47 | +}; | |
| 48 | + | |
| 49 | + | |
| 50 | +Date.prototype.format = function(format) { | |
| 51 | + var o = { | |
| 52 | + "M+": this.getMonth() + 1, //month | |
| 53 | + "d+": this.getDate(), //day | |
| 54 | + "h+": this.getHours(), //hour | |
| 55 | + "m+": this.getMinutes(), //minute | |
| 56 | + "s+": this.getSeconds(), //second | |
| 57 | + "q+": Math.floor((this.getMonth() + 3) / 3), //quarter | |
| 58 | + "S": this.getMilliseconds() //millisecond | |
| 59 | + } | |
| 60 | + if (/(y+)/.test(format)) format = format.replace(RegExp.$1, | |
| 61 | +(this.getFullYear() + "").substr(4 - RegExp.$1.length)); | |
| 62 | + for (var k in o) if (new RegExp("(" + k + ")").test(format)) | |
| 63 | + format = format.replace(RegExp.$1, | |
| 64 | +RegExp.$1.length == 1 ? o[k] : | |
| 65 | + ("00" + o[k]).substr(("" + o[k]).length)); | |
| 66 | + return format; | |
| 67 | +} | ... | ... |
src/main/webapp/static/assets/cnlive/js/global.js
| 1 | -var BASE; // Context Path(在 script.jsp 中初始化) | |
| 2 | -function next_page(pageNum){ | |
| 3 | - window.location.href = "" + pageNum+window.location.search; | |
| 4 | -} | |
| 5 | -var Smart = { | |
| 6 | - /* -------------------------------------------------- 函数 -------------------------------------------------- */ | |
| 7 | - Validator: { | |
| 8 | - checkRequired: function(formId) { | |
| 9 | - var result = true; | |
| 10 | - $('#' + formId + ' .ext-required') | |
| 11 | - .each(function() { | |
| 12 | - var value = $.trim($(this).val()); | |
| 13 | - var tagName = this.tagName; | |
| 14 | - if (tagName == 'INPUT' || tagName == 'TEXTAREA') { | |
| 15 | - if (value == '') { | |
| 16 | - $(this).addClass('css-error'); | |
| 17 | - result = false; | |
| 18 | - } else { | |
| 19 | - $(this).removeClass('css-error'); | |
| 20 | - } | |
| 21 | - } else if (tagName == 'SELECT') { | |
| 22 | - if (value == '' || value == 0) { | |
| 23 | - $(this).addClass('css-error'); | |
| 24 | - result = false; | |
| 25 | - } else { | |
| 26 | - $(this).removeClass('css-error'); | |
| 27 | - } | |
| 28 | - } | |
| 29 | - }) | |
| 30 | - .change(function() { | |
| 31 | - var value = $.trim($(this).val()); | |
| 32 | - var tagName = this.tagName; | |
| 33 | - if (tagName == 'INPUT' || tagName == 'TEXTAREA') { | |
| 34 | - if (value != '') { | |
| 35 | - $(this).removeClass('css-error'); | |
| 36 | - } else { | |
| 37 | - $(this).addClass('css-error'); | |
| 38 | - } | |
| 39 | - } else if (tagName == 'SELECT') { | |
| 40 | - if (value != '' && value != 0) { | |
| 41 | - $(this).removeClass('css-error'); | |
| 42 | - } else { | |
| 43 | - $(this).addClass('css-error'); | |
| 44 | - } | |
| 45 | - } | |
| 46 | - }); | |
| 47 | - return result; | |
| 48 | - } | |
| 49 | - }, | |
| 50 | - Cookie: { | |
| 51 | - put: function(key, value) { | |
| 52 | - $.cookie(key, value, {path: '/', expires: 365}); | |
| 53 | - }, | |
| 54 | - get: function(key) { | |
| 55 | - return $.cookie(key); | |
| 56 | - } | |
| 57 | - }, | |
| 58 | - render: function(template, data) { | |
| 59 | - return template.replace(/\{([\w\.]*)\}/g, function(str, key) { | |
| 60 | - var keys = key.split('.'); | |
| 61 | - var value = data[keys.shift()]; | |
| 62 | - for (var i = 0, l = keys.length; i < l; i++) { | |
| 63 | - value = value[keys[i]]; | |
| 64 | - } | |
| 65 | - return (typeof value !== 'undefined' && value !== null) ? value : ''; | |
| 66 | - }); | |
| 67 | - }, | |
| 68 | - i18n: function() { | |
| 69 | - var args = arguments; | |
| 70 | - var code = args[0]; | |
| 71 | - var text = window['I18N'][code]; | |
| 72 | - if (text) { | |
| 73 | - if (args.length > 0) { | |
| 74 | - text = text.replace(/\{(\d+)\}/g, function(m, i) { | |
| 75 | - return args[parseInt(i) + 1]; | |
| 76 | - }); | |
| 77 | - } | |
| 78 | - return text; | |
| 79 | - } else { | |
| 80 | - return code; | |
| 81 | - } | |
| 82 | - }, | |
| 83 | - timestamp: function() { | |
| 84 | - return new Date().getTime(); | |
| 85 | - }, | |
| 86 | - /* -------------------------------------------------- 组件 -------------------------------------------------- */ | |
| 87 | - Pager: function(pagerId, onChangePageNumber, onChangePageSize) { | |
| 88 | - var $pager = $('#' + pagerId); | |
| 89 | - // 初始化 | |
| 90 | - (function() { | |
| 91 | - // 点击翻页按钮 | |
| 92 | - $(document).on('click', '#' + pagerId + ' .ext-pager-button button', function() { | |
| 93 | - onChangePageNumber($(this).data('pn')); | |
| 94 | - }); | |
| 95 | - // 点击并切换页面编号 | |
| 96 | - var pageNumberInput = '#' + pagerId + ' .ext-pager-pn'; | |
| 97 | - $(document) | |
| 98 | - .on('click', pageNumberInput, function() { | |
| 99 | - $(this).select(); | |
| 100 | - }) | |
| 101 | - .on('keydown', pageNumberInput, function(event) { | |
| 102 | - if (event.keyCode == '13') { | |
| 103 | - var pageNumber = $(this).val(); | |
| 104 | - var totalPage = parseInt($pager.find('.ext-pager-tp').text()); | |
| 105 | - if (isNaN(pageNumber) || pageNumber <= 0 || pageNumber > totalPage) { | |
| 106 | - alert(Smart.i18n('common.pager.input_error')); | |
| 107 | - $(this).select(); | |
| 108 | - return; | |
| 109 | - } | |
| 110 | - onChangePageNumber(pageNumber); | |
| 111 | - } | |
| 112 | - }); | |
| 113 | - // 点击并切换每页条数 | |
| 114 | - var pageSizeInput = '#' + pagerId + ' .ext-pager-ps'; | |
| 115 | - alert(pageSizeInput); | |
| 116 | - $(document) | |
| 117 | - .on('click', pageSizeInput, function() { | |
| 118 | - $(this).select(); | |
| 119 | - }) | |
| 120 | - .on('keydown', pageSizeInput, function(event) { | |
| 121 | - if (event.keyCode == '13') { | |
| 122 | - var pageSize = $(this).val(); | |
| 123 | - if (isNaN(pageSize) || pageSize <= 0) { | |
| 124 | - alert(Smart.i18n('common.pager.input_error')); | |
| 125 | - $(this).select(); | |
| 126 | - return; | |
| 127 | - } | |
| 128 | - onChangePageSize(pageSize); | |
| 129 | - Smart.Cookie.put('cookie_ps_' + pagerId, pageSize); | |
| 130 | - } | |
| 131 | - }); | |
| 132 | - })(); | |
| 133 | - // 获取页面编号 | |
| 134 | - this.getPageNumber = function() { | |
| 135 | - return $pager.find('.ext-pager-pn').val(); | |
| 136 | - }; | |
| 137 | - // 获取每页条数 | |
| 138 | - this.getPageSize = function() { | |
| 139 | - return $pager.find('.ext-pager-ps').val(); | |
| 140 | - }; | |
| 141 | - } | |
| 142 | -}; | |
| 143 | - | |
| 144 | -$(function() { | |
| 145 | - // 忽略空链接 | |
| 146 | - $('a[href="#"]').click(function() { | |
| 147 | - return false; | |
| 148 | - }); | |
| 149 | - | |
| 150 | - // 设置 form 默认为 post 类型 | |
| 151 | - // $('form').attr('method', 'post'); | |
| 152 | - | |
| 153 | - // 全局 AJAX 设置 | |
| 154 | - $.ajaxSetup({ | |
| 155 | - cache: true, | |
| 156 | - error: function(jqXHR, textStatus, errorThrown) { | |
| 157 | - switch (jqXHR.status) { | |
| 158 | - case 403: | |
| 159 | - document.write(''); | |
| 160 | - location.href = BASE + '/'; | |
| 161 | - break; | |
| 162 | - case 500: | |
| 163 | - alert(Smart.i18n('error.page.500')); | |
| 164 | - break; | |
| 165 | - case 503: | |
| 166 | - alert(errorThrown); | |
| 167 | - break; | |
| 168 | - } | |
| 169 | - } | |
| 170 | - }); | |
| 171 | - | |
| 172 | - // 切换系统语言 | |
| 173 | - $('#language').find('a').click(function() { | |
| 174 | - var language = $(this).data('value'); | |
| 175 | - Smart.Cookie.put('cookie_language', language); | |
| 176 | - location.reload(); | |
| 177 | - }); | |
| 178 | - | |
| 179 | - // 绑定注销事件 | |
| 180 | - $('#logout').click(function() { | |
| 181 | - if (confirm(Smart.i18n('common.logout_confirm'))) { | |
| 182 | - $.ajax({ | |
| 183 | - type: 'get', | |
| 184 | - url: BASE + '/logout', | |
| 185 | - success: function(result) { | |
| 186 | - if (result.success) { | |
| 187 | - location.href = BASE + '/'; | |
| 188 | - } | |
| 189 | - } | |
| 190 | - }); | |
| 191 | - } | |
| 192 | - }); | |
| 193 | - | |
| 194 | - // 绑定验证码单击事件 | |
| 195 | - $('.ext-captcha').click(function() { | |
| 196 | - var url = $(this).attr('src'); | |
| 197 | - var index = url.indexOf('?'); | |
| 198 | - if (index != -1) { | |
| 199 | - url = url.substring(0, index); | |
| 200 | - } | |
| 201 | - url = url + '?_=' + Smart.timestamp(); | |
| 202 | - $(this).attr('src', url); | |
| 203 | - }); | |
| 1 | +var BASE; // Context Path(在 script.jsp 中初始化) | |
| 2 | +function next_page(pageNum){ | |
| 3 | + window.location.href = "" + pageNum+window.location.search; | |
| 4 | +} | |
| 5 | +var Smart = { | |
| 6 | + /* -------------------------------------------------- 函数 -------------------------------------------------- */ | |
| 7 | + Validator: { | |
| 8 | + checkRequired: function(formId) { | |
| 9 | + var result = true; | |
| 10 | + $('#' + formId + ' .ext-required') | |
| 11 | + .each(function() { | |
| 12 | + var value = $.trim($(this).val()); | |
| 13 | + var tagName = this.tagName; | |
| 14 | + if (tagName == 'INPUT' || tagName == 'TEXTAREA') { | |
| 15 | + if (value == '') { | |
| 16 | + $(this).addClass('css-error'); | |
| 17 | + result = false; | |
| 18 | + } else { | |
| 19 | + $(this).removeClass('css-error'); | |
| 20 | + } | |
| 21 | + } else if (tagName == 'SELECT') { | |
| 22 | + if (value == '' || value == 0) { | |
| 23 | + $(this).addClass('css-error'); | |
| 24 | + result = false; | |
| 25 | + } else { | |
| 26 | + $(this).removeClass('css-error'); | |
| 27 | + } | |
| 28 | + } | |
| 29 | + }) | |
| 30 | + .change(function() { | |
| 31 | + var value = $.trim($(this).val()); | |
| 32 | + var tagName = this.tagName; | |
| 33 | + if (tagName == 'INPUT' || tagName == 'TEXTAREA') { | |
| 34 | + if (value != '') { | |
| 35 | + $(this).removeClass('css-error'); | |
| 36 | + } else { | |
| 37 | + $(this).addClass('css-error'); | |
| 38 | + } | |
| 39 | + } else if (tagName == 'SELECT') { | |
| 40 | + if (value != '' && value != 0) { | |
| 41 | + $(this).removeClass('css-error'); | |
| 42 | + } else { | |
| 43 | + $(this).addClass('css-error'); | |
| 44 | + } | |
| 45 | + } | |
| 46 | + }); | |
| 47 | + return result; | |
| 48 | + } | |
| 49 | + }, | |
| 50 | + Cookie: { | |
| 51 | + put: function(key, value) { | |
| 52 | + $.cookie(key, value, {path: '/', expires: 365}); | |
| 53 | + }, | |
| 54 | + get: function(key) { | |
| 55 | + return $.cookie(key); | |
| 56 | + } | |
| 57 | + }, | |
| 58 | + render: function(template, data) { | |
| 59 | + return template.replace(/\{([\w\.]*)\}/g, function(str, key) { | |
| 60 | + var keys = key.split('.'); | |
| 61 | + var value = data[keys.shift()]; | |
| 62 | + for (var i = 0, l = keys.length; i < l; i++) { | |
| 63 | + value = value[keys[i]]; | |
| 64 | + } | |
| 65 | + return (typeof value !== 'undefined' && value !== null) ? value : ''; | |
| 66 | + }); | |
| 67 | + }, | |
| 68 | + i18n: function() { | |
| 69 | + var args = arguments; | |
| 70 | + var code = args[0]; | |
| 71 | + var text = window['I18N'][code]; | |
| 72 | + if (text) { | |
| 73 | + if (args.length > 0) { | |
| 74 | + text = text.replace(/\{(\d+)\}/g, function(m, i) { | |
| 75 | + return args[parseInt(i) + 1]; | |
| 76 | + }); | |
| 77 | + } | |
| 78 | + return text; | |
| 79 | + } else { | |
| 80 | + return code; | |
| 81 | + } | |
| 82 | + }, | |
| 83 | + timestamp: function() { | |
| 84 | + return new Date().getTime(); | |
| 85 | + }, | |
| 86 | + /* -------------------------------------------------- 组件 -------------------------------------------------- */ | |
| 87 | + Pager: function(pagerId, onChangePageNumber, onChangePageSize) { | |
| 88 | + var $pager = $('#' + pagerId); | |
| 89 | + // 初始化 | |
| 90 | + (function() { | |
| 91 | + // 点击翻页按钮 | |
| 92 | + $(document).on('click', '#' + pagerId + ' .ext-pager-button button', function() { | |
| 93 | + onChangePageNumber($(this).data('pn')); | |
| 94 | + }); | |
| 95 | + // 点击并切换页面编号 | |
| 96 | + var pageNumberInput = '#' + pagerId + ' .ext-pager-pn'; | |
| 97 | + $(document) | |
| 98 | + .on('click', pageNumberInput, function() { | |
| 99 | + $(this).select(); | |
| 100 | + }) | |
| 101 | + .on('keydown', pageNumberInput, function(event) { | |
| 102 | + if (event.keyCode == '13') { | |
| 103 | + var pageNumber = $(this).val(); | |
| 104 | + var totalPage = parseInt($pager.find('.ext-pager-tp').text()); | |
| 105 | + if (isNaN(pageNumber) || pageNumber <= 0 || pageNumber > totalPage) { | |
| 106 | + alert(Smart.i18n('common.pager.input_error')); | |
| 107 | + $(this).select(); | |
| 108 | + return; | |
| 109 | + } | |
| 110 | + onChangePageNumber(pageNumber); | |
| 111 | + } | |
| 112 | + }); | |
| 113 | + // 点击并切换每页条数 | |
| 114 | + var pageSizeInput = '#' + pagerId + ' .ext-pager-ps'; | |
| 115 | + alert(pageSizeInput); | |
| 116 | + $(document) | |
| 117 | + .on('click', pageSizeInput, function() { | |
| 118 | + $(this).select(); | |
| 119 | + }) | |
| 120 | + .on('keydown', pageSizeInput, function(event) { | |
| 121 | + if (event.keyCode == '13') { | |
| 122 | + var pageSize = $(this).val(); | |
| 123 | + if (isNaN(pageSize) || pageSize <= 0) { | |
| 124 | + alert(Smart.i18n('common.pager.input_error')); | |
| 125 | + $(this).select(); | |
| 126 | + return; | |
| 127 | + } | |
| 128 | + onChangePageSize(pageSize); | |
| 129 | + Smart.Cookie.put('cookie_ps_' + pagerId, pageSize); | |
| 130 | + } | |
| 131 | + }); | |
| 132 | + })(); | |
| 133 | + // 获取页面编号 | |
| 134 | + this.getPageNumber = function() { | |
| 135 | + return $pager.find('.ext-pager-pn').val(); | |
| 136 | + }; | |
| 137 | + // 获取每页条数 | |
| 138 | + this.getPageSize = function() { | |
| 139 | + return $pager.find('.ext-pager-ps').val(); | |
| 140 | + }; | |
| 141 | + } | |
| 142 | +}; | |
| 143 | + | |
| 144 | +$(function() { | |
| 145 | + // 忽略空链接 | |
| 146 | + $('a[href="#"]').click(function() { | |
| 147 | + return false; | |
| 148 | + }); | |
| 149 | + | |
| 150 | + // 设置 form 默认为 post 类型 | |
| 151 | + // $('form').attr('method', 'post'); | |
| 152 | + | |
| 153 | + // 全局 AJAX 设置 | |
| 154 | + $.ajaxSetup({ | |
| 155 | + cache: true, | |
| 156 | + error: function(jqXHR, textStatus, errorThrown) { | |
| 157 | + switch (jqXHR.status) { | |
| 158 | + case 403: | |
| 159 | + document.write(''); | |
| 160 | + location.href = BASE + '/'; | |
| 161 | + break; | |
| 162 | + case 500: | |
| 163 | + alert(Smart.i18n('error.page.500')); | |
| 164 | + break; | |
| 165 | + case 503: | |
| 166 | + alert(errorThrown); | |
| 167 | + break; | |
| 168 | + } | |
| 169 | + } | |
| 170 | + }); | |
| 171 | + | |
| 172 | + // 切换系统语言 | |
| 173 | + $('#language').find('a').click(function() { | |
| 174 | + var language = $(this).data('value'); | |
| 175 | + Smart.Cookie.put('cookie_language', language); | |
| 176 | + location.reload(); | |
| 177 | + }); | |
| 178 | + | |
| 179 | + // 绑定注销事件 | |
| 180 | + $('#logout').click(function() { | |
| 181 | + if (confirm(Smart.i18n('common.logout_confirm'))) { | |
| 182 | + $.ajax({ | |
| 183 | + type: 'get', | |
| 184 | + url: BASE + '/logout', | |
| 185 | + success: function(result) { | |
| 186 | + if (result.success) { | |
| 187 | + location.href = BASE + '/'; | |
| 188 | + } | |
| 189 | + } | |
| 190 | + }); | |
| 191 | + } | |
| 192 | + }); | |
| 193 | + | |
| 194 | + // 绑定验证码单击事件 | |
| 195 | + $('.ext-captcha').click(function() { | |
| 196 | + var url = $(this).attr('src'); | |
| 197 | + var index = url.indexOf('?'); | |
| 198 | + if (index != -1) { | |
| 199 | + url = url.substring(0, index); | |
| 200 | + } | |
| 201 | + url = url + '?_=' + Smart.timestamp(); | |
| 202 | + $(this).attr('src', url); | |
| 203 | + }); | |
| 204 | 204 | }); |
| 205 | 205 | \ No newline at end of file | ... | ... |
src/main/webapp/static/assets/cnlive/js/live.js
| 1 | -function toSubmit(){ | |
| 2 | - $("#activityForm").submit(); | |
| 3 | -} | |
| 4 | - | |
| 5 | -//修改直播开始结束时间 | |
| 6 | -function update_activity_time(){ | |
| 7 | - var start_time= $('#start_time').val(); | |
| 8 | - var end_time= $('#end_time').val(); | |
| 9 | - var id=$('#activity_id').val(); | |
| 10 | - $.ajax({ | |
| 11 | - url : BASE+'/activity/update/time/', | |
| 12 | - type : 'post', | |
| 13 | - async : true, | |
| 14 | - error : function() { | |
| 15 | - alert("请求错误"); | |
| 16 | - console.log(XMLHttpRequest.status); | |
| 17 | - console.log(XMLHttpRequest.readyState); | |
| 18 | - }, | |
| 19 | - data : { | |
| 20 | - id :id, | |
| 21 | - start_time :start_time, | |
| 22 | - end_time:end_time | |
| 23 | - }, | |
| 24 | - success : function(data) { | |
| 25 | - $("#update_time_btn").html("保存成功"); | |
| 26 | - $("#update_time_btn").attr("disabled", true); | |
| 27 | - } | |
| 28 | - }); | |
| 29 | -} | |
| 30 | - | |
| 31 | -function preload_wowza(id){ | |
| 32 | - window.location.href=BASE+ "/activity/preloadWowza/"+id; | |
| 33 | -} | |
| 34 | -function t_live_edit(id){ | |
| 35 | - window.location.href=BASE+ "/live/edit/"+id; | |
| 36 | -} | |
| 37 | - | |
| 38 | - | |
| 39 | -function to_step_before(id){ | |
| 40 | - window.location.href=BASE+ "/activity/stepBefore/"+id; | |
| 41 | -} | |
| 42 | - | |
| 43 | -function to_step_in(id){ | |
| 44 | - window.location.href=BASE+ "/activity/stepIn/"+id; | |
| 45 | -} | |
| 46 | - | |
| 47 | -function to_step_after(id){ | |
| 48 | - window.location.href=BASE+ "/activity/stepAfter/"+id; | |
| 49 | -} | |
| 50 | - | |
| 51 | -function show_time_div(){ | |
| 52 | - var state =$("#eidt_time_li").css('display'); | |
| 53 | - if (state=='none') { | |
| 54 | - $("#eidt_time_li").show(); | |
| 55 | - }else{ | |
| 56 | - $("#eidt_time_li").hide(); | |
| 57 | - } | |
| 58 | -} | |
| 59 | - | |
| 60 | -function to_stop(id){ | |
| 61 | - $("#reset_btn").html("后台处理中..."); | |
| 62 | - $("#reset_btn").attr("disabled", "disabled"); | |
| 63 | - $.ajax({ | |
| 64 | - url : BASE+'/activity/stop/'+id, | |
| 65 | - type : 'get', | |
| 66 | - datatype : "json", | |
| 67 | - async : true, | |
| 68 | - error : function() { | |
| 69 | - alert("请求错误"); | |
| 70 | - console.log(XMLHttpRequest.status); | |
| 71 | - $("#reset_btn").html("复位中..."); | |
| 72 | - }, | |
| 73 | - success : function(data) { | |
| 74 | - if (data.success) { | |
| 75 | - $("#reset_btn").html("信号已复位"); | |
| 76 | - $("#publish_div").html(""); | |
| 77 | - 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>'; | |
| 78 | - $("#publish_div").html(""); | |
| 79 | - }else{ | |
| 80 | - $("#reset_btn").html("信号复位失败,或者活动已经结束"); | |
| 81 | - } | |
| 82 | - } | |
| 83 | - }); | |
| 84 | - | |
| 85 | -} | |
| 86 | -//获取tree 所选值 | |
| 87 | -//function select_wowza_signal(){ | |
| 88 | -// var tree_node=$(".easy-tree").find('li.li_selected'); | |
| 89 | -// var id=tree_node.attr('id'); | |
| 90 | -// $("#t_wowza_stream_id_tip").val(tree_node.text()); | |
| 91 | -// $("#t_wowza_stream_id").val(id); | |
| 92 | -// $("#wowza_modal").modal('hide'); | |
| 93 | -//} | |
| 94 | - | |
| 95 | -function copy_name(){ | |
| 96 | - var name=$('#name').val(); | |
| 97 | - $('#epg_name').val(name); | |
| 98 | -} | |
| 99 | - | |
| 100 | - | |
| 101 | -function save_confirm(){ | |
| 102 | - var start_time= $('#start_time').val(); | |
| 103 | - console.log(start_time); | |
| 104 | - var t_wowza_stream_id_tip=$("#t_wowza_stream_id_tip").val(); | |
| 105 | - var channel_names=""; | |
| 106 | - $("input[name='channel_id']:checked").each(function(){ | |
| 107 | - channel_names+=$(this).attr("title")+" 、"; | |
| 108 | - }) | |
| 109 | - 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>"; | |
| 110 | - $("#tip_message").html(html); | |
| 111 | - $("#save_confirm_modal").modal({backdrop: 'static', keyboard: false}); | |
| 112 | -} | |
| 113 | - | |
| 114 | - | |
| 115 | - | |
| 116 | - | |
| 117 | -function t_activity_save_or_update(id){ | |
| 118 | - $("#t_activity_save_btn").html("后台处理中..."); | |
| 119 | - //$("#t_activity_save_btn").attr("disabled", "disabled"); | |
| 120 | - var is_free; | |
| 121 | - $("input[name='is_free']:checked").each(function() { | |
| 122 | - is_free = this.value; | |
| 123 | - }); | |
| 124 | - var is_playback; | |
| 125 | - $("input[name='is_playback']:checked").each(function() { | |
| 126 | - is_playback = this.value; | |
| 127 | - }); | |
| 128 | - | |
| 129 | - var logo; | |
| 130 | - $("input[name='logo']:checked").each(function() { | |
| 131 | - logo = this.value; | |
| 132 | - }); | |
| 133 | - | |
| 134 | - var channel_ids=""; | |
| 135 | - $("input[name='channel_id']:checked").each(function(){ | |
| 136 | - channel_ids+=$(this).val()+","; | |
| 137 | - }) | |
| 138 | - var is_main= $('#is_main').val(); | |
| 139 | - var t_activity = new Object(); | |
| 140 | - t_activity.name = $('#name').val(); | |
| 141 | - t_activity.epg_name = $('#epg_name').val(); | |
| 142 | - t_activity.description = $('#description').val(); | |
| 143 | - t_activity.place = $('#place').val(); | |
| 144 | - t_activity.start_time = $('#start_time').val(); | |
| 145 | - t_activity.end_time = $('#end_time').val(); | |
| 146 | - t_activity.contact_user =$('#contact_user').val(); | |
| 147 | - t_activity.v_count = $('#v_count').val(); | |
| 148 | - t_activity.is_free=is_free; | |
| 149 | - t_activity.t_default_video_id=$("#t_default_video_id option:selected").val(); | |
| 150 | - t_activity.is_playback=is_playback; | |
| 151 | - t_activity.logo=logo; | |
| 152 | - t_activity.uuid= $('#uuid').val(); | |
| 153 | - t_activity.notify_user=$('#notify_user').val(); | |
| 154 | - t_activity.chatroom_id=$('#chatroom_id').val(); | |
| 155 | - var json = JSON.stringify(t_activity); | |
| 156 | - $.ajax({ | |
| 157 | - url : BASE+'/activity/add', | |
| 158 | - type : 'post', | |
| 159 | - datatype : "json", | |
| 160 | - data : { | |
| 161 | - id :id, | |
| 162 | - json :json, | |
| 163 | - is_main:is_main, | |
| 164 | - channel_ids:channel_ids | |
| 165 | - }, | |
| 166 | - async : true, | |
| 167 | - error : function() { | |
| 168 | - alert("请求错误"); | |
| 169 | - console.log(XMLHttpRequest.status); | |
| 170 | - console.log(XMLHttpRequest.readyState); | |
| 171 | - }, | |
| 172 | - success : function(data) { | |
| 173 | - $("#t_activity_save_btn").html("保存成功"); | |
| 174 | - $("#t_activity_save_btn").attr("disabled", true); | |
| 175 | - showTip(data.success); | |
| 176 | - location.href = BASE+'/activity/list/1'; | |
| 177 | - } | |
| 178 | - }); | |
| 179 | - $("#save_confirm_modal").modal('hide'); | |
| 180 | -} | |
| 181 | - | |
| 182 | -//为活动添加wowza信号 | |
| 183 | -function append_wowza(id){ | |
| 184 | - $("#append_wowza_btn").html("保存中..."); | |
| 185 | - $("#append_wowza_btn").attr("disabled", "disabled"); | |
| 186 | - var t_wowza_stream_id; | |
| 187 | - $("input[name='t_wowza_stream_id']:checked").each(function() { | |
| 188 | - t_wowza_stream_id = this.value; | |
| 189 | - }); | |
| 190 | - if(t_wowza_stream_id==''){ | |
| 191 | - alert("请选择对应是 wowza stream"); | |
| 192 | - }else{ | |
| 193 | - $.ajax({ | |
| 194 | - url : BASE+'/activity/appendStream', | |
| 195 | - type : 'post', | |
| 196 | - data : { | |
| 197 | - id :id, | |
| 198 | - t_wowza_stream_id:t_wowza_stream_id | |
| 199 | - }, | |
| 200 | - async : true, | |
| 201 | - error : function() { | |
| 202 | - alert("请求错误"); | |
| 203 | - console.log(XMLHttpRequest.status); | |
| 204 | - console.log(XMLHttpRequest.readyState); | |
| 205 | - }, | |
| 206 | - success : function(data) { | |
| 207 | - var fla=data.success; | |
| 208 | - if(fla){ | |
| 209 | - $("#append_wowza_btn").html("保存成功"); | |
| 210 | - $("#append_wowza_btn").attr("disabled", true); | |
| 211 | - showTip(fla); | |
| 212 | - location.href = BASE+'/activity/list/1'; | |
| 213 | - }else{ | |
| 214 | - showTipWidthMsg(true,"请先为该活动指定输出频道,去修改直播活动!"); | |
| 215 | - } | |
| 216 | - } | |
| 217 | - }); | |
| 218 | - } | |
| 219 | -} | |
| 220 | - | |
| 221 | -function t_activity_search(oid){ | |
| 222 | - $("#t_activity_search_btn").html("后台处理中..."); | |
| 223 | - $("#t_activity_search_btn").attr("disabled", "disabled"); | |
| 224 | - var search_text= $('#search_text').val(); | |
| 225 | - $.ajax({ | |
| 226 | - url : BASE+'/activity/search/1', | |
| 227 | - type : 'post', | |
| 228 | - data : { | |
| 229 | - name :search_text | |
| 230 | - }, | |
| 231 | - async : true, | |
| 232 | - error : function() { | |
| 233 | - alert('搜索发生错误!'); | |
| 234 | - $("#t_activity_search_btn").attr("disabled", false); | |
| 235 | - }, | |
| 236 | - success : function(data) { | |
| 237 | - | |
| 238 | - } | |
| 239 | - }); | |
| 240 | -} | |
| 241 | - | |
| 242 | -//新建活动时选择输出频道 | |
| 243 | -function select_channel(id){ | |
| 244 | - var div =$("#div_channel_box_"+id); | |
| 245 | - var div_inner_checkbox=div.find("input[type='checkbox']") | |
| 246 | - var is_checked=div_inner_checkbox.is(':checked'); | |
| 247 | - if (is_checked) { | |
| 248 | - //取消选择 | |
| 249 | - div.removeClass().addClass("small-box bg-aqua"); | |
| 250 | - div_inner_checkbox.iCheck('uncheck'); | |
| 251 | - }else{ | |
| 252 | - div_inner_checkbox.iCheck('check'); | |
| 253 | - div.removeClass().addClass("small-box bg-red"); | |
| 254 | - } | |
| 255 | -} | |
| 256 | -function isMainClick(obj){ | |
| 257 | - alert(obj); | |
| 258 | - | |
| 259 | -} | |
| 260 | - | |
| 261 | -function t_activity_delete(id) { | |
| 262 | - if (window.confirm('您确定要删除吗!')) { | |
| 263 | - $.ajax({ | |
| 264 | - url : BASE+'/activity/delete/' + id, | |
| 265 | - type : 'get', | |
| 266 | - async : true, | |
| 267 | - error: function(XMLHttpRequest, textStatus, errorThrown) { | |
| 268 | - alert("请求错误"); | |
| 269 | - console.log(XMLHttpRequest.status); | |
| 270 | - console.log(XMLHttpRequest.readyState); | |
| 271 | - console.log(textStatus); | |
| 272 | - }, | |
| 273 | - success : function(data) { | |
| 274 | - if (data.success) { | |
| 275 | - location.href = BASE+'/activity/list/1'; | |
| 276 | - } else { | |
| 277 | - showTipWidthMsg(true,"删除失败! "+data.data); | |
| 278 | - } | |
| 279 | - } | |
| 280 | - }); | |
| 281 | - } | |
| 282 | -} | |
| 283 | - | |
| 284 | - | |
| 285 | -function val_file(id){ | |
| 286 | - $.ajax({ | |
| 287 | - url : BASE+'/wowza/valfile/'+id, | |
| 288 | - type : 'get', | |
| 289 | - datatype : "json", | |
| 290 | - async : true, | |
| 291 | - error : function() { | |
| 292 | - alert("请求错误"); | |
| 293 | - console.log(XMLHttpRequest.status); | |
| 294 | - console.log(XMLHttpRequest.readyState); | |
| 295 | - console.log(textStatus); | |
| 296 | - }, | |
| 297 | - success : function(data) { | |
| 298 | - //showTip(data.success); | |
| 299 | - } | |
| 300 | - }); | |
| 301 | -} | |
| 302 | - | |
| 303 | -function replace_epg(id){ | |
| 304 | - $("#btn_replace_epg").html("后台处理中..."); | |
| 305 | - $.ajax({ | |
| 306 | - url : BASE+'/activity/epg/'+id, | |
| 307 | - type : 'get', | |
| 308 | - datatype : "json", | |
| 309 | - async : true, | |
| 310 | - error : function() { | |
| 311 | - alert("请求错误"); | |
| 312 | - console.log(XMLHttpRequest.status); | |
| 313 | - console.log(XMLHttpRequest.readyState); | |
| 314 | - }, | |
| 315 | - success : function(data) { | |
| 316 | - showTip(data.success); | |
| 317 | - $("#btn_replace_epg").attr("disabled", "disabled"); | |
| 318 | - $("#btn_replace_epg").html("替换完成"); | |
| 319 | - } | |
| 320 | - }); | |
| 321 | -} | |
| 322 | -//详情页信号切换 | |
| 323 | -function do_switch(id){ | |
| 324 | - $("#switch_btn").html("后台处理中..."); | |
| 325 | - $("#switch_btn").attr("disabled", "disabled"); | |
| 326 | - $.ajax({ | |
| 327 | - url : BASE+'/activity/doswitch/'+id, | |
| 328 | - type : 'get', | |
| 329 | - async : true, | |
| 330 | - error : function() { | |
| 331 | - alert('发生错误!'); | |
| 332 | - $("#switch_btn").html("切换失败!"); | |
| 333 | - $("#switch_btn").attr("disabled", false); | |
| 334 | - }, | |
| 335 | - success : function(data) { | |
| 336 | - $("#switch_btn").html("切换成功"); | |
| 337 | - $("#switch_btn").attr("disabled", false); | |
| 338 | - } | |
| 339 | - }); | |
| 340 | -} | |
| 341 | - | |
| 342 | -//详情页-撤销 $("input[name='keleyicom']") | |
| 343 | -function do_stop(id){ | |
| 344 | - $("#reset_btn").html("后台处理中..."); | |
| 345 | - $("#reset_btn").attr("disabled", "disabled"); | |
| 346 | - $.ajax({ | |
| 347 | - url : BASE+'/activity/stop/'+id, | |
| 348 | - type : 'get', | |
| 349 | - async : true, | |
| 350 | - error : function() { | |
| 351 | - alert('发生错误!'); | |
| 352 | - $("#reset_btn").html("信号复位失败!"); | |
| 353 | - $("#reset_btn").attr("disabled", false); | |
| 354 | - }, | |
| 355 | - success : function(data) { | |
| 356 | - $("#reset_btn").html("信号复位成功"); | |
| 357 | - $("#reset_btn").attr("disabled", false); | |
| 358 | - } | |
| 359 | - }); | |
| 360 | -} | |
| 361 | -//详情页-紧急垫片 | |
| 362 | -function do_ad(id){ | |
| 363 | - $("button[name='ad_btn']").html("后台处理中..."); | |
| 364 | - $("button[name='ad_btn']").attr("disabled", "disabled"); | |
| 365 | - $.ajax({ | |
| 366 | - url : BASE+'/activity/advideo/'+id, | |
| 367 | - type : 'get', | |
| 368 | - async : true, | |
| 369 | - error : function() { | |
| 370 | - alert('发生错误!'); | |
| 371 | - $("button[name='ad_btn']").html("垫片失败!"); | |
| 372 | - $("button[name='ad_btn']").attr("disabled", false); | |
| 373 | - }, | |
| 374 | - success : function(data) { | |
| 375 | - if(data.success){ | |
| 376 | - $("button[name='ad_btn']").html("垫片成功"); | |
| 377 | - //$("#switch_btn").attr("disabled", false); | |
| 378 | - }else{ | |
| 379 | - $("button[name='ad_btn']").html("垫片失败,请检查是否活动已经结束,或者当前活动是否分配直播频道"); | |
| 380 | - $("#switch_btn").attr("disabled", false); | |
| 381 | - } | |
| 382 | - } | |
| 383 | - }); | |
| 384 | -} | |
| 385 | - | |
| 386 | - | |
| 387 | -//获取录制视频文件信息 | |
| 388 | -function do_checkfile(id){ | |
| 389 | - $("#checkfile_btn").html("后台处理中..."); | |
| 390 | - $("#checkfile_btn").attr("disabled", "disabled"); | |
| 391 | - $.ajax({ | |
| 392 | - url : BASE+'/activity/checkfile/'+id, | |
| 393 | - type : 'get', | |
| 394 | - async : true, | |
| 395 | - error : function() { | |
| 396 | - alert('发生错误!'); | |
| 397 | - $("#checkfile_btn").html("验证文件失败!"); | |
| 398 | - $("#checkfile_btn").attr("disabled", false); | |
| 399 | - }, | |
| 400 | - success : function(data) { | |
| 401 | - var jsonData=data.data; | |
| 402 | - if (jsonData==null) { | |
| 403 | - $("#mp4_info").append("没有文件产生"); | |
| 404 | - }else{ | |
| 405 | - $.each(jsonData, function(idx, name){ | |
| 406 | - var html='<hr><a class="btn btn-primary btn-xs">文件名:'+name+'</a>'; | |
| 407 | - $("#mp4_info").append(html); | |
| 408 | - }); | |
| 409 | - | |
| 410 | - $("#checkfile_btn").html("验证完成"); | |
| 411 | - $("#checkfile_btn").attr("disabled", false); | |
| 412 | - } | |
| 413 | - } | |
| 414 | - }); | |
| 415 | -} | |
| 416 | - | |
| 417 | - | |
| 418 | -// 发布直播回放 | |
| 419 | -function do_publishreview(id){ | |
| 420 | - $("#publishreview_btn").html("后台处理中..."); | |
| 421 | - $("#publishreview_btn").attr("disabled", "disabled"); | |
| 422 | - $.ajax({ | |
| 423 | - url : BASE+'/activity/publishReview/'+id, | |
| 424 | - type : 'get', | |
| 425 | - async : true, | |
| 426 | - error : function() { | |
| 427 | - alert('发生错误!'); | |
| 428 | - $("#publishreview_btn").html("信号复位失败!"); | |
| 429 | - $("#publishreview_btn").attr("disabled", false); | |
| 430 | - }, | |
| 431 | - success : function(data) { | |
| 432 | - $("#publishreview_btn").html("发布成功"); | |
| 433 | - //$("#publishreview_btn").attr("disabled", false); | |
| 434 | - } | |
| 435 | - }); | |
| 436 | -} | |
| 437 | -//断流处理 | |
| 438 | -function play_close(id,live_url,uuid){ | |
| 439 | - $.ajax({ | |
| 440 | - url : '../../check/cut/' + id, | |
| 441 | - type : 'post', | |
| 442 | - datatype : "json", | |
| 443 | - async : true, | |
| 444 | - data:{"live_url":live_url, | |
| 445 | - "uuid":uuid, | |
| 446 | - }, | |
| 447 | - error : function() { | |
| 448 | - alert('关闭时发生错误!'); | |
| 449 | - }, | |
| 450 | - success : function(data) { | |
| 451 | - //$("#play_url_"+id).val(""); | |
| 452 | - location.href = '../../check/list/1'; | |
| 453 | - alert("关闭成功"); | |
| 454 | - } | |
| 455 | - }); | |
| 456 | -} | |
| 457 | -function changePlay(id,live_url,userId,title,time){ | |
| 458 | - $("input").attr("id","play_url_"+id); | |
| 459 | - $("input").attr("name","play_url_"+id); | |
| 460 | - $("#hidId").val(live_url); | |
| 461 | - $("li[id='userId']").html("<a><i class='fa fa-file-text-o'></i>用户ID: "+userId+"</a>"); | |
| 462 | - $("li[id='title']").html("<a><i class='fa fa-file-text-o'></i>TITLE: "+title+"</a>"); | |
| 463 | - $("li[id='startTime']").html("<a><i class='fa fa-file-text-o'></i>开播时间: "+time+"</a>"); | |
| 464 | - jwplayer("playId").setup({ | |
| 465 | - file: live_url, | |
| 466 | - height: 260, | |
| 467 | - //image: "/assets/myVideo.jpg", | |
| 468 | - autostart:true, | |
| 469 | - rtmp: { | |
| 470 | - bufferlength: 0.1 | |
| 471 | - }, | |
| 472 | - width: 370 | |
| 473 | - }); | |
| 474 | - | |
| 475 | -} | |
| 476 | -function t_live_xq(id){ | |
| 477 | - window.location.href="../../video/view/"+id; | |
| 478 | -} | |
| 479 | -function t_live_underLine(id){ | |
| 480 | - $.ajax({ | |
| 481 | - url:'../../video/unline', | |
| 482 | - type:'post', | |
| 483 | - datatype : 'json', | |
| 484 | - data:{"id":id}, | |
| 485 | - error : function() { | |
| 486 | - alert('下线时发生错误!'); | |
| 487 | - }, | |
| 488 | - success : function(data) { | |
| 489 | - location.href = '../../video/check/1'; | |
| 490 | - alert("下线成功"); | |
| 491 | - } | |
| 492 | - }); | |
| 493 | -} | |
| 494 | -function checkUser(){ | |
| 495 | - var search_user_id = $("#search_user_id").val(); | |
| 496 | - var search_title = $("#search_title").val(); | |
| 497 | - $.ajax({ | |
| 498 | - url:'../../live/search/1', | |
| 499 | - type:'post', | |
| 500 | - datatype : 'json', | |
| 501 | - error : function() { | |
| 502 | - alert('下线时发生错误!'); | |
| 503 | - }, | |
| 504 | - success : function(data) { | |
| 505 | - //location.href = "../../live/search/1?search_user_id="+search_user_id+"&search_title="+search_title; | |
| 506 | - //alert(location.href); | |
| 507 | - } | |
| 508 | - }); | |
| 509 | -} | |
| 1 | +function toSubmit(){ | |
| 2 | + $("#activityForm").submit(); | |
| 3 | +} | |
| 4 | + | |
| 5 | +//修改直播开始结束时间 | |
| 6 | +function update_activity_time(){ | |
| 7 | + var start_time= $('#start_time').val(); | |
| 8 | + var end_time= $('#end_time').val(); | |
| 9 | + var id=$('#activity_id').val(); | |
| 10 | + $.ajax({ | |
| 11 | + url : BASE+'/activity/update/time/', | |
| 12 | + type : 'post', | |
| 13 | + async : true, | |
| 14 | + error : function() { | |
| 15 | + alert("请求错误"); | |
| 16 | + console.log(XMLHttpRequest.status); | |
| 17 | + console.log(XMLHttpRequest.readyState); | |
| 18 | + }, | |
| 19 | + data : { | |
| 20 | + id :id, | |
| 21 | + start_time :start_time, | |
| 22 | + end_time:end_time | |
| 23 | + }, | |
| 24 | + success : function(data) { | |
| 25 | + $("#update_time_btn").html("保存成功"); | |
| 26 | + $("#update_time_btn").attr("disabled", true); | |
| 27 | + } | |
| 28 | + }); | |
| 29 | +} | |
| 30 | + | |
| 31 | +function preload_wowza(id){ | |
| 32 | + window.location.href=BASE+ "/activity/preloadWowza/"+id; | |
| 33 | +} | |
| 34 | +function t_live_edit(id){ | |
| 35 | + window.location.href=BASE+ "/live/edit/"+id; | |
| 36 | +} | |
| 37 | + | |
| 38 | + | |
| 39 | +function to_step_before(id){ | |
| 40 | + window.location.href=BASE+ "/activity/stepBefore/"+id; | |
| 41 | +} | |
| 42 | + | |
| 43 | +function to_step_in(id){ | |
| 44 | + window.location.href=BASE+ "/activity/stepIn/"+id; | |
| 45 | +} | |
| 46 | + | |
| 47 | +function to_step_after(id){ | |
| 48 | + window.location.href=BASE+ "/activity/stepAfter/"+id; | |
| 49 | +} | |
| 50 | + | |
| 51 | +function show_time_div(){ | |
| 52 | + var state =$("#eidt_time_li").css('display'); | |
| 53 | + if (state=='none') { | |
| 54 | + $("#eidt_time_li").show(); | |
| 55 | + }else{ | |
| 56 | + $("#eidt_time_li").hide(); | |
| 57 | + } | |
| 58 | +} | |
| 59 | + | |
| 60 | +function to_stop(id){ | |
| 61 | + $("#reset_btn").html("后台处理中..."); | |
| 62 | + $("#reset_btn").attr("disabled", "disabled"); | |
| 63 | + $.ajax({ | |
| 64 | + url : BASE+'/activity/stop/'+id, | |
| 65 | + type : 'get', | |
| 66 | + datatype : "json", | |
| 67 | + async : true, | |
| 68 | + error : function() { | |
| 69 | + alert("请求错误"); | |
| 70 | + console.log(XMLHttpRequest.status); | |
| 71 | + $("#reset_btn").html("复位中..."); | |
| 72 | + }, | |
| 73 | + success : function(data) { | |
| 74 | + if (data.success) { | |
| 75 | + $("#reset_btn").html("信号已复位"); | |
| 76 | + $("#publish_div").html(""); | |
| 77 | + 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>'; | |
| 78 | + $("#publish_div").html(""); | |
| 79 | + }else{ | |
| 80 | + $("#reset_btn").html("信号复位失败,或者活动已经结束"); | |
| 81 | + } | |
| 82 | + } | |
| 83 | + }); | |
| 84 | + | |
| 85 | +} | |
| 86 | +//获取tree 所选值 | |
| 87 | +//function select_wowza_signal(){ | |
| 88 | +// var tree_node=$(".easy-tree").find('li.li_selected'); | |
| 89 | +// var id=tree_node.attr('id'); | |
| 90 | +// $("#t_wowza_stream_id_tip").val(tree_node.text()); | |
| 91 | +// $("#t_wowza_stream_id").val(id); | |
| 92 | +// $("#wowza_modal").modal('hide'); | |
| 93 | +//} | |
| 94 | + | |
| 95 | +function copy_name(){ | |
| 96 | + var name=$('#name').val(); | |
| 97 | + $('#epg_name').val(name); | |
| 98 | +} | |
| 99 | + | |
| 100 | + | |
| 101 | +function save_confirm(){ | |
| 102 | + var start_time= $('#start_time').val(); | |
| 103 | + console.log(start_time); | |
| 104 | + var t_wowza_stream_id_tip=$("#t_wowza_stream_id_tip").val(); | |
| 105 | + var channel_names=""; | |
| 106 | + $("input[name='channel_id']:checked").each(function(){ | |
| 107 | + channel_names+=$(this).attr("title")+" 、"; | |
| 108 | + }) | |
| 109 | + 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>"; | |
| 110 | + $("#tip_message").html(html); | |
| 111 | + $("#save_confirm_modal").modal({backdrop: 'static', keyboard: false}); | |
| 112 | +} | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | +function t_activity_save_or_update(id){ | |
| 118 | + $("#t_activity_save_btn").html("后台处理中..."); | |
| 119 | + //$("#t_activity_save_btn").attr("disabled", "disabled"); | |
| 120 | + var is_free; | |
| 121 | + $("input[name='is_free']:checked").each(function() { | |
| 122 | + is_free = this.value; | |
| 123 | + }); | |
| 124 | + var is_playback; | |
| 125 | + $("input[name='is_playback']:checked").each(function() { | |
| 126 | + is_playback = this.value; | |
| 127 | + }); | |
| 128 | + | |
| 129 | + var logo; | |
| 130 | + $("input[name='logo']:checked").each(function() { | |
| 131 | + logo = this.value; | |
| 132 | + }); | |
| 133 | + | |
| 134 | + var channel_ids=""; | |
| 135 | + $("input[name='channel_id']:checked").each(function(){ | |
| 136 | + channel_ids+=$(this).val()+","; | |
| 137 | + }) | |
| 138 | + var is_main= $('#is_main').val(); | |
| 139 | + var t_activity = new Object(); | |
| 140 | + t_activity.name = $('#name').val(); | |
| 141 | + t_activity.epg_name = $('#epg_name').val(); | |
| 142 | + t_activity.description = $('#description').val(); | |
| 143 | + t_activity.place = $('#place').val(); | |
| 144 | + t_activity.start_time = $('#start_time').val(); | |
| 145 | + t_activity.end_time = $('#end_time').val(); | |
| 146 | + t_activity.contact_user =$('#contact_user').val(); | |
| 147 | + t_activity.v_count = $('#v_count').val(); | |
| 148 | + t_activity.is_free=is_free; | |
| 149 | + t_activity.t_default_video_id=$("#t_default_video_id option:selected").val(); | |
| 150 | + t_activity.is_playback=is_playback; | |
| 151 | + t_activity.logo=logo; | |
| 152 | + t_activity.uuid= $('#uuid').val(); | |
| 153 | + t_activity.notify_user=$('#notify_user').val(); | |
| 154 | + t_activity.chatroom_id=$('#chatroom_id').val(); | |
| 155 | + var json = JSON.stringify(t_activity); | |
| 156 | + $.ajax({ | |
| 157 | + url : BASE+'/activity/add', | |
| 158 | + type : 'post', | |
| 159 | + datatype : "json", | |
| 160 | + data : { | |
| 161 | + id :id, | |
| 162 | + json :json, | |
| 163 | + is_main:is_main, | |
| 164 | + channel_ids:channel_ids | |
| 165 | + }, | |
| 166 | + async : true, | |
| 167 | + error : function() { | |
| 168 | + alert("请求错误"); | |
| 169 | + console.log(XMLHttpRequest.status); | |
| 170 | + console.log(XMLHttpRequest.readyState); | |
| 171 | + }, | |
| 172 | + success : function(data) { | |
| 173 | + $("#t_activity_save_btn").html("保存成功"); | |
| 174 | + $("#t_activity_save_btn").attr("disabled", true); | |
| 175 | + showTip(data.success); | |
| 176 | + location.href = BASE+'/activity/list/1'; | |
| 177 | + } | |
| 178 | + }); | |
| 179 | + $("#save_confirm_modal").modal('hide'); | |
| 180 | +} | |
| 181 | + | |
| 182 | +//为活动添加wowza信号 | |
| 183 | +function append_wowza(id){ | |
| 184 | + $("#append_wowza_btn").html("保存中..."); | |
| 185 | + $("#append_wowza_btn").attr("disabled", "disabled"); | |
| 186 | + var t_wowza_stream_id; | |
| 187 | + $("input[name='t_wowza_stream_id']:checked").each(function() { | |
| 188 | + t_wowza_stream_id = this.value; | |
| 189 | + }); | |
| 190 | + if(t_wowza_stream_id==''){ | |
| 191 | + alert("请选择对应是 wowza stream"); | |
| 192 | + }else{ | |
| 193 | + $.ajax({ | |
| 194 | + url : BASE+'/activity/appendStream', | |
| 195 | + type : 'post', | |
| 196 | + data : { | |
| 197 | + id :id, | |
| 198 | + t_wowza_stream_id:t_wowza_stream_id | |
| 199 | + }, | |
| 200 | + async : true, | |
| 201 | + error : function() { | |
| 202 | + alert("请求错误"); | |
| 203 | + console.log(XMLHttpRequest.status); | |
| 204 | + console.log(XMLHttpRequest.readyState); | |
| 205 | + }, | |
| 206 | + success : function(data) { | |
| 207 | + var fla=data.success; | |
| 208 | + if(fla){ | |
| 209 | + $("#append_wowza_btn").html("保存成功"); | |
| 210 | + $("#append_wowza_btn").attr("disabled", true); | |
| 211 | + showTip(fla); | |
| 212 | + location.href = BASE+'/activity/list/1'; | |
| 213 | + }else{ | |
| 214 | + showTipWidthMsg(true,"请先为该活动指定输出频道,去修改直播活动!"); | |
| 215 | + } | |
| 216 | + } | |
| 217 | + }); | |
| 218 | + } | |
| 219 | +} | |
| 220 | + | |
| 221 | +function t_activity_search(oid){ | |
| 222 | + $("#t_activity_search_btn").html("后台处理中..."); | |
| 223 | + $("#t_activity_search_btn").attr("disabled", "disabled"); | |
| 224 | + var search_text= $('#search_text').val(); | |
| 225 | + $.ajax({ | |
| 226 | + url : BASE+'/activity/search/1', | |
| 227 | + type : 'post', | |
| 228 | + data : { | |
| 229 | + name :search_text | |
| 230 | + }, | |
| 231 | + async : true, | |
| 232 | + error : function() { | |
| 233 | + alert('搜索发生错误!'); | |
| 234 | + $("#t_activity_search_btn").attr("disabled", false); | |
| 235 | + }, | |
| 236 | + success : function(data) { | |
| 237 | + | |
| 238 | + } | |
| 239 | + }); | |
| 240 | +} | |
| 241 | + | |
| 242 | +//新建活动时选择输出频道 | |
| 243 | +function select_channel(id){ | |
| 244 | + var div =$("#div_channel_box_"+id); | |
| 245 | + var div_inner_checkbox=div.find("input[type='checkbox']") | |
| 246 | + var is_checked=div_inner_checkbox.is(':checked'); | |
| 247 | + if (is_checked) { | |
| 248 | + //取消选择 | |
| 249 | + div.removeClass().addClass("small-box bg-aqua"); | |
| 250 | + div_inner_checkbox.iCheck('uncheck'); | |
| 251 | + }else{ | |
| 252 | + div_inner_checkbox.iCheck('check'); | |
| 253 | + div.removeClass().addClass("small-box bg-red"); | |
| 254 | + } | |
| 255 | +} | |
| 256 | +function isMainClick(obj){ | |
| 257 | + alert(obj); | |
| 258 | + | |
| 259 | +} | |
| 260 | + | |
| 261 | +function t_activity_delete(id) { | |
| 262 | + if (window.confirm('您确定要删除吗!')) { | |
| 263 | + $.ajax({ | |
| 264 | + url : BASE+'/activity/delete/' + id, | |
| 265 | + type : 'get', | |
| 266 | + async : true, | |
| 267 | + error: function(XMLHttpRequest, textStatus, errorThrown) { | |
| 268 | + alert("请求错误"); | |
| 269 | + console.log(XMLHttpRequest.status); | |
| 270 | + console.log(XMLHttpRequest.readyState); | |
| 271 | + console.log(textStatus); | |
| 272 | + }, | |
| 273 | + success : function(data) { | |
| 274 | + if (data.success) { | |
| 275 | + location.href = BASE+'/activity/list/1'; | |
| 276 | + } else { | |
| 277 | + showTipWidthMsg(true,"删除失败! "+data.data); | |
| 278 | + } | |
| 279 | + } | |
| 280 | + }); | |
| 281 | + } | |
| 282 | +} | |
| 283 | + | |
| 284 | + | |
| 285 | +function val_file(id){ | |
| 286 | + $.ajax({ | |
| 287 | + url : BASE+'/wowza/valfile/'+id, | |
| 288 | + type : 'get', | |
| 289 | + datatype : "json", | |
| 290 | + async : true, | |
| 291 | + error : function() { | |
| 292 | + alert("请求错误"); | |
| 293 | + console.log(XMLHttpRequest.status); | |
| 294 | + console.log(XMLHttpRequest.readyState); | |
| 295 | + console.log(textStatus); | |
| 296 | + }, | |
| 297 | + success : function(data) { | |
| 298 | + //showTip(data.success); | |
| 299 | + } | |
| 300 | + }); | |
| 301 | +} | |
| 302 | + | |
| 303 | +function replace_epg(id){ | |
| 304 | + $("#btn_replace_epg").html("后台处理中..."); | |
| 305 | + $.ajax({ | |
| 306 | + url : BASE+'/activity/epg/'+id, | |
| 307 | + type : 'get', | |
| 308 | + datatype : "json", | |
| 309 | + async : true, | |
| 310 | + error : function() { | |
| 311 | + alert("请求错误"); | |
| 312 | + console.log(XMLHttpRequest.status); | |
| 313 | + console.log(XMLHttpRequest.readyState); | |
| 314 | + }, | |
| 315 | + success : function(data) { | |
| 316 | + showTip(data.success); | |
| 317 | + $("#btn_replace_epg").attr("disabled", "disabled"); | |
| 318 | + $("#btn_replace_epg").html("替换完成"); | |
| 319 | + } | |
| 320 | + }); | |
| 321 | +} | |
| 322 | +//详情页信号切换 | |
| 323 | +function do_switch(id){ | |
| 324 | + $("#switch_btn").html("后台处理中..."); | |
| 325 | + $("#switch_btn").attr("disabled", "disabled"); | |
| 326 | + $.ajax({ | |
| 327 | + url : BASE+'/activity/doswitch/'+id, | |
| 328 | + type : 'get', | |
| 329 | + async : true, | |
| 330 | + error : function() { | |
| 331 | + alert('发生错误!'); | |
| 332 | + $("#switch_btn").html("切换失败!"); | |
| 333 | + $("#switch_btn").attr("disabled", false); | |
| 334 | + }, | |
| 335 | + success : function(data) { | |
| 336 | + $("#switch_btn").html("切换成功"); | |
| 337 | + $("#switch_btn").attr("disabled", false); | |
| 338 | + } | |
| 339 | + }); | |
| 340 | +} | |
| 341 | + | |
| 342 | +//详情页-撤销 $("input[name='keleyicom']") | |
| 343 | +function do_stop(id){ | |
| 344 | + $("#reset_btn").html("后台处理中..."); | |
| 345 | + $("#reset_btn").attr("disabled", "disabled"); | |
| 346 | + $.ajax({ | |
| 347 | + url : BASE+'/activity/stop/'+id, | |
| 348 | + type : 'get', | |
| 349 | + async : true, | |
| 350 | + error : function() { | |
| 351 | + alert('发生错误!'); | |
| 352 | + $("#reset_btn").html("信号复位失败!"); | |
| 353 | + $("#reset_btn").attr("disabled", false); | |
| 354 | + }, | |
| 355 | + success : function(data) { | |
| 356 | + $("#reset_btn").html("信号复位成功"); | |
| 357 | + $("#reset_btn").attr("disabled", false); | |
| 358 | + } | |
| 359 | + }); | |
| 360 | +} | |
| 361 | +//详情页-紧急垫片 | |
| 362 | +function do_ad(id){ | |
| 363 | + $("button[name='ad_btn']").html("后台处理中..."); | |
| 364 | + $("button[name='ad_btn']").attr("disabled", "disabled"); | |
| 365 | + $.ajax({ | |
| 366 | + url : BASE+'/activity/advideo/'+id, | |
| 367 | + type : 'get', | |
| 368 | + async : true, | |
| 369 | + error : function() { | |
| 370 | + alert('发生错误!'); | |
| 371 | + $("button[name='ad_btn']").html("垫片失败!"); | |
| 372 | + $("button[name='ad_btn']").attr("disabled", false); | |
| 373 | + }, | |
| 374 | + success : function(data) { | |
| 375 | + if(data.success){ | |
| 376 | + $("button[name='ad_btn']").html("垫片成功"); | |
| 377 | + //$("#switch_btn").attr("disabled", false); | |
| 378 | + }else{ | |
| 379 | + $("button[name='ad_btn']").html("垫片失败,请检查是否活动已经结束,或者当前活动是否分配直播频道"); | |
| 380 | + $("#switch_btn").attr("disabled", false); | |
| 381 | + } | |
| 382 | + } | |
| 383 | + }); | |
| 384 | +} | |
| 385 | + | |
| 386 | + | |
| 387 | +//获取录制视频文件信息 | |
| 388 | +function do_checkfile(id){ | |
| 389 | + $("#checkfile_btn").html("后台处理中..."); | |
| 390 | + $("#checkfile_btn").attr("disabled", "disabled"); | |
| 391 | + $.ajax({ | |
| 392 | + url : BASE+'/activity/checkfile/'+id, | |
| 393 | + type : 'get', | |
| 394 | + async : true, | |
| 395 | + error : function() { | |
| 396 | + alert('发生错误!'); | |
| 397 | + $("#checkfile_btn").html("验证文件失败!"); | |
| 398 | + $("#checkfile_btn").attr("disabled", false); | |
| 399 | + }, | |
| 400 | + success : function(data) { | |
| 401 | + var jsonData=data.data; | |
| 402 | + if (jsonData==null) { | |
| 403 | + $("#mp4_info").append("没有文件产生"); | |
| 404 | + }else{ | |
| 405 | + $.each(jsonData, function(idx, name){ | |
| 406 | + var html='<hr><a class="btn btn-primary btn-xs">文件名:'+name+'</a>'; | |
| 407 | + $("#mp4_info").append(html); | |
| 408 | + }); | |
| 409 | + | |
| 410 | + $("#checkfile_btn").html("验证完成"); | |
| 411 | + $("#checkfile_btn").attr("disabled", false); | |
| 412 | + } | |
| 413 | + } | |
| 414 | + }); | |
| 415 | +} | |
| 416 | + | |
| 417 | + | |
| 418 | +// 发布直播回放 | |
| 419 | +function do_publishreview(id){ | |
| 420 | + $("#publishreview_btn").html("后台处理中..."); | |
| 421 | + $("#publishreview_btn").attr("disabled", "disabled"); | |
| 422 | + $.ajax({ | |
| 423 | + url : BASE+'/activity/publishReview/'+id, | |
| 424 | + type : 'get', | |
| 425 | + async : true, | |
| 426 | + error : function() { | |
| 427 | + alert('发生错误!'); | |
| 428 | + $("#publishreview_btn").html("信号复位失败!"); | |
| 429 | + $("#publishreview_btn").attr("disabled", false); | |
| 430 | + }, | |
| 431 | + success : function(data) { | |
| 432 | + $("#publishreview_btn").html("发布成功"); | |
| 433 | + //$("#publishreview_btn").attr("disabled", false); | |
| 434 | + } | |
| 435 | + }); | |
| 436 | +} | |
| 437 | +//断流处理 | |
| 438 | +function play_close(id,live_url,uuid){ | |
| 439 | + $.ajax({ | |
| 440 | + url : '../../check/cut/' + id, | |
| 441 | + type : 'post', | |
| 442 | + datatype : "json", | |
| 443 | + async : true, | |
| 444 | + data:{"live_url":live_url, | |
| 445 | + "uuid":uuid, | |
| 446 | + }, | |
| 447 | + error : function() { | |
| 448 | + alert('关闭时发生错误!'); | |
| 449 | + }, | |
| 450 | + success : function(data) { | |
| 451 | + //$("#play_url_"+id).val(""); | |
| 452 | + location.href = '../../check/list/1'; | |
| 453 | + alert("关闭成功"); | |
| 454 | + } | |
| 455 | + }); | |
| 456 | +} | |
| 457 | +function changePlay(id,live_url,userId,title,time){ | |
| 458 | + $("input").attr("id","play_url_"+id); | |
| 459 | + $("input").attr("name","play_url_"+id); | |
| 460 | + $("#hidId").val(live_url); | |
| 461 | + $("li[id='userId']").html("<a><i class='fa fa-file-text-o'></i>用户ID: "+userId+"</a>"); | |
| 462 | + $("li[id='title']").html("<a><i class='fa fa-file-text-o'></i>TITLE: "+title+"</a>"); | |
| 463 | + $("li[id='startTime']").html("<a><i class='fa fa-file-text-o'></i>开播时间: "+time+"</a>"); | |
| 464 | + jwplayer("playId").setup({ | |
| 465 | + file: live_url, | |
| 466 | + height: 260, | |
| 467 | + //image: "/assets/myVideo.jpg", | |
| 468 | + autostart:true, | |
| 469 | + rtmp: { | |
| 470 | + bufferlength: 0.1 | |
| 471 | + }, | |
| 472 | + width: 370 | |
| 473 | + }); | |
| 474 | + | |
| 475 | +} | |
| 476 | +function t_live_xq(id){ | |
| 477 | + window.location.href="../../video/view/"+id; | |
| 478 | +} | |
| 479 | +function t_live_underLine(id){ | |
| 480 | + $.ajax({ | |
| 481 | + url:'../../video/unline', | |
| 482 | + type:'post', | |
| 483 | + datatype : 'json', | |
| 484 | + data:{"id":id}, | |
| 485 | + error : function() { | |
| 486 | + alert('下线时发生错误!'); | |
| 487 | + }, | |
| 488 | + success : function(data) { | |
| 489 | + location.href = '../../video/check/1'; | |
| 490 | + alert("下线成功"); | |
| 491 | + } | |
| 492 | + }); | |
| 493 | +} | |
| 494 | +function checkUser(){ | |
| 495 | + var search_user_id = $("#search_user_id").val(); | |
| 496 | + var search_title = $("#search_title").val(); | |
| 497 | + $.ajax({ | |
| 498 | + url:'../../live/search/1', | |
| 499 | + type:'post', | |
| 500 | + datatype : 'json', | |
| 501 | + error : function() { | |
| 502 | + alert('下线时发生错误!'); | |
| 503 | + }, | |
| 504 | + success : function(data) { | |
| 505 | + //location.href = "../../live/search/1?search_user_id="+search_user_id+"&search_title="+search_title; | |
| 506 | + //alert(location.href); | |
| 507 | + } | |
| 508 | + }); | |
| 509 | +} | ... | ... |
src/test/java/com/cnlive/test/HttpPostArgumentTest2.java deleted
100644 → 0
| 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 deleted
100644 → 0
| 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 | - String live = "rtmp://cnlive01.rtmplive.ks-cdn.com/live/498122_a9fdb367c6054edc9d2035dc237d28aa"; | |
| 24 | - int index = live.lastIndexOf("/"); | |
| 25 | - System.out.println(index); | |
| 26 | - String live_url = live.substring(index+1); | |
| 27 | - System.out.println(live_url); | |
| 28 | - } | |
| 29 | - | |
| 30 | - public static String toGMTString(Date date) { | |
| 31 | - SimpleDateFormat df = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z", Locale.UK); | |
| 32 | - df.setTimeZone(new java.util.SimpleTimeZone(0, "GMT")); | |
| 33 | - return df.format(date); | |
| 34 | - } | |
| 35 | - public static String sendGet(String url) { | |
| 36 | - String result = ""; | |
| 37 | - BufferedReader in = null; | |
| 38 | - try { | |
| 39 | - URL realUrl = new URL(url); | |
| 40 | - /* | |
| 41 | - * http header 参数 | |
| 42 | - */ | |
| 43 | - String content_type = "application/json"; | |
| 44 | - String path = realUrl.getFile(); | |
| 45 | - String date = toGMTString(new Date()); | |
| 46 | - // 2.计算 HMAC-SHA1 | |
| 47 | - // 打开和URL之间的连接 | |
| 48 | - URLConnection connection = realUrl.openConnection(); | |
| 49 | - System.out.println(connection); | |
| 50 | - // 设置通用的请求属性 | |
| 51 | - // 建立实际的连接 | |
| 52 | - // 定义 BufferedReader输入流来读取URL的响应 | |
| 53 | - in = new BufferedReader(new InputStreamReader(connection.getInputStream())); | |
| 54 | - String line; | |
| 55 | - while ((line = in.readLine()) != null) { | |
| 56 | - result += line; | |
| 57 | - } | |
| 58 | - } catch (Exception e) { | |
| 59 | - System.out.println("发送GET请求出现异常!" + e); | |
| 60 | - e.printStackTrace(); | |
| 61 | - } | |
| 62 | - // 使用finally块来关闭输入流 | |
| 63 | - finally { | |
| 64 | - try { | |
| 65 | - if (in != null) { | |
| 66 | - in.close(); | |
| 67 | - } | |
| 68 | - } catch (Exception e) { | |
| 69 | - e.printStackTrace(); | |
| 70 | - } | |
| 71 | - } | |
| 72 | - return result; | |
| 73 | - } | |
| 74 | -} |
target/classes/com/cnlive/mz/live/action/ActivityAction.class deleted
100644 → 0
No preview for this file type
target/classes/com/cnlive/mz/live/action/ChannelAction.class deleted
100644 → 0
No preview for this file type
target/classes/com/cnlive/mz/live/action/IndexAction.class deleted
100644 → 0
No preview for this file type
target/classes/com/cnlive/mz/live/action/SignalAction.class deleted
100644 → 0
No preview for this file type
target/classes/com/cnlive/mz/live/action/WowzaAction.class deleted
100644 → 0
No preview for this file type
target/classes/com/cnlive/mz/live/aspect/ActionAspect.class deleted
100644 → 0
No preview for this file type
target/classes/com/cnlive/mz/live/aspect/AuthFilter.class deleted
100644 → 0
No preview for this file type
target/classes/com/cnlive/mz/live/rest/AjaxRest.class deleted
100644 → 0
No preview for this file type
target/m2e-wtp/web-resources/META-INF/maven/com.cnlive.mz.live.web/cnlive_live_web/pom.properties
| ... | ... | @@ -5,3 +5,10 @@ groupId=com.cnlive.mz.live.web |
| 5 | 5 | m2e.projectName=cnlive_live_web |
| 6 | 6 | m2e.projectLocation=D\:\\1_CNLIVE_JAVA_CODE\\cnlive_live_web |
| 7 | 7 | artifactId=cnlive_live_web |
| 8 | +#Generated by Maven Integration for Eclipse | |
| 9 | +#Fri Aug 19 14:05:33 CST 2016 | |
| 10 | +version=0.0.1-SNAPSHOT | |
| 11 | +groupId=com.cnlive.mz.live.web | |
| 12 | +m2e.projectName=cnlive_live_web | |
| 13 | +m2e.projectLocation=C\:\\Users\\Administrator\\git\\cnlive_live_web | |
| 14 | +artifactId=cnlive_live_web | |
| 8 | 15 | \ No newline at end of file | ... | ... |