Changeset 1374


Ignore:
Timestamp:
02/14/07 15:53:41 (12 years ago)
Author:
laszlo
Message:

fixed #1142 spent: 12h

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Piece.py

    r1285 r1374  
    149149        file=self.getField('file') 
    150150        return file.getContentType(self).startswith('movie/') 
     151     
     152    def isFLVVideo(self): 
     153        """Returns whether the piece is an FLV video.""" 
     154        file=self.getField('file'); 
     155        file=file.get(self, raw=True, unwrapped=True) 
     156        file=file.aq_self 
     157        file=str(file) 
     158        return file.startswith('FLV');  
    151159         
    152160    def getMp3Length(self): 
  • trunk/config.py

    r1373 r1374  
    105105BASE_SKIN = 'Plone Default' 
    106106 
     107# application/octet-stream have to be in white list, because the browser recognize FLV as octet stream  
    107108MIMETYPE_WHITELIST = ['image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 
    108109                      'video/3gpp', 'video/x-msvideo', 'video/mpeg', 'video/mp4', 'video/avi', 
    109110                      'video/quicktime', 'video/x-ms-wmv', 'application/x-shockwave-flash', 
    110                       'audio/mpeg'] 
     111                      'audio/mpeg', 'application/octet-stream'] 
    111112 
    112113#list of shown metadata fields, if 'all' is in array then all fields are shown 
  • trunk/skins/lemill/piece_view.pt

    r1158 r1374  
    3434    </tal:mp3block> 
    3535 
    36     <div tal:condition="not:mp3"><tal:block i18n:domain="plone" i18n:translate="">Download</tal:block>: <metal:fieldMacro use-macro="python:here.widget('file',mode='view')"/></div> 
     36    <tal:flvblock condition="context/isFLVVideo"> 
     37        <object type="application/x-shockwave-flash" data="FlowPlayer.swf" width="320" height="200" id="FlowPlayer"> 
     38            <param name="allowScriptAccess" value="sameDomain" /> 
     39            <param name="movie" value="FlowPlayer.swf" /> 
     40            <param name="quality" value="high" /> 
     41            <param name="scale" value="noScale" /> 
     42            <param name="wmode" value="transparent" /> 
     43            <param name="flashvars" tal:attributes="value python:'config={videoFile: \'%s/at_download/file\'}' % context.absolute_url()"/> 
     44        </object> 
     45    </tal:flvblock> 
     46 
     47    <div tal:condition="python:(not mp3) and (not context.isFLVVideo())"><tal:block i18n:domain="plone" i18n:translate="">Download</tal:block>: <metal:fieldMacro use-macro="python:here.widget('file',mode='view')"/></div> 
    3748     
    3849    <div tal:condition="mp3"><tal:block i18n:translate="label_playing_time">Playing time</tal:block>: <span tal:replace="python:DateTime(context.getLength()).strftime('%M:%S')">3:20</span></div> 
Note: See TracChangeset for help on using the changeset viewer.