To resolve a problem like this, I would recommend trying to print the raw value of the video Media Picker to the screen or inspecting it in debug mode. I like to work with the more strongly typed IPublishedContent, so I would debug with some code like this:
var videoData = Model.Content.GetPropertyValue<string>("productSliderVideo");
Normally, if you are working on a View that inherits from @inherits UmbracoTemplatePage
, both Model.Content
and CurrentPage
will give you the data on the current page. You can work with the CurrentPage
if you like working with dynamics or you can work with Model.Content
to work with more strongly typed IPublishedContent models. I prefer the strongly typed version because it is a lot easier for me to debug.
Once you verify that you are getting an id back, I would check the media item that you have picked in the backoffice just as a sanity check. Make sure it matches. If it does, I would try reindexing the InternalIndexer in the Examine Index Manager. As far as I understand, Umbraco uses the internal examine indexer as a media cache. After doing all of this, I would try the below. It is the same as what you are doing above, but with the TypedMedia instead of the dynamic media. Maybe it will reveal more to you. I personally find the typed content and typed media a lot easier to debug. It might make sense to switch over to that for the sake of debugging even if you decide you want to switch back to the dynamics afterwards:
var video = Umbraco.TypedMedia(videoData);