-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplayer-header.js
36 lines (33 loc) · 1.28 KB
/
player-header.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function player_update_live_show(showObject)
{
console.log(new Date().toLocaleString(), "player_update_live_show: ", showObject);
if (!is_live) {
return true;
}
if (!showObject)return false;
if (!showObject.start || !showObject.end) {
var currHour = new Date().getHours();
showObject.start = currHour + ":00";
showObject.end = (currHour + 1) + ":00";
}
showObject.dj = showObject.dj || "הקצה";
showObject.show = showObject.show || "הקצה נונסטופ";
showObject.image = showObject.image || '/wp-content/uploads/2018/11/pexels-photo-744318.jpeg';
function setJPlayerDetails(prefix) {
document.getElementById("jplayer_title").innerHTML = prefix + ": "+showObject.show+" / "+showObject.dj;
document.getElementById("jp-current-time").style.display = "block";
document.getElementById("jp-duration").style.display = "none";
document.getElementById("jp-ball").style.display = "none";
document.getElementById('player_image_div').style.backgroundImage="url("+showObject.image+")";
}
var title = document.getElementById("jplayer_title");
if (!title || title.length === 0) {
setTimeout(function() {
setJPlayerDetails("בשידור");
}, 500);
}
else
{
setJPlayerDetails("שידור חי");
}
}