Created
June 7, 2026 18:34
-
-
Save hishaamn/a72bc237c009e09448a36422874f7d24 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Sitecore.Resources.Media; | |
| namespace MyProject.Foundation.Media | |
| { | |
| public class CustomMediaProvider : MediaProvider | |
| { | |
| public override Media GetMedia(MediaUri mediaUri) | |
| { | |
| var media = base.GetMedia(mediaUri); | |
| if (media == null) | |
| { | |
| return null; | |
| } | |
| var customMedia = new CustomMedia(); | |
| customMedia.Initialize(media.MediaData); | |
| return customMedia; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment