Commit a80e77eba9c26dbaf4eb89f820b6ba1d3c14a54d

Authored by 张宗朋
1 parent 26e9d741

live

src/main/java/com/cnlive/mz/live/action/VideoAction.java
@@ -225,4 +225,10 @@ public class VideoAction { @@ -225,4 +225,10 @@ public class VideoAction {
225 } 225 }
226 log.info(sb.toString()); 226 log.info(sb.toString());
227 } 227 }
  228 + @Request.Post("/video/unline")
  229 + public Result underLine(Params params){
  230 + int id = params.getInt("id");
  231 + tVideoService.underLine(id);
  232 + return null;
  233 + }
228 } 234 }
src/main/webapp/static/assets/cnlive/js/live.js
@@ -436,8 +436,6 @@ function do_publishreview(id){ @@ -436,8 +436,6 @@ function do_publishreview(id){
436 } 436 }
437 //断流处理 437 //断流处理
438 function play_close(id,live_url,uuid){ 438 function play_close(id,live_url,uuid){
439 - var id_live_url = $("hidId").val();  
440 - alert(id_live_url);  
441 $.ajax({ 439 $.ajax({
442 url : '../../check/cut/' + id, 440 url : '../../check/cut/' + id,
443 type : 'post', 441 type : 'post',
@@ -459,12 +457,10 @@ function play_close(id,live_url,uuid){ @@ -459,12 +457,10 @@ function play_close(id,live_url,uuid){
459 function changePlay(id,live_url,userId,title,time){ 457 function changePlay(id,live_url,userId,title,time){
460 $("input").attr("id","play_url_"+id); 458 $("input").attr("id","play_url_"+id);
461 $("input").attr("name","play_url_"+id); 459 $("input").attr("name","play_url_"+id);
462 - //$("#play_url_"+id).val(live_url);  
463 $("#hidId").val(live_url); 460 $("#hidId").val(live_url);
464 $("li[id='userId']").html("<a><i class='fa fa-file-text-o'></i>用户ID: "+userId+"</a>"); 461 $("li[id='userId']").html("<a><i class='fa fa-file-text-o'></i>用户ID: "+userId+"</a>");
465 $("li[id='title']").html("<a><i class='fa fa-file-text-o'></i>TITLE: "+title+"</a>"); 462 $("li[id='title']").html("<a><i class='fa fa-file-text-o'></i>TITLE: "+title+"</a>");
466 $("li[id='startTime']").html("<a><i class='fa fa-file-text-o'></i>开播时间: "+time+"</a>"); 463 $("li[id='startTime']").html("<a><i class='fa fa-file-text-o'></i>开播时间: "+time+"</a>");
467 - //$("#playId").html("<input type='hidden' name='play_url_"+id+"'id='play_url_"+id+"' value='"+live_url+"'/><span class='mailbox-attachment-icon has-img' id='player_span_"+id+"'><img src='../../static/assets/dist/img/photo2.png' alt='Attachment'></span>");  
468 jwplayer("playId").setup({ 464 jwplayer("playId").setup({
469 file: live_url, 465 file: live_url,
470 height: 260, 466 height: 260,
@@ -480,4 +476,19 @@ function changePlay(id,live_url,userId,title,time){ @@ -480,4 +476,19 @@ function changePlay(id,live_url,userId,title,time){
480 function t_live_xq(id){ 476 function t_live_xq(id){
481 window.location.href="../../video/view/"+id; 477 window.location.href="../../video/view/"+id;
482 } 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 +}
483 494
src/main/webapp/static/assets/cnlive/js/video.js
1 function t_live_xq(id){ 1 function t_live_xq(id){
2 - $,ajax({ 2 + $.ajax({
3 url:'../../video/detail', 3 url:'../../video/detail',
4 type:'post', 4 type:'post',
5 datatype : 'json', 5 datatype : 'json',
6 data:{"id":id}, 6 data:{"id":id},
7 }); 7 });
  8 +}
  9 +function t_live_underLine(id){
  10 + alert(id);
  11 + $.ajax({
  12 + url:'../../video/unline',
  13 + type:'post',
  14 + datatype : 'json',
  15 + data:{"id":id},
  16 + });
8 } 17 }
9 \ No newline at end of file 18 \ No newline at end of file