User tests: Successful: Unsuccessful:
The changes allows thumbnail for any file type: video, pdf, audio etc.
Apply path, run npm install
.
Edit
else
condition (optionaly change the image path):
else {
if (!$isDir){
$obj->thumb_path = Uri::root(true) . '/images/headers/raindrops.jpg';
} else {
$obj->thumb_path = Uri::root(true) . '/images/headers/maple.jpg';
}
}
Go to media manager and upload some video, or audio or any other file.
Thn check the thumbnail.
Non image files has a icon
Non image files has a 'raindrops.jpg' image
Please select:
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_media NPM Change Repository |
No need core hacks, what you see in the description is for testing only.
The use case:
onFetchMediaItems
: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);
}
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