Class: Selenium::DevTools::V151::Media

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v151/media.rb

Constant Summary collapse

EVENTS =
{
  player_properties_changed: 'playerPropertiesChanged',
  player_events_added: 'playerEventsAdded',
  player_messages_logged: 'playerMessagesLogged',
  player_errors_raised: 'playerErrorsRaised',
  player_created: 'playerCreated',
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ Media

Returns a new instance of Media.



34
35
36
# File 'lib/selenium/devtools/v151/media.rb', line 34

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#disableObject



47
48
49
# File 'lib/selenium/devtools/v151/media.rb', line 47

def disable
  @devtools.send_cmd('Media.disable')
end

#enableObject



43
44
45
# File 'lib/selenium/devtools/v151/media.rb', line 43

def enable
  @devtools.send_cmd('Media.enable')
end

#on(event, &block) ⇒ Object



38
39
40
41
# File 'lib/selenium/devtools/v151/media.rb', line 38

def on(event, &block)
  event = EVENTS[event] if event.is_a?(Symbol)
  @devtools.callbacks["Media.#{event}"] << block
end