- 🇬🇧United Kingdom 2dareis2do
After looking at this my feeling is that the remote_stream_wrapper is not defined as a custom media bundle, which makes creating a media browser plugin more difficult
- 🇨🇦Canada bohemier Québec city, Qc
Since it seems there is no media library browser plugin yet, I wonder why does the module page say: Also provides a 'Remote URL' browser plugin for Media? There is also a feature opened to support an entity browser plugin here https://www.drupal.org/project/remote_stream_wrapper/issues/3066734 →
- 🇬🇧United Kingdom 2dareis2do
Yes, Entity Browser also implements this is a non standard way afaict.
- First commit to issue fork.
- 🇪🇸Spain unstatu
I have implemented a first version of this feature.
In order to use it you will have to create a media type using the "Remote file" source plugin. This "Remote file" plugin is provided by this patch.
Then, you should be able to create media entities from the entity media form itself and also from the media library widget.
- Status changed to Needs review
2 months ago 8:49am 10 September 2024 - @unstatu opened merge request.
- 🇬🇧United Kingdom 2dareis2do
Thanks for posting this.
I have tested this. i.e. add remote image file media type with Remote file plugin. This seems to create a "remote file field" in my case called "field_media_remote_file".
I am not sure why this is created this way as opposed to just adding this remote file type field as field type?
When adding a remote file this way the UI seems to work reasonably well, although there is no preview of the remote images. if using many images we need a way to distinguish one from another, at least visually.
- First commit to issue fork.
- 🇨ðŸ‡Switzerland das-peter
The options to render the remote file seem very limited. There is not even an option to display as an image?
That's what I thought too.
All one has to do is to allow image asallowed_field_types
in the source plugin.
However, because file / image is somewhat special I think a dedicated source plugin should be provided.
I've done that in the MR branch. It's pretty much just copy & paste from the code already provided with slight adjustments for the type and type check extension in the form class.