Module: Pecari::Player

Defined in:
lib/pecari/player.rb

Class Method Summary collapse

Class Method Details

.exitObject



43
44
45
# File 'lib/pecari/player.rb', line 43

def self.exit
  Pecari::PidKiller.kill_all_omx_processes
end

.launch(video) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/pecari/player.rb', line 5

def self.launch(video)
  check_dependencies
  command = "#{Pecari::Env.display} && xterm -fullscreen -fg black -bg black -e omxplayer -o hdmi '#{video}' &"
  fork do
    exec command
  end
end

.play_pauseObject



13
14
15
16
# File 'lib/pecari/player.rb', line 13

def self.play_pause
  check_dependencies
  `#{Pecari::Env.display} && xdotool windowactivate #{omx_window} && xdotool key p`
end

.quitObject



18
19
20
21
# File 'lib/pecari/player.rb', line 18

def self.quit
  check_dependencies
  `#{Pecari::Env.display} && xdotool windowactivate #{omx_window} && xdotool key q`
end

.seek_backwardObject



38
39
40
41
# File 'lib/pecari/player.rb', line 38

def self.seek_backward
  check_dependencies
  `#{Pecari::Env.display} && xdotool windowactivate #{omx_window} && xdotool key Left`
end

.seek_forwardObject



33
34
35
36
# File 'lib/pecari/player.rb', line 33

def self.seek_forward
  check_dependencies
  `#{Pecari::Env.display} && xdotool windowactivate #{omx_window} && xdotool key Right`
end

.volume_downObject



28
29
30
31
# File 'lib/pecari/player.rb', line 28

def self.volume_down
  check_dependencies
  `#{Pecari::Env.display} && xdotool windowactivate #{omx_window} && xdotool key minus`
end

.volume_upObject



23
24
25
26
# File 'lib/pecari/player.rb', line 23

def self.volume_up
  check_dependencies
  `#{Pecari::Env.display} && xdotool windowactivate #{omx_window} && xdotool key plus`
end