Sha256: f0a45e28b34c18b804f07c0ea0b02afffc9e45cef402c26e1f706f432e8fa1eb

Contents?: true

Size: 914 Bytes

Versions: 37

Compression:

Stored size: 914 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="//www.youtube.com/watch?v=#{video_id}">YouTube (#{video_id})</a></div>|
	else
		<<-TAG
		<div class="youtube-player-wrapper">
		<iframe class="youtube-player" type="text/html" width="#{size[0]}" height="#{size[1]}" src="//www.youtube.com/embed/#{video_id}" frameborder="0">
		</iframe>
		</div>
		TAG
	end
end

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

Version data entries

37 entries across 32 versions & 2 rubygems

Version Path
tdiary-contrib-5.3.0 plugin/youtube.rb
tdiary-contrib-5.2.4 plugin/youtube.rb
tdiary-contrib-5.2.3 plugin/youtube.rb
tdiary-contrib-5.2.2 plugin/youtube.rb
tdiary-contrib-5.2.1 plugin/youtube.rb
tdiary-contrib-5.2.0 plugin/youtube.rb
tdiary-contrib-5.1.7 plugin/youtube.rb
tdiary-contrib-5.1.6 plugin/youtube.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/bundler/gems/tdiary-contrib-d1e41204db13/plugin/youtube.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-contrib-5.1.4/plugin/youtube.rb
tdiary-contrib-5.1.5 plugin/youtube.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-contrib-5.1.4/plugin/youtube.rb
tdiary-contrib-5.1.4 plugin/youtube.rb
tdiary-contrib-5.1.3 plugin/youtube.rb
tdiary-contrib-5.1.2 plugin/youtube.rb
tdiary-contrib-5.1.1 plugin/youtube.rb
tdiary-contrib-5.1.0 plugin/youtube.rb
tdiary-contrib-5.0.13 plugin/youtube.rb
tdiary-contrib-5.0.12 plugin/youtube.rb
tdiary-contrib-5.0.11 plugin/youtube.rb