This repository was archived by the owner on Mar 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
75 lines (65 loc) · 2.08 KB
/
app.js
File metadata and controls
75 lines (65 loc) · 2.08 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
var volume = 100;
var ua = navigator.userAgent.toLowerCase();
var is_android = ua.indexOf("android") > -1;
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
var is_ios = navigator.userAgent.toLowerCase().indexOf('ios') > -1;
var player, vol, playing = false, proc = true;
window.onhashchange = play;
jQuery(window).ready(function () {
jQuery('#slider').slider({
value: 100,
min: 0,
max: 100,
change: function (event, ui) {
volume = ui.value;
player.volume = volume / 100;
}
});
player = document.getElementById("player");
player.onplaying = playingCallBack;
jQuery("#play-btn.play").click(play);
player.volume = 1;
vol = player.volume;
proc = false;
if (location.hash === '#play') {
play();
jQuery('.link-site').attr('target', '_BLANK');
} else {
jQuery('.link-site').attr('target', '_SELF');
}
if (!is_android && !is_ios) {
jQuery('#vol-box').css('visibility', 'visible');
}
});
function play() {
if (!proc) {
if (player.paused) {
proc = true;
player.play();
jQuery("#play-btn").removeClass('play').removeClass('stop').addClass('load');
jQuery("#listen h2 span").html("CARREGANDO");
jQuery('.link-site').attr('target', '_BLANK');
} else {
player.pause();
jQuery("#play-btn").removeClass('load').removeClass('stop').addClass('play');
jQuery("#listen h2 span").html("OUÇA AGORA");
$("#animation").css("display","none")
jQuery('.link-site').attr('target', '_SELF');
}
}
}
function playingCallBack() {
if (is_android && is_chrome) {
setTimeout(playingFix, 15000);
} else {
playingFix();
}
}
function playingFix() {
playing = true;
proc = false;
jQuery("#play-btn").removeClass('play').removeClass('load').addClass('stop');
jQuery("#listen h2 span").html("NO AR");
$("#animation").css("display","block")
jQuery('.link-site').attr('target', '_BLANK');
}