Changeset 38249

Show
Ignore:
Timestamp:
08/11/10 06:25:17 (3 years ago)
Author:
kayakaya
Message:

HTML5 support and preview support in smartphone

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • platform/tdiary/plugin/youtube.rb

    r37332 r38249  
    77# 
    88def youtube( video_id, size = [425,350] ) 
    9         if @conf.mobile_agent? or @conf.iphone? or feed? then 
     9        if @conf.mobile_agent? or feed? then 
    1010                %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>| 
    1311        else 
     12                if @conf.smartphone? 
     13                        size = [240, 194] 
     14                end 
    1415                <<-TAG 
    15                 <object class="youtube" width="#{size[0]}" height="#{size[1]}"><param name="movie" value="http://www.youtube.com/v/#{video_id}"><embed src="http://www.youtube.com/v/#{video_id}" type="application/x-shockwave-flash" width="#{size[0]}" height="#{size[1]}"></embed></object> 
     16                <iframe class="youtube-player" type="text/html" width="#{size[0]}" height="#{size[1]}" src="http://www.youtube.com/embed/#{video_id}" frameborder="0"> 
     17                </iframe> 
    1618                TAG 
    1719        end