Class: YouTubeG::Model::Video::Format
- Inherits:
-
Object
- Object
- YouTubeG::Model::Video::Format
- Defined in:
- lib/youtube_g/model/video.rb
Overview
Describes the various file formats in which a Youtube video may be made available and allows looking them up by format code number.
Constant Summary collapse
- FLASH =
Flash format on YouTube site. All videos are available in this format.
YouTubeG::Model::Video::Format.new(0, :flash)
- RTSP =
RTSP streaming URL for mobile video playback. H.263 video (176x144) and AMR audio.
YouTubeG::Model::Video::Format.new(1, :rtsp)
- SWF =
HTTP URL to the embeddable player (SWF) for this video. This format is not available for a video that is not embeddable.
YouTubeG::Model::Video::Format.new(5, :swf)
- THREE_GPP =
YouTubeG::Model::Video::Format.new(6, :three_gpp)
- @@formats =
Hash.new
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(format_code, name) ⇒ Format
constructor
A new instance of Format.
Constructor Details
#initialize(format_code, name) ⇒ Format
Returns a new instance of Format.
10 11 12 13 14 15 |
# File 'lib/youtube_g/model/video.rb', line 10 def initialize(format_code, name) @format_code = format_code @name = name @@formats[format_code] = self end |
Class Method Details
.by_code(format_code) ⇒ Object
17 18 19 |
# File 'lib/youtube_g/model/video.rb', line 17 def self.by_code(format_code) @@formats[format_code] end |