blinker / firefox.plugin / data / scripts / actions / multimedia.js @ master
History | View | Annotate | Download (2.321 KB)
1 | 76dd22bd | KevinTaron | /*
|
---|---|---|---|
2 | * Copyright 2015 Thies Pfeiffer and Dimitri Heil and Kevin Taron
|
||
3 | * Blinker is distributed under the terms of the GNU General Public License
|
||
4 | *
|
||
5 | * This file is part of Blinker.
|
||
6 | *
|
||
7 | * Blinker is free software: you can redistribute it and/or modify
|
||
8 | * it under the terms of the GNU General Public License as published by
|
||
9 | * the Free Software Foundation, either version 3 of the License, or
|
||
10 | * (at your option) any later version.
|
||
11 | *
|
||
12 | * Blinker is distributed in the hope that it will be useful,
|
||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
15 | * GNU General Public License for more details.
|
||
16 | *
|
||
17 | * You should have received a copy of the GNU General Public License
|
||
18 | * along with Blinker. If not, see <http://www.gnu.org/licenses/>.
|
||
19 | */
|
||
20 | |||
21 | function vidplay() { |
||
22 | var video = $('video.openedElement')[0]; |
||
23 | if (video.paused) {
|
||
24 | video.play(); |
||
25 | } else {
|
||
26 | video.pause(); |
||
27 | } |
||
28 | } |
||
29 | |||
30 | function vidpause() { |
||
31 | var video = $('video.openedElement')[0]; |
||
32 | video.pause(); |
||
33 | } |
||
34 | |||
35 | function restart() { |
||
36 | var video = $('video.openedElement')[0]; |
||
37 | video.currentTime = 0;
|
||
38 | } |
||
39 | |||
40 | function skip(value) { |
||
41 | var video = $('video.openedElement')[0]; |
||
42 | video.currentTime += value; |
||
43 | } |
||
44 | |||
45 | function vidvol(value) { |
||
46 | var video = $('video.openedElement')[0]; |
||
47 | video.volume = value; |
||
48 | } |
||
49 | |||
50 | function vidFullscreen() { |
||
51 | $('.gazeFullScreen').click(function(event) { |
||
52 | var video = $('video.openedElement')[0]; |
||
53 | if (video.requestFullscreen) {
|
||
54 | video.requestFullscreen(); |
||
55 | } else if (video.mozRequestFullScreen) { |
||
56 | video.mozRequestFullScreen(); |
||
57 | } else if (video.webkitRequestFullscreen) { |
||
58 | video.webkitRequestFullscreen(); |
||
59 | } |
||
60 | }); |
||
61 | } |
||
62 | |||
63 | function gazeFullscreenclick() { |
||
64 | $('.gazeFullScreen').click(); |
||
65 | } |
||
66 | |||
67 | |||
68 | function audplay() { |
||
69 | var audio = $('audio.openedElement')[0]; |
||
70 | if (audio.paused) {
|
||
71 | audio.play(); |
||
72 | } else {
|
||
73 | audio.pause(); |
||
74 | } |
||
75 | } |
||
76 | |||
77 | function audpause() { |
||
78 | var audio = $('audio.openedElement')[0]; |
||
79 | audio.pause(); |
||
80 | } |
||
81 | |||
82 | function audrestart() { |
||
83 | var audio = $('audio.openedElement')[0]; |
||
84 | audio.currentTime = 0;
|
||
85 | } |
||
86 | |||
87 | function audskip(value) { |
||
88 | var audio = $('audio.openedElement')[0]; |
||
89 | audio.currentTime += value; |
||
90 | } |
||
91 | |||
92 | function audvol(value) { |
||
93 | var audio = $('audio.openedElement')[0]; |
||
94 | audio.volume = value; |
||
95 | } |