Advertisement
artursn

Untitled

Mar 30th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.96 KB | None | 0 0
  1. function c8net_show_preroll(video_url,video_duration,banner_id,url_audit,url_audit2,source_width,source_height)
  2. {
  3. if (0>=video_duration || ""==video_url)
  4. {
  5. return;
  6. };
  7.  
  8. c8ban_preroll_event_url='//a.c8.net.ua/audit.php?ssp_id=3634&site_id='+c8ban_preroll_site_id+'&format_id=8&dsp_id=1&banner_id='+banner_id+'&key='+Math.random();
  9.  
  10.  
  11. if(typeof jwplayer=="undefined") {
  12.  
  13. var s = document.createElement('script');
  14. s.type = 'text/javascript';
  15. //s.async = true;
  16. s.src = 'https://b.c8.net.ua/b/js/jwplayer.js';
  17. s.onload=s.onreadystatechange=function()
  18. {
  19. if(!("readyState" in s)||/loaded|complete/.test(s.readyState))
  20. {
  21. s.onload=s.onreadystatechange=null;
  22. c8net_show_preroll_jw(video_url,video_duration,banner_id,url_audit,url_audit2,source_width,source_height);
  23. }
  24. }
  25.  
  26. var p=document.getElementsByTagName('head')[0];
  27. p.appendChild(s);
  28.  
  29. } else {
  30. c8net_show_preroll_jw(video_url,video_duration,banner_id,url_audit,url_audit2,source_width,source_height);
  31. }
  32.  
  33.  
  34. return;
  35.  
  36. if (''!=url_audit)
  37. {
  38. img_audit=new Image();
  39. img_audit.src=url_audit+'&'+Math.random();
  40. };
  41.  
  42. if (''!=url_audit2)
  43. {
  44. img_audit2=new Image();
  45. img_audit2.src=url_audit2+'&'+Math.random();
  46. };
  47.  
  48. c8net_preroll_load_limit=10;
  49. c8net_preroll_duration=video_duration;
  50. c8net_preroll_curtime=video_duration;
  51. c8net_preroll_status='load';
  52.  
  53. c8net_newDiv = document.createElement('div');
  54.  
  55. c8net_newDiv.style.height=curplayer.height+"px";
  56. c8net_newDiv.style.width=curplayer.width+"px";
  57. c8net_newDiv.style.background='black';
  58.  
  59. if (c8_yfc_onplay)
  60. {
  61. curplayer.pause();
  62. }
  63. else if (!c8_yfc_onlymove)
  64. {
  65. curplayer.pauseVideo();
  66. };
  67.  
  68. //curplayer.style.visibility='hidden';
  69.  
  70. c8net_newDiv.innerHTML='<div id="c8net_preroll_div"></div><div id="c8net_logo_div" style="position:absolute; bottom:0px; align:center;height:15px;background-color:white;color:black;width:'+curplayer.width+'px"><small><a href="http://c8.net.ua" target=_blank><img border=0 style="padding-top:4px;" width="125px" height="13px" src="https://b.c8.net.ua/b/logo/video_logo.gif" /></a>&nbsp;&nbsp;&nbsp;<span id="c8net_timer_div">'+c8net_preroll_curtime+'</span> sec ...</small>&nbsp;&nbsp;&nbsp;<span id="c8net_skip_div" style="visibility:hidden;"><a href="javascript:void(0);" onclick="javascript:c8net_finish_preroll();" ><img border=0 src="https://b.c8.net.ua/b/logo/video_skip.png" width="80px" height="13px"></a></span>&nbsp;&nbsp;&nbsp;<span id="c8net_mute_div" style="visibility:hidden;"><a href="javascript:void(0);" onclick="javascript:c8net_mute_preroll();" ><img border=0 src="https://b.c8.net.ua/b/logo/video_mute.png" width="21px" height="13px"></a></span></div>';
  71.  
  72. var b = new SWFObject('https://b.c8.net.ua/s/preroll.swf', 'c8net_preroll_banner', curplayer.width, curplayer.height, '8', null);
  73. b.addParam('scale', 'noscale');
  74. b.addParam('salign', 'lt');
  75.  
  76. if (-1==video_url.indexOf(".flv"))
  77. {
  78. b.addVariable('swf', video_url);
  79. }
  80. else
  81. {
  82. b.addVariable('flv', video_url);
  83. };
  84.  
  85. //b.addVariable('swf', video_url);
  86. b.addVariable('hidelogo', 1);
  87. b.addVariable('hidetimer', 1);
  88. b.addVariable('w', curplayer.width);
  89. b.addVariable('h', curplayer.height);
  90. b.addVariable('wb', source_width); //1410
  91. b.addVariable('hb', source_height); //763
  92. b.addVariable('duration', video_duration);
  93. b.addParam('allowscriptaccess',"always");
  94.  
  95. //b.addVariable('callback_func_finish', 'alert(\'\');c8net_finish_preroll');
  96.  
  97. if (("undefined"!=typeof(click_url)) && (""!=click_url))
  98. {
  99. b.addVariable('url', escape(click_url));b.addVariable('link1', escape(click_url));b.addVariable('bn_url', escape(click_url));b.addVariable('clickTag', escape(click_url));b.addVariable('clickTAG', escape(click_url));
  100. //b.addVariable('url', click_url);b.addVariable('link1', click_url);b.addVariable('bn_url', click_url);
  101. //b.addVariable('clickTag',click_url);b.addVariable('clickTAG', click_url);
  102.  
  103. };
  104. b.addVariable('menu', 'In new window,-URL-;http://c8.net.ua/,http://c8.net.ua/');
  105.  
  106. //curplayer.stopVideo();
  107.  
  108. if (c8_yfc_onplay)
  109. {
  110. curplayer.parentNode.insertBefore(c8net_newDiv,curplayer);
  111. curplayer.pause();
  112. curplayer.muted=true;
  113. jQuery(curplayer).hide();
  114. }
  115. else if (!c8_yfc_onlymove)
  116. {
  117. curplayer.height=1;
  118. curplayer.parentNode.insertBefore(c8net_newDiv,curplayer);
  119. curplayer.pauseVideo();
  120. curplayer.mute();
  121. }
  122. else
  123. {
  124. curplayer.parentNode.insertBefore(c8net_newDiv,curplayer);
  125. jQuery(curplayer).hide();
  126. };
  127.  
  128. b.write('c8net_preroll_div');
  129.  
  130. //c8net_newDiv.innerHTML='<object height="'+c8net_newDiv.style.height+'" width="'+c8net_newDiv.style.width+'" data="'+video_url+'" type="application/x-shockwave-flash"><param value="'+video_url+'" name="data"><param value="'+video_url+'" name="src"><param value="'+video_url+'" name="movie"><param name="allowscriptaccess" value="always" /><param value="auto high" name="quality"><param value="false" name="loop"><param value="false" name="menu"><param value="transparent" name="wmode"></object>';
  131.  
  132.  
  133.  
  134. setTimeout(c8net_preroll_load_tick, 1000);
  135. setTimeout('document.getElementById("c8net_skip_div").style.visibility = "";',5000);
  136. }
  137.  
  138. function c8net_preroll_callback_func_finish()
  139. {
  140. c8net_finish_preroll();
  141. }
  142.  
  143. function c8net_preroll_callback_func_error()
  144. {
  145. c8net_finish_preroll();
  146. }
  147.  
  148. function c8net_preroll_callback_func_start()
  149. {
  150. if (c8_yfc_onplay)
  151. {
  152. curplayer.pause();
  153. }
  154. else if (!c8_yfc_onlymove)
  155. {
  156. curplayer.pauseVideo();
  157. };
  158.  
  159. c8net_preroll_status='play';
  160. setTimeout(c8net_preroll_tick, 1000);
  161. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement