Class: Presentation::MyVideo

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of MyVideo.



318
319
320
321
322
323
324
# File 'lib/soby/presentation.rb', line 318

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.



315
316
317
# File 'lib/soby/presentation.rb', line 315

def height
  @height
end

#matrixObject (readonly)

Returns the value of attribute matrix.



315
316
317
# File 'lib/soby/presentation.rb', line 315

def matrix
  @matrix
end

#slideObject (readonly)

Returns the value of attribute slide.



315
316
317
# File 'lib/soby/presentation.rb', line 315

def slide
  @slide
end

#videoObject

Returns the value of attribute video.



316
317
318
# File 'lib/soby/presentation.rb', line 316

def video
  @video
end

#widthObject (readonly)

Returns the value of attribute width.



315
316
317
# File 'lib/soby/presentation.rb', line 315

def width
  @width
end

Instance Method Details

#playObject



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/soby/presentation.rb', line 326

def play 
  if @video == nil 

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

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

#        vid = Movie.new($app, @path)
    puts "Loaded " 
    puts vid, vid.width, vid.height
    vid.play
    @video = vid
    true 
  else 
    false
  end
end