Edgewall Software
Modify

Opened 5 years ago

Last modified 6 months ago

#13175 new enhancement

Add video renderer in Trac core

Reported by: Jun Omae Owned by:
Priority: normal Milestone: next-stable-1.6.x
Component: rendering Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Trac is able to render an image file but not a video file. I'd like to add the following component to trac/mimeview/api.py.

class VideoRenderer(Component):

    implements(IHTMLPreviewRenderer)

    def get_quality_ratio(self, mimetype):
        if mimetype.startswith('video/'):
            return 8
        return 0

    def render(self, context, mimetype, content, filename=None, url=None):
        if url:
            return tag.div(tag.video(src=url, alt=filename, type=mimetype,
                                     controls='controls'),
                           class_='video-file')

Attachments (0)

Change History (6)

comment:1 by Ryan J Ollos, 5 years ago

Good idea.

in reply to:  1 comment:2 by Christian Boos, 5 years ago

Replying to Ryan J Ollos:

Good idea.

+1

So what about your TH:MovieMacro? Was there anything more there that would still make it relevant for the HTML5 version of Trac? If so, anything that can be ported over on top of your <video> suggestion?

(well, obviously we'd need to add at least a proper Video macro to render the above tag)

Last edited 5 years ago by Christian Boos (previous) (diff)

comment:3 by Ryan J Ollos, 5 years ago

Milestone: 1.2.41.2.5

comment:4 by Ryan J Ollos, 5 years ago

Milestone: 1.2.51.2.6

Moving forward since we'll be releasing soon. Please feel free to move back if you'd like to include the change in 1.2.5 within the next few days.

comment:5 by Ryan J Ollos, 4 years ago

Milestone: 1.2.6next-stable-1.4.x

comment:6 by Ryan J Ollos, 6 months ago

Milestone: next-stable-1.4.xnext-stable-1.6.x

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.