Class: Video
- Inherits:
-
Object
- Object
- Video
- Defined in:
- lib/flick/video.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#driver ⇒ Object
Returns the value of attribute driver.
-
#extended ⇒ Object
Returns the value of attribute extended.
-
#format ⇒ Object
Returns the value of attribute format.
-
#image_count ⇒ Object
Returns the value of attribute image_count.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#rate ⇒ Object
Returns the value of attribute rate.
-
#seconds ⇒ Object
Returns the value of attribute seconds.
-
#udid ⇒ Object
Returns the value of attribute udid.
Instance Method Summary collapse
- #android ⇒ Object
-
#initialize(options) ⇒ Video
constructor
A new instance of Video.
- #ios ⇒ Object
- #run ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(options) ⇒ Video
Returns a new instance of Video.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/flick/video.rb', line 5 def initialize Flick::Checker.action [:action] Flick::Checker.platform [:platform] Flick::Checker.format [:format] self.action = [:action] self.platform = [:platform] case self.platform when "ios" self.driver = Flick::Ios.new when "android" self.driver = Flick::Android.new end self.image_count = [:count] self.seconds = [:seconds].to_f self.rate = [:rate].to_f self.extended = [:extend].to_b self.udid = self.driver.udid self.format = [:format] end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
3 4 5 |
# File 'lib/flick/video.rb', line 3 def action @action end |
#driver ⇒ Object
Returns the value of attribute driver.
3 4 5 |
# File 'lib/flick/video.rb', line 3 def driver @driver end |
#extended ⇒ Object
Returns the value of attribute extended.
3 4 5 |
# File 'lib/flick/video.rb', line 3 def extended @extended end |
#format ⇒ Object
Returns the value of attribute format.
3 4 5 |
# File 'lib/flick/video.rb', line 3 def format @format end |
#image_count ⇒ Object
Returns the value of attribute image_count.
3 4 5 |
# File 'lib/flick/video.rb', line 3 def image_count @image_count end |
#platform ⇒ Object
Returns the value of attribute platform.
3 4 5 |
# File 'lib/flick/video.rb', line 3 def platform @platform end |
#rate ⇒ Object
Returns the value of attribute rate.
3 4 5 |
# File 'lib/flick/video.rb', line 3 def rate @rate end |
#seconds ⇒ Object
Returns the value of attribute seconds.
3 4 5 |
# File 'lib/flick/video.rb', line 3 def seconds @seconds end |
#udid ⇒ Object
Returns the value of attribute udid.
3 4 5 |
# File 'lib/flick/video.rb', line 3 def udid @udid end |
Instance Method Details
#android ⇒ Object
25 26 27 |
# File 'lib/flick/video.rb', line 25 def android platform == "android" end |
#ios ⇒ Object
29 30 31 |
# File 'lib/flick/video.rb', line 29 def ios platform == "ios" end |
#run ⇒ Object
33 34 35 |
# File 'lib/flick/video.rb', line 33 def run self.send(action) end |
#start ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/flick/video.rb', line 37 def start driver.clear_files puts "\nStarting Recoder!!!" if driver.recordable? if extended puts "In extended mode." Flick::Checker.system_dependency "mp4box" loop_record else start_record end else Flick::Checker.system_dependency "ffmpeg" start_screenshot_record end end |
#stop ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/flick/video.rb', line 54 def stop puts "\nStopping Recorder!!!" if driver.recordable? stop_record else stop_screenshot_recording end sleep 1 driver.clear_files end |