``
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":"3339","tag":"3339","lang":"heb","logo":"https:\\/\\/dvirmedia.com\\/\\/events\\/posters\\/\\u05dc\\u05d5\\u05d2\\u05d5 \\u05d4\\u05dc\\u05db\\u05ea\\u05d06432fcc06d0bc.jpg","name":"\\u05d4\\u05dc\\u05db\\u05ea\\u05d0 \\u05d4\\u05e0\\u05d9\\u05d2\\u05d5\\u05df \\u05d4\\u05d9\\u05d4\\u05d5\\u05d3\\u05d9 \\u05e2\\u05dd \\u05d4\\u05e8\\u05d1 \\u05e4\\u05dc\\u05d0\\u05d9 \\u05e4\\u05e1\\u05d7","time":"2023-04-09 20:00:0.000","title":"\\u05e9\\u05de\\u05d7\\u05ea \\u05d7\\u05d2\\n\\u05e2\\u05dd \\u05d4\\u05de\\u05dc\\u05d7\\u05d9\\u05df \\u05d4\\u05e8\\u05d1 \\u05d4\\u05dc\\u05dc \\u05e4\\u05dc\\u05d0\\u05d9 ","before":"countdown","poster":"","source":"https:\\/\\/www.dropbox.com\\/s\\/epq4p7w6gnuvmpa\\/%D7%A9%D7%97%D7%94%D7%A4.mp4?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","show_in_homepage":"t","event_link_link_1":"","event_link_link_2":"","event_link_link_3":"","show_views_number":"t","zoom_instructions":"f","dial_for_listening":"t","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:\\/\\/ad110f8d013e.us-east-1.playback.live-video.net\\/api\\/video\\/v1\\/us-east-1.026666299757.channel.Tr8XEPbPEscw.m3u8","gdate":{"date":"4\\/9\\/2023","month":4,"day":9,"year":2023,"dow":0,"abbrevdayname":"Sun","dayname":"Sunday","abbrevmonth":"Apr","monthname":"April"},"hebdate":{"day":"\\u05d9\\u05d7","month":"\\u05e0\\u05d9\\u05e1\\u05df","year":"\\u05ea\\u05e9\\u05e4\\u05d2","dow":"\\u05d9\\u05d5\\u05dd \\u05e8\\u05d0\\u05e9\\u05d5\\u05df"}}`);
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;
//3339;
/*
array(0) {
}
*/
var videojsPlayer;
var lang = JSON.parse(`null`) ?? event_details['lang'] ?? 'heb';
var views_number = JSON.parse(`639`);
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 = $(`