Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added dimension properties to video media #4357

merged 3 commits into from Jan 21, 2019


None yet
3 participants
Copy link

Leobaillard commented Jan 10, 2019

Updated MediaBundle's MediaManager to get the video dimensions when ffprobe is available.

Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets N/A
Related issues/PRs
License MIT
Documentation PR sulu/sulu-docs#prnum

What's in this PR?

The MediaManager in the MediaBundle allows videos to be uploaded and processed with ffmpeg and ffprobe but the dimension informations are not saved. This PR adds, when available, the width and height of the video files to the media file properties.


It is useful to have the video dimensions available in Twig. It could for instance be used when we want to have a cover video while keeping the video's aspect ratio.

Example Usage

{# Provided you have a media_selection field called 'video' #}
<video width="{{[0].properties.width }}" height="{{[0].properties.height }}">
    <source src={{[0].url }}" type="{{[0].mimeType }}">

BC Breaks/Deprecations


To Do

  • Create a documentation PR
  • Add changes to

Leobaillard added some commits Jan 10, 2019

Added dimension properties to video media
Updated MediaBundle's MediaManager to get the video dimensions when ffprobe is available.

This comment has been minimized.

Copy link

alexander-schranz commented Jan 17, 2019

Looks good for me.

/cc @danrot

@danrot danrot merged commit 5934d1c into sulu:master Jan 21, 2019

4 checks passed

ci/circleci Your tests passed on CircleCI!
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/styleci/pr The analysis has passed
continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.