Class: Selenium::DevTools::V128::Media

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

Constant Summary collapse

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

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ Media

Returns a new instance of Media.



33
34
35
# File 'lib/selenium/devtools/v128/media.rb', line 33

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#disableObject



46
47
48
# File 'lib/selenium/devtools/v128/media.rb', line 46

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

#enableObject



42
43
44
# File 'lib/selenium/devtools/v128/media.rb', line 42

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

#on(event, &block) ⇒ Object



37
38
39
40
# File 'lib/selenium/devtools/v128/media.rb', line 37

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