`` function iOS() { return [ 'iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod' ].includes(navigator.platform) // iPad on iOS 13 detection || (navigator.userAgent.includes("Mac") && "ontouchend" in document) } function resizechatframe(iframe) { iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px'; } var event_details = JSON.parse(`{"event_id":"3378","tag":"3378","lang":"heb","logo":"\\/events\\/posters\\/\\u05db\\u05e0\\u05e1 \\u05d4\\u05db44\\u05e0\\u05d4 \\u05d4\\u05d6\\u05de\\u05e0\\u05d4 \\u05ea\\u05e9\\u05e4\\u05d162e1a2042a8e1.jpg","name":"\\u05dc\\u05d1 \\u05e9\\u05d5\\u05de\\u05e2 \\u05db\\u05e0\\u05e1 \\u05d4\\u05db\\u05e0\\u05d4 \\u05dc\\u05d9\\u05e9\\u05d9\\u05d1\\u05d4 \\u05d2\\u05d3\\u05d5\\u05dc\\u05d4 \\u05d4\\u05ea\\u05e9\\u05e4\\u05d2","time":"2023-07-20 19:00:0.000","title":"\\"\\u05dc\\u05d1 \\u05e9\\u05d5\\u05de\\u05e2\\"\\n\\u05db\\u05e0\\u05e1 \\u05d4\\u05db\\u05e0\\u05d4 \\u05dc\\u05d9\\u05e9\\u05d9\\u05d1\\u05d4 \\u05d2\\u05d3\\u05d5\\u05dc\\u05d4\\n","before":"countdown","poster":"https:\\/\\/dvirmedia.com\\/\\/events\\/posters\\/WhatsApp Image 2023-07-17 at 13.01.3364bcda98ab960.jpg","source":"https:\\/\\/www.dropbox.com\\/scl\\/fi\\/kl1jigq2akc3ovp0n2ue9\\/.mp4?rlkey=gmr0hgo817vj10y8kkxe3khx2&dl=0","status":"recorded","vimeo_url":"https:\\/\\/vimeo.com\\/event\\/577690\\/embed","guest_list":"no","vimeo_name":"\\u05e0\\u05d2\\u05df \\u05e8\\u05d0\\u05e9\\u05d9","backup_name":"\\u05e0\\u05d2\\u05df \\u05d2\\u05d9\\u05d1\\u05d5\\u05d9","broadcasting":"f","backup_player":"no","broadcastingt":"f","deny_filtered":"f","private_event":"f","secondary-title":"\\u05d1\\u05d1\\u05e8\\u05db\\u05ea\\u05dd \\u05d5\\u05d1\\u05d4\\u05db\\u05d5\\u05d5\\u05e0\\u05ea\\u05dd \\u05e9\\u05dc \\u05de\\u05e8\\u05e0\\u05df \\u05d5\\u05e8\\u05d1\\u05e0\\u05df \\u05d2\\u05d3\\u05d5\\u05dc\\u05d9 \\u05d9\\u05e9\\u05e8\\u05d0\\u05dc \\u05e9\\u05dc\\u05d9\\u05d8\\"\\u05d0","show_in_homepage":"t","event_link_link_1":"https:\\/\\/www.dropbox.com\\/s\\/l798ylirgw4a5s8\\/%D7%A2%D7%9C%D7%95%D7%9F%20%D7%9B%D7%A0%D7%A1%20%D7%91%D7%97%D7%95%D7%A8%D7%99%D7%9D%20%D7%9C%D7%A9%D7%9C%D7%99%D7%97%D7%94%20%D7%91%D7%9E%D7%99%D7%99%D7%9C.pdf?dl=0","event_link_link_2":"https:\\/\\/www.dropbox.com\\/s\\/l798ylirgw4a5s8\\/%D7%A2%D7%9C%D7%95%D7%9F%20%D7%9B%D7%A0%D7%A1%20%D7%91%D7%97%D7%95%D7%A8%D7%99%D7%9D%20%D7%9C%D7%A9%D7%9C%D7%99%D7%97%D7%94%20%D7%91%D7%9E%D7%99%D7%99%D7%9C.pdf?dl=1","event_link_link_3":"","show_views_number":"f","zoom_instructions":"f","dial_for_listening":"f","event_link_title_1":"\\u05dc\\u05e6\\u05e4\\u05d9\\u05d9\\u05d4 \\u05d1\\u05e2\\u05dc\\u05d5\\u05df \\u05d4\\u05d4\\u05d3\\u05e8\\u05db\\u05d4 \\u05dc\\u05e2\\u05d5\\u05dc\\u05d9\\u05dd \\u05dc\\u05d9\\u05e9\\u05d9\\u05d1\\u05d4 \\u05d2\\u05d3\\u05d5\\u05dc\\u05d4 \\u05dc\\u05d7\\u05e5 \\u05db\\u05d0\\u05df","event_link_title_2":"\\u05dc\\u05d4\\u05d5\\u05e8\\u05d3\\u05ea \\u05e2\\u05dc\\u05d5\\u05df \\u05d4\\u05d4\\u05d3\\u05e8\\u05db\\u05d4 \\u05dc\\u05de\\u05d7\\u05e9\\u05d1 \\u05dc\\u05d7\\u05e5 \\u05db\\u05d0\\u05df","event_link_title_3":"","recorded_need_password":"f","show_playback_download":"f","backup_amazon_player_url":"https:\\/\\/ad110f8d013e.us-east-1.playback.live-video.net\\/api\\/video\\/v1\\/us-east-1.026666299757.channel.Tr8XEPbPEscw.m3u8","gdate":{"date":"7\\/20\\/2023","month":7,"day":20,"year":2023,"dow":4,"abbrevdayname":"Thu","dayname":"Thursday","abbrevmonth":"Jul","monthname":"July"},"hebdate":{"day":"\\u05d1","month":"\\u05d0\\u05d1","year":"\\u05ea\\u05e9\\u05e4\\u05d2","dow":"\\u05d9\\u05d5\\u05dd \\u05d7\\u05de\\u05d9\\u05e9\\u05d9"}}`); if (event_details.UsersChat=='t') { document.addEventListener("DOMContentLoaded", (event) => { document.getElementById('chatframe').style.display = 'block'; document.getElementById('chatframe').src="./chat?event="+event_details.event_id; }); } var is_logged = false;// JSON.parse(`false`); var tempo; //3378; /* array(0) { } */ var videojsPlayer; var lang = JSON.parse(`null`) ?? event_details['lang'] ?? 'heb'; var views_number = JSON.parse(`null`); function set_event_details(){ // const event_date = new Date(event_details['time'].replace('T', ' ')); const event_date = moment(event_details['time'].replace(/-/g, "/"), "YYYY/MM/DD hh:mm:s.SSS a").toDate(); // Safari compatibility... document.getElementById('event-title').innerHTML = event_details['title']?.replaceAll?.(/\n/g, '
') ?? ''; document.getElementById('event-subtitle').innerHTML = event_details['secondary-title']?.replaceAll?.(/\n/g, '
') ?? ''; document.getElementById('event-h-date').innerHTML = `${event_details['hebdate']['day']} ${event_details['hebdate']['month']}${event_details['hebdate']['year']}`; let begin_time; if (lang == 'en'){ document.getElementById('event-g-date').innerHTML = `${event_details['gdate']['month']}/${event_details['gdate']['day']}${event_details['gdate']['year']}`; document.getElementById('event-day').innerHTML = `${event_details.gdate.abbrevdayname}`; document.getElementById('event-g-date').after(document.getElementById('event-h-date')); begin_time = 'Live broadcasting will begin at' } else { document.getElementById('event-g-date').innerHTML = `${event_details['gdate']['day']}/${event_details['gdate']['month']}${event_details['gdate']['year']}`; document.getElementById('event-day').innerHTML = `${event_details.hebdate.dow}`; document.getElementById('event-g-date').before(document.getElementById('event-h-date')); begin_time = 'השידור יתחיל בשעה' } if (event_details.status == 'live'){ document.getElementById('event-time').textContent = `${begin_time} ${event_date.getHours().toString().padStart(2, '0')}:${event_date.getMinutes().toString().padStart(2, '0')}`; if (event_details['dial_for_listening'] == 'f'){ document.querySelector('.listening-broadcast-btn')?.remove?.(); } } else { document.getElementById('event-time')?.remove?.(); Array.from(document.querySelectorAll('.button-after-player')).forEach(el => el.remove()); if(event_details['show_playback_download'] == 't'){ let dbn = downloadButtonNode.cloneNode(true); document.querySelector('.buttons-after-player-wrapper').appendChild(dbn); dbn.addEventListener('click', ()=>download(event_details['source'])); } } document.querySelector('.text-about-event').innerHTML = event_details['footer']?.replaceAll?.(/\n/g, '
') ?? ''; document.querySelector('.refresh-btn')?.addEventListener('click', () => location.reload()); document.querySelector('.event-ad').src = event_details['poster']; document.getElementById('event-logo-img').src = event_details['logo']; // views number if (event_details["show_views_number"] != "t"){ document.querySelector('.video-views-number')?.remove?.(); } else { document.getElementById('views-number').innerText = views_number; } // set event links: let event_link_wrapper = document.getElementById('event-links-wrapper'); let event_link_btns = document.querySelectorAll('.event-link-btn'); let event_link_btn = event_link_btns[0]; Array.from(event_link_btns).forEach(el => el.remove()); [...Array(3).keys()].forEach(i => { let event_link_title = event_details[`event_link_title_${i+1}`]; let event_link_link = event_details[`event_link_link_${i+1}`]; if (event_link_title){ let new_elb = event_link_btn.cloneNode(true); new_elb.href = event_link_link; new_elb.querySelector('span').innerHTML = event_link_title.replace(/\*(.*?)\*/g, "$1");; document.getElementById('event-links-wrapper').appendChild(new_elb); } }) } class VideoBox { players = []; c_player; constructor(el ,players, zoom=false){ this.element = el; this.videoBox = this.element.querySelector('.video-player-box'); this.btnBox = this.element.querySelector('.buttons-before-player-wrapper'); this.btnBox.innerHTML = ''; players.forEach(p => this.add_player(p)); if (zoom){ this.add_zoom_player(new Player('נגן זום', '', 'zoom')); } this.current_player = players[0]; } get current_player(){ return this.c_player; } set current_player(player){ $(this.videoBox).html(player.element); // if (player.type == 'videojs' && !iOS()){ // videojs(player.element);//.src(url); // } this.players.forEach(p => p.button.classList.remove('active')) player.button.classList.add('active'); } add_player(player){ this.players.push(player); if (player.button){ this.btnBox.appendChild(player.button); } player.box = this; } add_zoom_player(player){ this.add_player(player); let open_zoom_btn = openZoomButtonNode.cloneNode(true); open_zoom_btn.addEventListener('click', ()=>window.open(`${event_details.zoom_meeting_id?.replaceAll(' ', '')}?pwd=`+event_details.zoom_passcode, '_blank')) this.btnBox.appendChild(open_zoom_btn) } } function getzoomid(s) { let a=s.split('/'); let b=a[a.length-1]; return b; } class Player{ static create_button(name, type){ let button = type == 'zoom'? zoomButtonNode.cloneNode(true) : playerButtonNode.cloneNode(true); button.getElementsByTagName('span')[0].innerHTML = name; return button; } static create_vimeo_el(url){ var urlstr=url; url = new URL(url); if (url.hostname === 'vimeo.com' && !url.pathname.endsWith('embed')){ url.hostname = 'player.vimeo.com'; url.pathname = 'video' + url.pathname; } { let el = $(``)[0]; el.width = el.height = '100%'; return el; } } static create_amazone_el(url, type){ var urlstr=url; if (urlstr.indexOf('iframe')>-1) { let el=$(urlstr) return el; } let el = $(``)[0]; el.width = el.height = '100%'; return el; } static create_videojs_el(url, type){ url = new URL(url); if (url.hostname === 'www.dropbox.com'){ url.hostname = 'dl.dropbox.com'; // url.search = ''; } let el = $(`
`)[0]; el.width = el.height = '100%'; return el; } static create_zoom_el() { let el = $(``)[0]; el.width = el.height = '100%'; return el; } constructor(name, url, type){ this.name = name; this.url = url; this.type = type; this.button = Player.create_button(this.name, type); if (type){ switch (type) { case 'vimeo': this.element = Player.create_vimeo_el(url); break; case 'videojs': this.element = Player.create_videojs_el(url, "video/mp4"); break; // case 'amazon' : this.element = Player.create_videojs_el(url, "application/x-mpegURL"); break; case 'amazon' : this.element = Player.create_amazone_el(url, "application/x-mpegURL"); break; case 'zoom': this.element = Player.create_zoom_el(); break; } this.button.addEventListener('click', ()=>this.box.current_player = this); } } } class Modal{ constructor(content, close='.close-popup') { this.element = document.createElement('div'); this.element.style.cssText = "position: fixed; top:0; left:0; width: 100%; height: 100%; display: none; justify-content: center; align-items: center; z-index:100;" this.content = content; document.body.appendChild(this.element); this.element.appendChild(this.content); let self = this; if (close != false){ this.element.onclick = function(event){ if (event.target == this){ self.hide(); } }; content.querySelectorAll(close).forEach(el => el.addEventListener("click", () => this.hide())) } } show(){ this.element.style.display = 'flex'; } hide(){ this.element.style.display = 'none'; } } function get_players(before=false){ let players = [] if (event_details['amazon_default']==1) { if (event_details['backup_player'] != 'no'){ players.push(new Player(event_details['backup_name'] ?? 'נגן גיבוי', event_details[`backup_${event_details['backup_player']}_player_url`] ?? event_details[`backup_player_url`], !before ? event_details['backup_player'] : '' )); } if (event_details['vimeo_url']){ players.push(new Player(event_details['vimeo_name'] ?? 'נגן ראשי', event_details['vimeo_url'], !before ? 'vimeo' : '')); } } else { if (event_details['vimeo_url']){ players.push(new Player(event_details['vimeo_name'] ?? 'נגן ראשי', event_details['vimeo_url'], !before ? 'vimeo' : '')); } if (event_details['backup_player'] != 'no'){ players.push(new Player(event_details['backup_name'] ?? 'נגן גיבוי', event_details[`backup_${event_details['backup_player']}_player_url`] ?? event_details[`backup_player_url`], !before ? event_details['backup_player'] : '' )); } } return players; } function get_counter_el(){ let el = $(`
`)[0]; el.width = el.height = '100%'; return el; } function get_before_poster(){ return $(`
`)[0]; } function get_before_message(){ return $(`
האירוע עדיין לא החל
This event has not started yet
`)[0]; } function get_before_el(){ switch (event_details['before']){ case 'countdown': return get_counter_el(); case 'message': return get_before_message(); case 'poster': return get_before_poster(); } } function set_video_box(){ const video_wrapper = document.querySelector('.video-player-wrapper'); if (event_details['status'] == 'live'){ if (event_details['broadcasting'] != 'f' || new Date() > new Date(event_details['time'])){ let players = get_players(); if (players.length){ videoBox = new VideoBox(video_wrapper, get_players(), event_details.zoom_meeting_id); } } else { let before_el = get_before_el(); let vp_box = video_wrapper.querySelector('.video-player-box'); vp_box.parentNode.replaceChild(before_el, vp_box); setInterval(() =>{ if (new Date() > new Date(event_details['time'])){ location.reload(); } }, 1000); let players = get_players(); if (players.length){ videoBox = new VideoBox(video_wrapper, get_players(before=true), event_details.zoom_meeting_id); } } } else if (event_details['status'] == 'recorded'){ if (event_details['source']){ let player_type = (event_details['source'].startsWith("https://player.vimeo.com/") || event_details['source'].startsWith("https://vimeo.com/")) ? 'vimeo' : 'videojs'; videoBox = new VideoBox(video_wrapper, [new Player('שידור חוזרPlayback', event_details['source'], player_type)], false); } } } function unfeature(){ document.querySelector('.r-nav').style.visibility = 'hidden'; document.getElementById('write-greetings-and-more-broadcasts-wrapper').remove(); document.querySelector('.fixed-write-greeting-btn-wrapper').remove(); document.querySelectorAll('.body-wrapper')[1].remove(); } function set_language(l){ lang = l; // $('#language-toggle').prop('checked', lang == 'heb'); // let dirs = {en:'ltr', heb:'rtl'}; // let dir = dirs[lang]; // $('html').attr('lang', lang); // $('body').css('direction', dir); // set_event_details(); $('#language-toggle').prop('checked', lang == 'heb'); let dirs = {en:'ltr', heb:'rtl'}; // let dir = dirs[lang]; $('html').attr('lang', lang); $('body').removeClass('lang-heb').removeClass('lang-en').addClass(`lang-${lang}`); set_event_details(); } function download(url) { url = new URL(url); var us=url.search; if ((us) && (us.indexOf('&dl=0')>-1)) us=us.replace(/&dl=0/,'&dl=1') else us+='&dl=1' if (url.hostname === 'www.dropbox.com'){ url.hostname = 'dl.dropbox.com'; url.search = us; } const a = document.createElement('a') a.href = url a.download = url.pathname.split('/').pop() document.body.appendChild(a) a.click() document.body.removeChild(a) } var playerButtonNode, playerButtonBox, zoomButtonNode, openZoomButtonNode, videoBox, downloadButtonNode; var techSuppModal; $(function() { techSuppModal = new Modal(document.getElementById('technical-support')); listeningBroadcastModal = new Modal(document.getElementById('listening-broadcast')); if (!is_logged && event_details['status'] == 'recorded' && event_details['recorded_need_password'] == 't'){ (new Modal(document.getElementById('password-popup'), false)).show(); } if (!is_logged && event_details['password'] ){ (new Modal(document.getElementById('password-popup'), false)).show(); } downloadButtonNode = document.getElementById('download-btn').cloneNode(true); set_language(lang); // set_event_details(); document.querySelector('.chat-button').remove(); playerButtonNode = document.querySelector('.main-player-btn').cloneNode(true); zoomButtonNode = document.querySelector('.zoom-player-btn').cloneNode(true); openZoomButtonNode = document.querySelector('.open-zoom-app-btn').cloneNode(true); set_video_box(); playerButtonBox = document.querySelector('.buttons-before-player-wrapper'); if (views_number != null){ const views_number_updater = setInterval(async() => { views_number = await action('get_views_number', [JSON.parse(`3378`)]) document.getElementById('views-number').innerText = views_number; // clearInterval(views_number_updater); }, 1000); } $('#technical-support .solutions-panel').on('click', function(){ techSuppModal.content.querySelectorAll('.solutions-panel').forEach(el => {if (el != this) el.classList.remove('active')}); this.classList.toggle('active'); }) $('.technical-support-btn').on('click', function() { // techSuppModal.content.querySelector('#broadcast-support-form').classList.remove('active'); techSuppModal.content.querySelectorAll('.solutions-panel').forEach(el => el.classList.remove('active')); techSuppModal.show(); }) var isfull = false; $('.full-width-btn').on('click', function() { if (isfull) { $('.video-player-wrapper').css('max-width','952px'); isfull=false } else { $('.video-player-wrapper').css('max-width','99vw'); isfull=true } }) $('.listening-broadcast-btn').on('click', function() { listeningBroadcastModal.show(); }) $('#language-toggle').on('input', function() { let lang = this.checked ? 'heb' : 'en'; set_language(lang); }) // $('#broadcast-support-mail').on('click', function() { // techSuppModal.content.querySelectorAll('.solutions-panel').forEach(el => {el.classList.remove('active')}); // techSuppModal.content.querySelector('#broadcast-support-form').classList.add('active'); // }) unfeature(); document.getElementById('body-scroll').style = 'unset'; })