Class: AirVideo::Client::VideoObject

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

Overview

Represents a video file as listed by the AirVideo server.

Has helper functions like #url and #live_url which give the video playback URLs of this video, as produced by the originating AirVideo::Client instance’s AirVideo::Client.get_url method.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server, name, location, detail = nil) ⇒ VideoObject

Shouldn’t be used outside of the AirVideo module



224
225
226
227
228
229
230
231
232
233
# File 'lib/airvideo.rb', line 224

def initialize(server,name,location,detail = nil) # :nodoc:
  @server = server
  @name = name
  @location = "/"+location
  @details = detail # nil implies the details haven't been loaded
  # These are the defaults, all videos *should* have these.
  @video_stream = {'index' => 1}
  @audio_stream = {'index' => 0}
  details if !@details.nil?
end

Instance Attribute Details

#audio_streamObject

Returns the value of attribute audio_stream.



221
222
223
# File 'lib/airvideo.rb', line 221

def audio_stream
  @audio_stream
end

#detailsObject (readonly)

Returns the value of attribute details.



220
221
222
# File 'lib/airvideo.rb', line 220

def details
  @details
end

#locationObject (readonly)

Returns the value of attribute location.



220
221
222
# File 'lib/airvideo.rb', line 220

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



220
221
222
# File 'lib/airvideo.rb', line 220

def name
  @name
end

#streamsObject (readonly)

Returns the value of attribute streams.



220
221
222
# File 'lib/airvideo.rb', line 220

def streams
  @streams
end

#video_streamObject

Returns the value of attribute video_stream.



221
222
223
# File 'lib/airvideo.rb', line 221

def video_stream
  @video_stream
end

Instance Method Details

#inspectObject



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

def inspect
  "<Video: #{name}>"
end

#live_urlObject

Gives the URL for live conversion video playback



281
282
283
# File 'lib/airvideo.rb', line 281

def live_url
  @server.get_url(self,true)
end

#urlObject

Gives the URL for direct video playback



276
277
278
# File 'lib/airvideo.rb', line 276

def url
  @server.get_url(self,false)
end