-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Use http://mediaelementjs.com/ for video support in media manager #7810
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
Conversation
I think you need to introduce a JHtml function renderVideo (or embedVideo or similar) and then in the front end you call it like we do for calendar etc. Maybe JHtml::_('bootstrap', 'renderVideo' … ); so we can go directly to layouts? |
|
That still doesn't fix that fact you need to call the modal from outside the iframe somehow with js |
|
@wilsonge are you trying to render a modal in the parent window with data from the iframe? is this the case you were talking about? |
|
Some feed back:
|
|
@wilsonge check wilsonge#16 |
add close button on modal’s footer
|
Yes that is the case I mean :) So I want the modal to display in the parent window with the video from the iframe |
|
@wilsonge I’m thinking a way out on this:
|
|
<3 |
Conflicts: administrator/components/com_media/views/medialist/view.html.php
bootstrap + details
|
@test OK |
|
Umm if you move the css and the images apart you need to rework the paths in the CSS files. We just treat it like tinymce or codemirror imho. I strongly feel we shouldn't be making modifications like that. I don't mind someone working on an alternate theme but for the love of god don't put me in charge of it |
|
For the dimensions we need something like http://ffmpeg-php.sourceforge.net or http://getid3.sourceforge.net or https://code.google.com/p/php-mp4info/ |
|
@wilsonge with html5 is way easier to get the dimensions with js <video id="foo" src="foo.mp4"></video>
var vid = document.getElementById("foo");
vid.videoHeight; // returns the intrinsic height of the video
vid.videoWidth; // returns the intrinsic width of the videoBUT this is only for html5 and needs some further logic to replace each tag for each video file. I guess we can add some fallback like "N/A" for older browsers |
|
But that's for a video element set up. You can make those dimensions anything you want. It doesn't tell you what the video dimensions themselves are |
|
if you setup a video tag without any dimensions then the dimensions come from the video (right?) therefore vid.videoHeight; should return the correct height. So the idea is to setup a hidden video tag for every video file with some id and then iterate and replace some the text with the dimensions. In theory this should work |
|
Are there specific testinstructions for this? This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7810. |
|
Sure. Upload an MP4 video into the media manager (noting the last paragraph in my PR) and try you can now preview the video in the media manger after applying the patch |
|
I have tested this item ✅ successfully on 55bd6b6 Preview works with current Chrome, Firefox and IE. Not with WinXP/IE8 or WinXP/FF. But who cares, right. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7810. |
|
This PR has received new commits. CC: @waader This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7810. |
|
This PR has received new commits. CC: @waader This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7810. |
|
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7810. |
|
I have tested this item ✅ successfully on 5d40bcb This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7810. |
|
@waader can you give it a quick test to confirm nothing is wrong. I just merged in staging and tweaked the location of the css and js in response to some feedback :) |
|
Works for me! |
|
So this is RTC! This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7810. |
|
This PR has received new commits. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7810. |
|
This PR has received new commits. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7810. |



This adds support for mp4 videos in the media manager in the backend of Joomla. If you upload a sample video. Whilst it does still show the mp4 icon it will now open a bootstrap modal when clicked upon (inside the iframe - advice on how to do it globally will be appreciated - i think http://stackoverflow.com/questions/12954047/twitters-bootstrap-modal-in-iframe-popout-of-it might be related - but my javascript abilities don't extend that far for an evenings work (@DGT41 any ideas?)) and you can play the video
I did investigate whether it was possible for the icon to be replaced by an image preview - but the only php way of doing this involved the php gd image extension which isn't available on all shared hosting platforms (and is partly why we are stuck with not using JImage in core Joomla). But if anyone has any great ideas then feel free to comment again
The video library used is http://mediaelementjs.com/ which is what is used in wordpress core. it uses the html5 api but provides a flash fallback solution for browsers which don't offer support. For more information see their website. They ship with an MIT license which is GPLv2 compatible. The plugin also allows audio elements - which might be a nice feature to implement in the future
When testing remember to allow mp4 images in both the allowed mime types and the allowed extension types (extension type:
mp4, mime type:video/mp4)