monitor.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. function closeRoom(roomId){
  2. var data2 = {"token":"1234567","roomnum":roomId};
  3. $.ajax({
  4. async: false,
  5. url: '/Admin/Monitor/stopRoom',
  6. data:{uid:roomId},
  7. dataType: "json",
  8. success: function(data){
  9. //console.log(data);
  10. if(data.status ==0){
  11. alert(data.info);
  12. }else{
  13. socket.emit("superadminaction",data2);
  14. alert("房间已关闭");
  15. location.reload();
  16. }
  17. },
  18. error:function(XMLHttpRequest, textStatus, errorThrown){
  19. alert('关闭失败,请重试');
  20. }
  21. });
  22. }
  23. function fullRoom(uid){
  24. $.ajax({
  25. type:"post",
  26. url:"/Admin/Monitor/full",
  27. data:{uid:uid},
  28. success:function(data){
  29. $("#buyvip").css({"left":getMiddlePos('buyvip').pl+"px","z-index":2100,}).show();
  30. $("#buyvip").html(data);
  31. }
  32. });
  33. }
  34. function closePorp(){
  35. $('#buyvip').hide();
  36. $('#buyvip').html("");
  37. }
  38. function setVideo(id,pull){
  39. console.log(pull);
  40. if(pull==''){
  41. return !1;
  42. }
  43. var last_len=pull.lastIndexOf(".")+1;
  44. var len = pull.length;
  45. var pathf = pull.substring(last_len,len).toLowerCase();
  46. document.getElementById(id).innerHTML ='';
  47. if(pathf=='flv'){
  48. new FlvJsPlayer({
  49. id: id,
  50. url: pull,
  51. autoplay: true,
  52. autoplayMuted: true,
  53. playsinline:true,
  54. volume:0.2,
  55. width:'100%',
  56. height:'100%',
  57. fitVideoSize: 'auto',
  58. ignores: ['time','replay']
  59. });
  60. return !0;
  61. }
  62. if(pathf=='hls'){
  63. new HlsJsPlayer({
  64. id: id,
  65. url: pull,
  66. autoplay: true,
  67. autoplayMuted: true,
  68. playsinline:true,
  69. volume:0.2,
  70. width:'100%',
  71. height:'100%',
  72. fitVideoSize: 'auto',
  73. ignores: ['time','replay']
  74. });
  75. return !0;
  76. }
  77. new Player({
  78. id: id,
  79. url: pull,
  80. autoplay: true,
  81. autoplayMuted: true,
  82. playsinline:true,
  83. volume:0.2,
  84. width:'100%',
  85. height:'100%',
  86. fitVideoSize: 'auto',
  87. ignores: ['time','replay']
  88. });
  89. return !0;
  90. }