Try our conversational search powered by Generative AI!

UIHint.MediaFile

Vote:
 

I have:

[UIHint(UIHint.MediaFile)]
[Display(Name = "AnyMedia", GroupName = SystemTabNames.Content, Order = 5)]
public virtual ContentReference AnyMediaReference { get; set; }

 

[UIHint(UIHint.Video)]
[Display(Name = "Video", GroupName = SystemTabNames.Content, Order = 4)]
public virtual ContentReference VideoReference { get; set; }

 

[ContentType(GUID = "85468104-E06F-47E5-A317-FC9B83D3CBA6")]
[MediaDescriptor(ExtensionString = "wmv,mp4")]
public class VideoFile : VideoData
{
public virtual string Description { get; set; }
}

 

Uploaded a mp4 file with success and when dragging it towards by two property I can only drag the file to "AnyMedia" not to "Video". I thought both would work.

 

Any idea how this work?

#84916
Apr 09, 2014 11:27
Vote:
 

Also, if you are using UIHint.MediaFile for any media, you need some kind of logic to see what kind of media is added right?

#84918
Apr 09, 2014 11:29
Vote:
 

Hi!

This is working on my local EPiServer 7.5 MVC-based site (though it has nothing to do with Web Forms or MVC). There was a change to this in one of the NUGET packages that came after the 7.5 release although I can't really see how that should affect you. Have you upgraded to the latest packages or if not, can you try and see if this solves your problem?

#84924
Apr 09, 2014 14:23
Vote:
 

I updated framework and core from nuget, restarted visual studio and tried again with same problem. Is this what you mean by upgrade?

Also installed a new 7.5 MVC alloy site from depoyment center (not sure if this needs to be updated after installation) but it didn't work in this solution.

#84930
Apr 09, 2014 15:39
Vote:
 

Try adding the latest version of the EPiServer.CMS.UI package to see if that helps since the change was done there.

#84933
Apr 09, 2014 16:20
Vote:
 

Thanks Linus. Updated that package aswell. Had to manually delete some folders like CMS in Modules etc.

Great!

#84954
Apr 10, 2014 10:09
Vote:
 

Hi Magnus,

Even i tried UIHint.MediaFile and UIHint.Video and both are working normal.

#84955
Apr 10, 2014 10:11
Vote:
 

Hope I made it clear that it worked? :-)

#84957
Apr 10, 2014 10:48
Vote:
 

Great to hear Magnus!

#84960
Apr 10, 2014 11:19
Vote:
 

About my other question in this thread

"Also, if you are using UIHint.MediaFile for any media, you need some kind of logic to see what kind of media is added right?"

I tried to create two shared view under catalog DisplayTemplates called Media Video and Image. My idea was to render Video.cshtml view if you add a video to property with UIHint.MediaFile and Image.cshtml if an image is added. But it didn't work. Created a MediaFile.cshtml and then it worked. But now I need to add logic in this view to see what kind of media to render.

 

Any idea how to make this as clean as possible?

#84972
Apr 10, 2014 12:37
Vote:
 

@Magnus: Sorry for the late reply, but I think that this blog post answers your question.

#85846
May 07, 2014 9:34
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.