What happens in the MediaLibrary module
When somebody uploads a source to the website.
=> A MediaItemCreated
event is triggered.
Then the MediaItemListener
listens to the MediaItemCreated
Event and creates a Backend thumbnail.
=> A MediaItemBackendThumbnailCreated
Event is dispatched.
Amazon MediaLibrary module
Then the AmazonMediaItemListener
listens to the MediaItemBackendThumbnailCreated
Event,
moves the source
- file over to Amazon and updates the MediaItem with the StorageType
= External
.
Conclusion, the source
is now on Amazon, the backend thumbnail remains local
.
- Source is now on
Amazon
- Backend thumbnail is local`
When the frontend wants an thumbnail, it triggers a FrontendMediaItemResolutionMissingEvent
.
Then the MediaItemListener
listens to the MediaItemCreated
Event and creates a Frontend thumbnail.
=> A MediaItemFrontendThumbnailCreated
Event is dispatched.
Amazon MediaLibrary module
Then the AmazonMediaItemListener
listens to the MediaItemFrontendThumbnailCreated
Event,
moves the frontend thumbnail
- file over to Amazon.
Result: Every frontend thumbnail is now on Amazon.
Now we need a way to let the
MediaItem
show the correct amazonfrontend thumbnail
orSource
...
Ok, I got it. In the MediaItem I need to have a "class" that returns the webpath. By default the LocaleInterfacedClass returns the default webpath, but when the mediaItem is external, it should have the external path. Note: work with interface, f.e.
- StorageProviderInterface
- LocalStorageProvider implements StorageProviderInterface
- ExternalStorageProvider implements StorageProviderInterface