Class: Selenium::DevTools::V131::Media
- Inherits:
-
Object
- Object
- Selenium::DevTools::V131::Media
- Defined in:
- lib/selenium/devtools/v131/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
- #disable ⇒ Object
- #enable ⇒ Object
-
#initialize(devtools) ⇒ Media
constructor
A new instance of Media.
- #on(event, &block) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ Media
Returns a new instance of Media.
33 34 35 |
# File 'lib/selenium/devtools/v131/media.rb', line 33 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#disable ⇒ Object
46 47 48 |
# File 'lib/selenium/devtools/v131/media.rb', line 46 def disable @devtools.send_cmd('Media.disable') end |
#enable ⇒ Object
42 43 44 |
# File 'lib/selenium/devtools/v131/media.rb', line 42 def enable @devtools.send_cmd('Media.enable') end |
#on(event, &block) ⇒ Object
37 38 39 40 |
# File 'lib/selenium/devtools/v131/media.rb', line 37 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["Media.#{event}"] << block end |