-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[6.0] Media: allow thumbnail for any file type #44847
base: 6.0-dev
Are you sure you want to change the base?
Conversation
Maybe I am missing something but I am missing the usecase for this and how it can be used by a siteowner without core hacks |
No need core hacks, what you see in the description is for testing only. The use case:
public function onFetchMediaItems($event)
{
$items = $event->getArgument('items');
foreach ($items as $item) {
if (in_array($item->extension, ['mp4', 'mp3', 'pdf'])) {
$item->thumb_path = Uri::root(true) . '/images/headers/raindrops.jpg';
}
}
$event->setArgument('items', $items);
} |
I have tested this item ✅ successfully on 242a656 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44847. |
1 similar comment
I have tested this item ✅ successfully on 242a656 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44847. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44847. |
Can this somehow be documented? |
I will write something after it will be merged. |
Better would be the opposite, so it will no get forgotten. |
I mean, I can write doc, but then waiting another year for merging, not much fun and motivating. |
build/media_source/com_media/scss/components/_media-browser.scss
Outdated
Show resolved
Hide resolved
administrator/components/com_media/resources/scripts/components/browser/items/audio.vue
Outdated
Show resolved
Hide resolved
administrator/components/com_media/resources/scripts/components/browser/items/directory.vue
Outdated
Show resolved
Hide resolved
administrator/components/com_media/resources/scripts/components/browser/items/document.vue
Outdated
Show resolved
Hide resolved
administrator/components/com_media/resources/scripts/components/browser/items/file.vue
Outdated
Show resolved
Hide resolved
administrator/components/com_media/resources/scripts/components/browser/items/video.vue
Outdated
Show resolved
Hide resolved
@Fedik Sorry, it seems my suggested javascript code style changes were not sufficient. Now the javascriptcs checker complains about missing line breaks and indentation: https://ci.joomla.org/joomla/joomla-cms/82743/1/20 |
administrator/components/com_media/resources/scripts/components/browser/items/audio.vue
Outdated
Show resolved
Hide resolved
No problem, I also can fix them later, if it fail again. |
Hi @Fedik I am happy to merge this once we have the documentation. You will not need to wait, if you fix the conflicts then ping me I am getting regular tests on a Friday and it can be tested and merged |
The conflicts should go away after next upmerge 😉 |
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Okay, had to redo "rebase" localy, because automatic one went wrong |
Summary of Changes
The changes allows thumbnail for any file type: video, pdf, audio etc.
Testing Instructions
Apply path, run
npm install
.Edit
joomla-cms/plugins/filesystem/local/src/Adapter/LocalAdapter.php
Line 421 in a2a381a
And add following
else
condition (optionaly change the image path):Go to media manager and upload some video, or audio or any other file.
Thn check the thumbnail.
Actual result BEFORE applying this Pull Request
Non image files has a icon
Expected result AFTER applying this Pull Request
Non image files has a 'raindrops.jpg' image
Link to documentations
Please select: