class Tubeclip::Model::Video
Attributes
- Hash
-
string-keyed, string-valued permissions e.g., {'comment'=>'allowed','videoRespond'=>'moderated'}
- Array
-
A array of
Tubeclip::Model::Category
objects that describe the videos categories.
- Fixnum
-
Number of comments for this video
- String
-
Description of the video.
- Fixnum
-
Duration of a video in seconds.
- Fixnum
-
Number of times that the video has been favorited
- String
-
Description of the video.
- String
-
URI for insight for this video, if present; nil otherwise
- Array
-
An array of words associated with the video.
- Array
-
An array of
Tubeclip::Model::Content
objects describing the individual media content data available for this video. Most, but not all, videos offer this.
- Boolean
-
Specifies that a video may or may not be embedded on other websites.
- Boolean
-
Whether or not a video is private. Non-standard name to avoid collision with Rubys own 'private' stuff.
- String
-
The link to watch the URL on YouTubes website.
- Fixnum
-
Specifies the order in which the video appears in a playlist.
- Time
-
When the video was published on Youtube.
Tubeclip::Model::Rating
-
Information about the videos rating.
- String
-
Description of the video.
- Time
-
When the video's was recorded.
- Boolean
-
Specifies that a video is flagged as adult or not.
- String
-
State of the video (processing, restricted, deleted, rejected and failed)
- Array
-
An array of
Tubeclip::Model::Thumbnail
objects that contain information regarding the videos thumbnail images.
- String
-
Title for the video.
- Time
-
When the video's data was last updated.
- Time
-
When the video's was uploaded.
String: Specifies a URI that uniquely and permanently identifies the video.
Playlist
position
- Fixnum
-
Number of times that the video has been viewed
- Boolean
-
Specifies that a video may or may not be 16:9 ratio.
Public Instance Methods
Gives you the HTML to embed the video on your website.
Returns¶ ↑
String: The HTML for embedding the video on your website.
# File lib/tubeclip/model/video.rb, line 241 def embed_html(width = 425, height = 350) <<EDOC <object width="#{width}" height="#{height}"> <param name="movie" value="#{embed_url}"></param> <param name="wmode" value="transparent"></param> <embed src="#{embed_url}" type="application/x-shockwave-flash" wmode="transparent" width="#{width}" height="#{height}"></embed> </object> EDOC end
Gives you the HTML 5 to embed the video on your website. Usefull for mobile that not support flash but has html5 browser
Returns¶ ↑
String: The HTML for embedding the video on your website.
# File lib/tubeclip/model/video.rb, line 256 def embed_html5(params = {}) opts = {:class => params[:class] || "", :id => params[:id] || "", :width => params[:width] || "425", :height => params[:height] || "350", :protocol => params[:protocol] || "http", :frameborder => params[:frameborder] || "0", :url_params => params[:url_params] || {}, :sandbox => params[:sandbox] || false, :fullscreen => params[:fullscreen] || false, } url_opts = opts[:url_params].empty? ? "" : "?#{Rack::Utils::build_query(opts[:url_params])}" <<EDOC <iframe class="#{opts[:class]}" id="#{opts[:id]}" type="text/html" width="#{opts[:width]}" height="#{opts[:height]}" src="#{opts[:protocol]}://www.youtube.com/embed/#{unique_id}#{url_opts}" frameborder="#{opts[:frameborder]}" #{" sandbox=\"#{opts[:sandbox]}\" " if opts[:sandbox]} #{"allowfullscreen" if opts[:fullscreen]}></iframe> EDOC end
Gives you the HTML to embed the video on your website.
Returns¶ ↑
String: The HTML for embedding the video on your website.
# File lib/tubeclip/model/video.rb, line 277 def embed_html_with_width(width = 1280) height = (widescreen? ? width * 9/16 : width * 3/4) + 25 <<EDOC <object width="#{width}" height="#{height}"> <param name="movie" value="#{embed_url}"></param> <param name="wmode" value="transparent"></param> <embed src="#{embed_url}" type="application/x-shockwave-flash" wmode="transparent" width="#{width}" height="#{height}"></embed> </object> EDOC end
The ID of the video, useful for searching for the video again without having to store it anywhere. A regular query search, with this id will return the same video.
Example¶ ↑
>> video.unique_id => "ZTUVgYoeN_o"
Returns¶ ↑
String: The Youtube video id.
# File lib/tubeclip/model/video.rb, line 191 def unique_id @unique_id || video_id[/videos\/([^<]+)/, 1] || video_id[/video\:([^<]+)/, 1] end
ID of this video in the watch later list (work only if you are listing watch later videos) Can be use to modify or remove the entry from the watch later list
Example¶ ↑
>> @client.watchlater.videos.first.watch_later_id => "PL78jdHcOatSF7DGMd4O9K6Mbo0cNlxm_j"
# File lib/tubeclip/model/video.rb, line 201 def watch_later_id video_id[/watch_later\:([^:]+)/, 1] end