Class: Selenium::DevTools::V128::Cast
- Inherits:
-
Object
- Object
- Selenium::DevTools::V128::Cast
- Defined in:
- lib/selenium/devtools/v128/cast.rb
Constant Summary collapse
- EVENTS =
{ sinks_updated: 'sinksUpdated', issue_updated: 'issueUpdated', }.freeze
Instance Method Summary collapse
- #disable ⇒ Object
- #enable(presentation_url: nil) ⇒ Object
-
#initialize(devtools) ⇒ Cast
constructor
A new instance of Cast.
- #on(event, &block) ⇒ Object
- #set_sink_to_use(sink_name:) ⇒ Object
- #start_desktop_mirroring(sink_name:) ⇒ Object
- #start_tab_mirroring(sink_name:) ⇒ Object
- #stop_casting(sink_name:) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ Cast
Returns a new instance of Cast.
30 31 32 |
# File 'lib/selenium/devtools/v128/cast.rb', line 30 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#disable ⇒ Object
44 45 46 |
# File 'lib/selenium/devtools/v128/cast.rb', line 44 def disable @devtools.send_cmd('Cast.disable') end |
#enable(presentation_url: nil) ⇒ Object
39 40 41 42 |
# File 'lib/selenium/devtools/v128/cast.rb', line 39 def enable(presentation_url: nil) @devtools.send_cmd('Cast.enable', presentationUrl: presentation_url) end |
#on(event, &block) ⇒ Object
34 35 36 37 |
# File 'lib/selenium/devtools/v128/cast.rb', line 34 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["Cast.#{event}"] << block end |
#set_sink_to_use(sink_name:) ⇒ Object
48 49 50 51 |
# File 'lib/selenium/devtools/v128/cast.rb', line 48 def set_sink_to_use(sink_name:) @devtools.send_cmd('Cast.setSinkToUse', sinkName: sink_name) end |
#start_desktop_mirroring(sink_name:) ⇒ Object
53 54 55 56 |
# File 'lib/selenium/devtools/v128/cast.rb', line 53 def start_desktop_mirroring(sink_name:) @devtools.send_cmd('Cast.startDesktopMirroring', sinkName: sink_name) end |
#start_tab_mirroring(sink_name:) ⇒ Object
58 59 60 61 |
# File 'lib/selenium/devtools/v128/cast.rb', line 58 def start_tab_mirroring(sink_name:) @devtools.send_cmd('Cast.startTabMirroring', sinkName: sink_name) end |
#stop_casting(sink_name:) ⇒ Object
63 64 65 66 |
# File 'lib/selenium/devtools/v128/cast.rb', line 63 def stop_casting(sink_name:) @devtools.send_cmd('Cast.stopCasting', sinkName: sink_name) end |