2
# youtube.rb: YouTube plugin for tDiary
4
# Copyright (C) 2010 by TADA Tadashi <t@tdtds.jp>
6
# usage: <%= youtube 'VIDEO_ID' %>
8
def youtube( video_id, size = [425,350] )
9
if @conf.mobile_agent? or feed? then
10
%Q|<div class="youtube"><a href="http://www.youtube.com/watch?v=#{video_id}">YouTube (#{video_id})</a></div>|
11
elsif defined?( :smartphone? ) and @conf.smartphone?
14
<iframe class="youtube-player" type="text/html" width="#{size[0]}" height="#{size[1]}" src="http://www.youtube.com/embed/#{video_id}" frameborder="0">
16
<div class="youtube"><a href="http://www.youtube.com/watch?v=#{video_id}">YouTube (#{video_id})</a></div>
20
<iframe class="youtube-player" type="text/html" width="#{size[0]}" height="#{size[1]}" src="http://www.youtube.com/embed/#{video_id}" frameborder="0">