Sha256: 836b3a42c295da18740ab4d0ef05d87621efc3b84b390a91ccbcd615e9c2a391

Contents?: true

Size: 838 Bytes

Versions: 4

Compression:

Stored size: 838 Bytes

Contents

#
# youtube.rb: YouTube plugin for tDiary
#
# Copyright (C) 2010 by TADA Tadashi <t@tdtds.jp>
#
# usage: <%= youtube 'VIDEO_ID' %>
#
def youtube( video_id, size = [425,350] )
	if feed?
		%Q|<div class="youtube"><a href="http://www.youtube.com/watch?v=#{video_id}">YouTube (#{video_id})</a></div>|
	else
		<<-TAG
		<iframe class="youtube-player" type="text/html" width="#{size[0]}" height="#{size[1]}" src="http://www.youtube.com/embed/#{video_id}" frameborder="0">
		</iframe>
		TAG
	end
end

def youtube_custom( video_id, size = [416,337] )
  <<-TAG
  <object width="#{size[0]}" height="#{size[1]}">
  <param name="movie" value="http://www.youtube.com/cp/#{video_id}"></param>
  <embed src="http://www.youtube.com/cp/#{video_id}" type="application/x-shockwave-flash" width="#{size[0]}" height="#{size[1]}"></embed>
  </object>
  TAG
end

Version data entries

4 entries across 3 versions & 2 rubygems

Version Path
tdiary-contrib-4.2.1 plugin/youtube.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/bundler/gems/tdiary-contrib-2ab36447ae2a/plugin/youtube.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/bundler/gems/tdiary-contrib-d189eb6688f1/plugin/youtube.rb
tdiary-contrib-4.2.0 plugin/youtube.rb