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

[Feature/Fix] Media field - extend preview for other formats #182

Open
criting opened this issue Feb 20, 2024 · 0 comments
Open

[Feature/Fix] Media field - extend preview for other formats #182

criting opened this issue Feb 20, 2024 · 0 comments

Comments

@criting
Copy link

criting commented Feb 20, 2024

We have an actual preview of selected media only for images, and it shows only an icon for video/audio when is selected.
Can we please make preview for video and audio as well? It's really hard to know what media you have selected without a preview, you have to check the whole URL to make sure.

I have achieved this by using csf-override and duplicating and modifying the media.php file, if the media is a video, show
html video tag, if the media is an audio, show html audio tag, but that works only when the page is being refreshed, because there is also JS that replaces the preview src when selecting a file before the page is being saved...

if ( $.inArray( $value.split('.').pop().toLowerCase(), ['jpg', 'jpeg', 'gif', 'png', 'svg', 'webp'] ) !== -1 ) { $preview_wrap.removeClass('hidden'); $preview_src.attr('src', $value); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant