Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function c8net_show_preroll(video_url,video_duration,banner_id,url_audit,url_audit2,source_width,source_height)
- {
- if (0>=video_duration || ""==video_url)
- {
- return;
- };
- 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();
- if(typeof jwplayer=="undefined") {
- var s = document.createElement('script');
- s.type = 'text/javascript';
- //s.async = true;
- s.src = 'https://b.c8.net.ua/b/js/jwplayer.js';
- s.onload=s.onreadystatechange=function()
- {
- if(!("readyState" in s)||/loaded|complete/.test(s.readyState))
- {
- s.onload=s.onreadystatechange=null;
- c8net_show_preroll_jw(video_url,video_duration,banner_id,url_audit,url_audit2,source_width,source_height);
- }
- }
- var p=document.getElementsByTagName('head')[0];
- p.appendChild(s);
- } else {
- c8net_show_preroll_jw(video_url,video_duration,banner_id,url_audit,url_audit2,source_width,source_height);
- }
- return;
- if (''!=url_audit)
- {
- img_audit=new Image();
- img_audit.src=url_audit+'&'+Math.random();
- };
- if (''!=url_audit2)
- {
- img_audit2=new Image();
- img_audit2.src=url_audit2+'&'+Math.random();
- };
- c8net_preroll_load_limit=10;
- c8net_preroll_duration=video_duration;
- c8net_preroll_curtime=video_duration;
- c8net_preroll_status='load';
- c8net_newDiv = document.createElement('div');
- c8net_newDiv.style.height=curplayer.height+"px";
- c8net_newDiv.style.width=curplayer.width+"px";
- c8net_newDiv.style.background='black';
- if (c8_yfc_onplay)
- {
- curplayer.pause();
- }
- else if (!c8_yfc_onlymove)
- {
- curplayer.pauseVideo();
- };
- //curplayer.style.visibility='hidden';
- 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> <span id="c8net_timer_div">'+c8net_preroll_curtime+'</span> sec ...</small> <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> <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>';
- var b = new SWFObject('https://b.c8.net.ua/s/preroll.swf', 'c8net_preroll_banner', curplayer.width, curplayer.height, '8', null);
- b.addParam('scale', 'noscale');
- b.addParam('salign', 'lt');
- if (-1==video_url.indexOf(".flv"))
- {
- b.addVariable('swf', video_url);
- }
- else
- {
- b.addVariable('flv', video_url);
- };
- //b.addVariable('swf', video_url);
- b.addVariable('hidelogo', 1);
- b.addVariable('hidetimer', 1);
- b.addVariable('w', curplayer.width);
- b.addVariable('h', curplayer.height);
- b.addVariable('wb', source_width); //1410
- b.addVariable('hb', source_height); //763
- b.addVariable('duration', video_duration);
- b.addParam('allowscriptaccess',"always");
- //b.addVariable('callback_func_finish', 'alert(\'\');c8net_finish_preroll');
- if (("undefined"!=typeof(click_url)) && (""!=click_url))
- {
- 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));
- //b.addVariable('url', click_url);b.addVariable('link1', click_url);b.addVariable('bn_url', click_url);
- //b.addVariable('clickTag',click_url);b.addVariable('clickTAG', click_url);
- };
- b.addVariable('menu', 'In new window,-URL-;http://c8.net.ua/,http://c8.net.ua/');
- //curplayer.stopVideo();
- if (c8_yfc_onplay)
- {
- curplayer.parentNode.insertBefore(c8net_newDiv,curplayer);
- curplayer.pause();
- curplayer.muted=true;
- jQuery(curplayer).hide();
- }
- else if (!c8_yfc_onlymove)
- {
- curplayer.height=1;
- curplayer.parentNode.insertBefore(c8net_newDiv,curplayer);
- curplayer.pauseVideo();
- curplayer.mute();
- }
- else
- {
- curplayer.parentNode.insertBefore(c8net_newDiv,curplayer);
- jQuery(curplayer).hide();
- };
- b.write('c8net_preroll_div');
- //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>';
- setTimeout(c8net_preroll_load_tick, 1000);
- setTimeout('document.getElementById("c8net_skip_div").style.visibility = "";',5000);
- }
- function c8net_preroll_callback_func_finish()
- {
- c8net_finish_preroll();
- }
- function c8net_preroll_callback_func_error()
- {
- c8net_finish_preroll();
- }
- function c8net_preroll_callback_func_start()
- {
- if (c8_yfc_onplay)
- {
- curplayer.pause();
- }
- else if (!c8_yfc_onlymove)
- {
- curplayer.pauseVideo();
- };
- c8net_preroll_status='play';
- setTimeout(c8net_preroll_tick, 1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement