`` 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":"3411","tag":"3411","lang":"heb","logo":"","name":"\\u05e2\\u05d8\\u05e8\\u05ea \\u05e9\\u05dc\\u05de\\u05d4 \\u05d0\\u05d7\\u05d9\\u05e1\\u05de\\u05da \\u05e9\\u05de\\u05d7\\u05ea \\u05d1\\u05d9\\u05ea \\u05d4\\u05e9\\u05d5\\u05d0\\u05d1\\u05d4","time":"2023-10-02 21:00:0.000","title":"\\u05e9\\u05de\\u05d7\\u05ea \\u05d1\\u05d9\\u05ea \\u05d4\\u05e9\\u05d5\\u05d0\\u05d1\\u05d4\\n\\u05d9\\u05e9\\u05d9\\u05d1\\u05ea \\u05e2\\u05d8\\u05e8\\u05ea \\u05e9\\u05dc\\u05de\\u05d4 \\u05d0\\u05d7\\u05d9\\u05e1\\u05de\\u05da","before":"countdown","poster":"https:\\/\\/dvirmedia.com\\/\\/events\\/posters\\/WhatsApp Image 2023-10-01 at 23.32.46_e961698b6519da86a6290.jpg","source":"https:\\/\\/www.dropbox.com\\/scl\\/fi\\/6a7lbvc8lx94b70tnra8p\\/TimeLineMovie.mp4?rlkey=4nnz8777h3g7f9rlg75ok6o5q&dl=0","status":"recorded","vimeo_url":"","guest_list":"no","vimeo_name":"\\u05e0\\u05d2\\u05df \\u05e8\\u05d0\\u05e9\\u05d9","backup_name":"\\u05e9\\u05de\\u05d7\\u05ea \\u05d1\\u05d9\\u05ea \\u05d4\\u05e9\\u05d5\\u05d0\\u05d1\\u05d4","broadcasting":"t","backup_player":"amazon","broadcastingt":"t","deny_filtered":"f","private_event":"f","amazon_default":"1","show_in_homepage":"t","event_link_link_1":"","event_link_link_2":"","event_link_link_3":"","show_views_number":"f","zoom_instructions":"f","dial_for_listening":"f","event_link_title_1":"","event_link_title_2":"","event_link_title_3":"","recorded_need_password":"f","show_playback_download":"f","backup_amazon_player_url":"https:\\/\\/c35c548d04d54079abb2e6332a9cf801.msvdn.net\\/live\\/S46135552\\/XKS0z3O62aXl\\/playlist.m3u8","gdate":{"date":"10\\/2\\/2023","month":10,"day":2,"year":2023,"dow":1,"abbrevdayname":"Mon","dayname":"Monday","abbrevmonth":"Oct","monthname":"October"},"hebdate":{"day":"\\u05d9\\u05d6","month":"\\u05ea\\u05e9\\u05e8\\u05d9","year":"\\u05ea\\u05e9\\u05e4\\u05d3","dow":"\\u05d9\\u05d5\\u05dd \\u05e9\\u05e0\\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; //3411; /* 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(`3411`)]) 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'; })