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
merged 3 commits into from Jan 21, 2019

Conversation

Projects
None yet
3 participants
@Leobaillard
Copy link
Contributor

Leobaillard commented Jan 10, 2019

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

Q A
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.

Why?

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="{{ content.video[0].properties.width }}" height="{{ content.video[0].properties.height }}">
    <source src={{ content.video[0].url }}" type="{{ content.video[0].mimeType }}">
</video>

BC Breaks/Deprecations

N/A

To Do

  • Create a documentation PR
  • Add changes to CHANGELOG.md

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.
@alexander-schranz

This comment has been minimized.

Copy link
Member

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!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
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.