module MVLC::Instructions::Player

Instructions dealing with the video player

Private Class Methods

included(base) click to toggle source

Add delegators to local player methods

# File lib/mvlc/instructions/player.rb, line 28
def self.included(base)
  base.send(:extend, Forwardable)
  base.send(:def_delegators, :@player, :active?, :play)
end

Public Instance Methods

end_of_file(&callback)
Alias for: on_end_of_file
eof(&callback)
Alias for: on_end_of_file
on_end_of_file(&callback) click to toggle source

Assign a callback for when a file finishes playback @param [Proc] callback The callback to execute when a file finishes playback @return [Hash]

# File lib/mvlc/instructions/player.rb, line 19
def on_end_of_file(&callback)
  @player.add_end_of_file_callback(&callback)
end
Also aliased as: end_of_file, eof
on_progress(&callback) click to toggle source

Assign a callback for updating progress @param [Proc] callback The callback to execute when progress is updated @return [Hash]

# File lib/mvlc/instructions/player.rb, line 11
def on_progress(&callback)
  @player.add_progress_callback(&callback)
end
Also aliased as: progress
progress(&callback)
Alias for: on_progress

Private Instance Methods

method_missing(method, *args, &block) click to toggle source

Add all of the video player methods to the context as instructions

Calls superclass method
# File lib/mvlc/instructions/player.rb, line 34
def method_missing(method, *args, &block)
  if @player.respond_to?(method)
    @player.send(method, *args, &block)
  else
    super
  end
end
respond_to_missing?(method, include_private = false) click to toggle source

Add all of the video player methods to the context as instructions

Calls superclass method
# File lib/mvlc/instructions/player.rb, line 43
def respond_to_missing?(method, include_private = false)
  super || @player.respond_to?(method)
end