forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
showOnTV.js
35 lines (35 loc) · 1.08 KB
/
showOnTV.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
$(document).ready(function () {
$(document).keyup(function (e) {
if (typeof window.parent.closeLiveVideo === "function") {
parent.focus();
window.parent.focus();
}
if (e.key === "Escape") {
if (typeof window.parent.closeLiveVideo === "function") {
e.preventDefault();
parent.focus();
window.parent.focus();
window.parent.closeLiveVideo();
}
} else if (e.key === "ArrowUp") {
e.preventDefault();
var volume = player.volume();
volume += 0.1;
if (volume > 1) {
volume = 1;
}
console.log(volume);
player.muted(false);
player.volume(volume);
} else if (e.key === "ArrowDown") {
e.preventDefault();
var volume = player.volume();
volume -= 0.1;
if (volume < 0) {
volume = 0;
}
console.log(volume);
player.volume(volume);
}
});
});