``
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 = $(`