<script> var width=0; var height=0; var lang = 'ua'; var autostart = 0; var mainPlayerWrapper = jQuery('.main_player_wrapper'); var cosmoframeElement = jQuery('#cosmoframe_player_2'); var iframe_src; function wHSetter(computeSrc){ width = mainPlayerWrapper.width(); height = Math.round(width/16*9); iframe_src = 'https://live-ictv.cosmonova.net.ua/online.php?width=' + width + '&height=' + height + '&lang=' + lang + '&autostart=' + autostart; cosmoframeElement.css( { width: width+'px', height: height+'px' } ); var cosmoAttr = { width: width, height: height }; if (computeSrc) cosmoAttr.src = 'https://live-ictv.cosmonova.net.ua/online.php?width='+width+'&height='+height+'&lang='+lang+'&autostart='+autostart; cosmoframeElement.attr(cosmoAttr); } function adt_player (){ width = mainPlayerWrapper.width(); height = Math.round(width/16*9); jQuery('#player-look-2').css({'width':width+'px', 'height': height+'px'}); jQuery('#player-stop-video').css({'width':width+'px', 'height': height+'px'}); var ADDITIONAL_VAST_URLS = [ { type: 'pre-roll', url: 'https://ua-vast.vertamedia.com/?content_page_url={replace_me}&player_width='+width+'&player_height='+height+'&video_duration=500&cb={replace_me}&format={replace_me}&site_id=ICTV_Streaming&placement_id=&vpaid_type=2&aid=489568' }, { type: 'pre-roll', url: 'https://ua-vast.vertamedia.com/?content_page_url={replace_me}&player_width='+width+'&player_height='+height+'&video_duration=500&cb={replace_me}&format={replace_me}&site_id=ICTV_Streaming&placement_id=&vpaid_type=2&aid=489568' } ]; var SOURCES = [{ id: 'HLSStream', poster: 'https://live-ictv.cosmonova.net.ua/images/offline-images/stub_ua.jpg', name: 'ICTV', description: 'Дивитись Онлайн', advertisement: { creatives: ADDITIONAL_VAST_URLS }, sources: [{ type: "application/x-mpegURL", source: [{ withCredentials: false, url: '//stream.tvstitch.com/ictv/master.m3u8' }] }] }]; if(!isAddBlock()) { jQuery.getJSON('https://geo-service.adtelligent.com/' , function(json){ if(json.country_code == 'UA') { window.player = adt.player('player-placement', { autoplay: false, skipCheckAutoplay: true, muted: false, volume: 0.5, groups: [{ playlist: SOURCES }] }); } else { jQuery('#player-placement').hide(); jQuery('#player-stop-video').show(); jQuery('#player-stop').show(); jQuery('#clear').addClass('clear'); } }); } else { jQuery('#player-placement').hide(); jQuery('#player-stop-video').show(); jQuery('#player-adbock').show(); jQuery('#clear').addClass('clear'); } } function isAddBlock() { var box = document.getElementById('adblock'); if(!box.getBoundingClientRect().width) var isAdBlock = true; else var isAdBlock = false; return isAdBlock; } jQuery(document).ready(function ($) { wHSetter(true); adt_player(); }); jQuery(window).resize(function ($) { wHSetter(false); }); function playerLook (player){ width = jQuery('.main_player_wrapper').width(); height = Math.round(width/16*9); lang = 'ua'; autostart = 0; iframe_src = 'https://live-ictv.cosmonova.net.ua/online.php?width=' + width + '&height=' + height + '&lang=' + lang + '&autostart=' + autostart; if(player == 1) { jQuery('#player-look-'+2).hide(); jQuery('#player-look-'+1).find('iframe').attr('src', iframe_src); if (typeof window.player != "undefined") { window.player.destroy(); window.player = void 0; } } else { jQuery('#player-look-'+1).hide(); jQuery('#player-look-'+1).find('iframe').attr('src', ''); if (typeof window.player == "undefined") { adt_player(); } } jQuery('.player_text').removeClass('active_text'); jQuery('.player-'+player).addClass('active_text'); jQuery('#player-look-'+player).show(); } </script> |