2

I have created media item and uploaded two different video in "English" and "Spanish" version. When accessing this media item, it is not loading the video as per the query string parameter, please refer the below url pattern.

<sitename>/-/media/Test/Video.mp4?la=es-US&hash=1384A22A5E79F8E459C6007506F17D2D39C03246   
<sitename>/-/media/Test/Video.mp4?la=en&hash=B257C5487196A912886734566D6BEC8D3508AB07   

I have used glass mapper, so created below extension method to generate the media url. It creates the different items in media cache, but both are having the same video.

        public static string FileUrl(this File file)
    {
        string src = "";
        if (file != null && !string.IsNullOrEmpty(file.Src))
        {

            src = HashingUtils.ProtectAssetUrl($"{file.Src}?la={Sitecore.Context.Language.Name}");
        }
        return src;
    }

Note - Media images are loading proper as per query string parameter. Facing issue in video, Sitecore 9 SXA.

4
  • Is this issue browser specific? Are you getting any JS error?
    – Amitabh
    Mar 15 '18 at 11:56
  • This issue occurs in all the browser and no JS error. Its related to media hash. Mar 15 '18 at 12:21
  • Could you please check by adding files with different name? Like for us "video-us.mp4" and for en "video-en.mp4". Please debug and check the file you are getting is specific media item as per given language...
    – NSP
    Mar 15 '18 at 15:13
  • Are there error/warnings in the logs related to the Media Hash being incorrect?
    – jammykam
    Mar 15 '18 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.