Asset without (local) file

Vote:
 

I have a external provider for videos and don't want to upload these to Episerver. Is there a way to create a asset and somehow link it to the external video, without uploading a actual file?

Is this the way to go?
https://github.com/episerver/YouTubeContentProvider

#193847
Jun 05, 2018 20:58
Vote:
 

Hi Andreas,

I think you've got a few options open to you here which depend on the editor experience you want and the capabilities of the system you're integrating to.

The content provider approach is certainly an option and can provide a good editor experience as the videos will be there in the media library as though they were local files though the downside is that you'll need a direct integration to the system in question which will be called both from the CMS and from the front-end website when the pages are loaded so ideally you should also implement a decent caching layer to mitigate the impact of any performance / communication issues with the destination system.

Another option would be to create a block type to represent the video and have properties to allow the editor to define the ID or whatever is required to render the video in the front-end. This gives the advantage that it's simple and quick to do and there's less of a coupling between systems which can improve performance but is more effort from the editor's side.

You could also extend this approach, perhaps using the inbuilt auto suggest editor (https://world.episerver.com/documentation/developer-guides/CMS/Content/Properties/built-in-property-types/Built-in-auto-suggestion-editor/) to allow the selection of videos based on a search of the video provider's API to improve the editor experience. If you've only got a limited number of videos, you may also want to consider some kind of synchronisation task to automatically create these blocks upfront which gives you some of the advantages of a provider without the coupling between systems.

Hope that helps,

Paul

#193859
Jun 06, 2018 11:26
Vote:
 

Another option is to register a custom BlobProvider (not as default). Then ypu can assign the BlobUri on the content media with a url to your custom BlobProvider. Then it would be up to your blob provider how it will deliver the binary data. I am not sure how you should do it on the client side though to get a editor friendly way of cretaing media files that links to your media. You will probably have to have some customized UI component for that.

#193881
Jun 07, 2018 8:31
Vote:
 

Thank you both for your suggestions. I realize now I didn't provide you with the entire picture. Regarding Paul's suggestions:

  1. The fact that the provider would be called by front-end website (not only CMS) was a deal breaker for me.
  2. I want to be able to add the asset to the asset list of a variant in Commerce, so I guess a block would not suffice.
  3. Also blocks from what I understand.

Regarding Johans suggestion - I think my end solution was more like this, but instead of BlobProvider, I made a blob HTTP handler which intercepts requests for some asset, and redirect that request to the URL of the external video. The downside is that there are no way to create this asset (because of the lack of a actual file) via the CMS, but in my case, it's ok to just be able to create the asset programmatically.

Thank you both!

#194026
Jun 11, 2018 15:18
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.