Maybe this is a bit far fetched, but let me explain:
I’m currently writing a Kirby plugin to connect Kirby with a service for hosting videos (Cloudflare Stream, Mux, etc.).
Since those providers use HLS streams, they require a custom media player component and can’t use the included HTML5 video player.
For Virtual files, it would be great to be able to be able to register a custom component that will be rendered by k-file-preview instead of the image focus picker or the icon. (This could also be used to solve https://kirby.nolt.io/555)
I would like to second that request. In our case, we’re not dealing with virtual files, just with different types like mbtiles
for instance that would benefit from a map preview.
From our perspective,it would be cool, if there was a simple way to add custom previews, like a naming scheme for components, e. g. k-file-preview-{mimetype}
. So the existing component register could be used for this without any additional configuration necessity. But this would only work for these simple use cases and not for the setup Tobias was talking about.
I’d say they should be based on file types?
https://getkirby.com/docs/reference/plugins/extensions/file-types
https://getkirby.com/docs/guide/files#supported-file-types
That’s better indeed!
The Vue side works quite well. But my question is what data those components would expect. Given that the preview data is quite hardcoded for images right now: https://github.com/getkirby/kirby/blob/main/src/Panel/File.php#L403-L437
Trying out things … https://github.com/getkirby/kirby/pull/6418