Edgewall Software
Modify

Opened 16 months 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.4.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 (5)

comment:1 by Ryan J Ollos, 16 months ago

Good idea.

in reply to:  1 comment:2 by Christian Boos, 16 months 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 16 months ago by Christian Boos (previous) (diff)

comment:3 by Ryan J Ollos, 16 months ago

Milestone: 1.2.41.2.5

comment:4 by Ryan J Ollos, 15 months 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, 6 months ago

Milestone: 1.2.6next-stable-1.4.x

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.