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