root/platform/tdiary/plugin/youtube.rb

Revision 5344, 0.7 kB (checked in by hsbt, 10 months ago)

platform/tdiary/spec/spec_helper.rb: add iphone?, and revert youtube.rb

Line 
1#
2# youtube.rb: YouTube plugin for tDiary
3#
4# Copyright (C) 2007 by TADA Tadashi <sho@spc.gr.jp>
5#
6# usage: <%= youtube 'VIDEO_ID' %>
7#
8def youtube( video_id )
9        if @conf.mobile_agent? then
10                %Q|<div class="youtube"><a href="http://www.youtube.com/watch?v=#{video_id}">YouTube (#{video_id})</a></div>|
11        elsif defined?( :iphone? ) and iphone?
12                %Q|<div class="youtube"><a href="youtube:#{video_id}">YouTube (#{video_id})</a></div>|
13        else
14                <<-TAG
15                <object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/#{video_id}"></param><embed src="http://www.youtube.com/v/#{video_id}" type="application/x-shockwave-flash" width="425" height="350"></embed></object>
16                TAG
17        end
18end
Note: See TracBrowser for help on using the browser.