Class: PresentationLoader::MyVideo

Inherits:
Object
  • Object
show all
Defined in:
lib/soby/loader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, slide, matrix, width, height) ⇒ MyVideo

Returns a new instance of MyVideo.



287
288
289
290
291
292
293
# File 'lib/soby/loader.rb', line 287

def initialize(path, slide, matrix, width, height)
  @path = path
  @width = width
  @height = height
  @matrix = matrix
  @slide = slide
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



284
285
286
# File 'lib/soby/loader.rb', line 284

def height
  @height
end

#matrixObject (readonly)

Returns the value of attribute matrix.



284
285
286
# File 'lib/soby/loader.rb', line 284

def matrix
  @matrix
end

#slideObject (readonly)

Returns the value of attribute slide.



284
285
286
# File 'lib/soby/loader.rb', line 284

def slide
  @slide
end

#videoObject

Returns the value of attribute video.



285
286
287
# File 'lib/soby/loader.rb', line 285

def video
  @video
end

#widthObject (readonly)

Returns the value of attribute width.



284
285
286
# File 'lib/soby/loader.rb', line 284

def width
  @width
end

Instance Method Details

#playObject



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/soby/loader.rb', line 295

def play
  if @video == nil

    absolute_path = $app.sketchPath "" << @path

    puts ("loading the video : " + absolute_path)
    vid = Movie.new($app, absolute_path)

    vid.play
#        vid = Movie.new($app, @path)
    puts "Loaded "
    puts vid, vid.width, vid.height

    @video = vid
    true
  else
    false
  end
end