playback.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. var ybplay={
  2. closePorp:function()
  3. {
  4. $('#buyvip').hide();
  5. $('#buyvip').html("");
  6. document.getElementById('ds-dialog-bg').style.display='none';
  7. },
  8. player:function(id)
  9. {
  10. //这里是请求的阿里的接口 走的是api 如果需要更换 请自行更换请求地址
  11. $.ajax({
  12. cache: true,
  13. type: "GET",
  14. url:'./api/public/?service=User.getAliCdnRecord&id='+id,
  15. data:"",// 你的formid
  16. async: false,
  17. error: function(request)
  18. {
  19. layer.msg("数据请求失败");
  20. },
  21. success: function(data)
  22. {
  23. if(data.data.code==0)
  24. {
  25. $(".event").removeClass("selected");
  26. var url=data.data.info;
  27. url=url['0']['url'];
  28. ybplay.video(url);
  29. $("#play_"+id).addClass("selected");
  30. }
  31. else
  32. {
  33. layer.msg(data.data.msg);
  34. }
  35. }
  36. });
  37. },
  38. video:function(url)
  39. {
  40. var flashvars={
  41. f:'public/playback/m3u8.swf',
  42. a:url,
  43. s:4,
  44. c:0,
  45. p:1
  46. };
  47. var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent'};
  48. var video=[url];
  49. CKobject.embed('public/playback/ckplayer.swf','play_reft','ckplayer_a1','100%','100%',false,flashvars,video,params);
  50. }
  51. }
  52. var box = new LightBox();
  53. function closelights(){//关灯
  54. }
  55. function openlights()
  56. {//开灯
  57. }