Ticket #5168 (closed enhancement: fixed)

Opened 4 years ago

Last modified 3 years ago

[Patch] Support for FLV files

Reported by: eppa Assigned to: rudyryk
Priority: low Component: FlashEmbedMacro
Severity: minor Keywords:
Cc: Trac Release: 0.11

Description

Hello, i was wondering if you could add support for flv files (absolute url like for swf)?

Attachments

Change History

(follow-up: ↓ 2 ) 07/09/09 10:46:57 changed by mwehr

Hi

I added support for .flv files. It's a hack, but it works :-) The macro call looks like this

Error: Failed to load processor Embed
No macro or processor named 'Embed' found

I'm using the JW Player

have fun

Mario

(in reply to: ↑ 1 ) 07/09/09 10:53:14 changed by mwehr

ups,....

[[Embed(flv={Url to the .flv file},purl={URL to the .flv player},w=500,h=400)]]

unfortunately , i can not attach the patch, so i'll post it here.

 def expand_macro(self, formatter, name, content):
        """ Produces html code by 'key' and content id.
        """
        args, params = parse_args(content, strict=False)
        
        if 'youtube' in params:
            return embed_youtube(params['youtube'], params)
        elif 'vimeo' in params:
            return embed_vimeo(params['vimeo'], params)
        elif 'swf' in params:
            return embed_swf(formatter, params)
        elif 'flv' in params:
            return embed_flv(formatter, params)
def embed_flv(formatter, params):
    """
    Produces embedding code for SWF by url.
    """
    url = params['flv']
    purl = params['purl']
    # url for attachment
    if url[0] != '/' and url[0:7] != 'http://' and url[0:8] != 'https://':
        if url[:11] != 'attachment:':
            url = 'attachment:%s' % url
        url = extract_link(formatter.env, formatter.context, '[%s attachment]' % url)
        url = '/raw-' + url.attrib.get('href')[1:]
    
    # embed code
    code = '<embed \
src="%(purl)s" \
width="%(w)s" \
height="%(h)s" \
bgcolor=undefined \
allowscriptaccess=always \
allowfullscreen=true \
flashvars="file=%(url)s" \
/>'  % {'url': url, 'purl': purl, 'w': params.get('w', '100%'), 'h': params.get('h', '100%')}

    return code

08/22/10 08:35:04 changed by rjollos

  • summary changed from Support of FLV files? to [Patch] Support for FLV files.

08/22/10 08:35:47 changed by rjollos

  • status changed from new to closed.
  • resolution set to fixed.

Add/Change #5168 ([Patch] Support for FLV files)




Change Properties
Action