Class: MTV::Music::Video

Inherits:
Base
  • Object
show all
Defined in:
lib/mtv-music/base.rb,
lib/mtv-music/video.rb

Instance Attribute Summary

Attributes inherited from Base

#id, #uri

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

attribute, attributes, fetch_and_parse, #initialize, #initialize_with_polymorphism, name_with_demodulization, search

Constructor Details

This class inherits a constructor from MTV::Music::Base

Class Method Details

.api_path(method, id = nil) ⇒ Object

Workaround for case-sensitivity for Video aliases



35
36
37
38
# File 'lib/mtv-music/video.rb', line 35

def api_path(method, id = nil)
  parameters = [self.name.downcase, id, method].compact
  return parameters.collect!{|param| CGI::escape(param.to_s)}.join('/')
end

Instance Method Details

#artistObject



27
28
29
# File 'lib/mtv-music/video.rb', line 27

def artist
  Artist.new(@artist_uri)
end

#embed_code(options = {}) ⇒ Object Also known as: to_html

<embed src=“media.mtvnservices.com/mgid:uma:video:api.mtvnservices.com:235854

width="448" height="366" type="application/x-shockwave-flash"
allowFullScreen="true" allowScriptAccess="always" flashvars="autoPlay=false" />


15
16
17
18
19
20
21
22
23
24
25
# File 'lib/mtv-music/video.rb', line 15

def embed_code(options = {})
  options.update({
    :src    => @media_uri,
    :type   => "application/x-shockwave-flash",
    :width  => "448",
    :height => "366",
    :allowFullScreen   => "true",
    :allowScriptAccess => "always",
    :flashvars         => "autoPlay=false"})
  tag(:embed, options)
end