So I have created a document type in umbraco with corresponding template for my video section, which I want it to be content manageable and don't want to embed from youtube or similar. I have changed the upload limit for umbraco in webconfig and uploaded the vid in media section, using media picker. The problem I have now is how to fetch it from that media and display it on my home page. I have this code in my partial view, which is for that section but it's not display anything to the page and not showing any errors on the console:
Edit: I tried a new way, it's giving me this error: Object reference not set to an instance of an object. (as soon as I remove ".Url" the page works but it doesn't load the path to the video in media! :(
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
<!--===================================Setion 2 SO Wifi & Customer Reviews=========================================-->
<section>
<div class="row">
<div class="col-sm-6 wifi">
<h2 class="so-wifi">
@Umbraco.Field("sowifiTitle", convertLineBreaks: true)
</h2>
<img src="/src/img/so wifi.png" class="img-fluid wifi-img" alt="so wifi">
</div>
<div class="col-sm-6">
<div class="video embed-responsive embed-responsive-16by9">
@{
var videoId = Model.Content.GetPropertyValue<int>("sowifiVideo");
var videoUrl = Umbraco.Media(videoId).Url;
<video autoplay controls width="850" height="450">
<source src="@videoUrl" type="video/mp4" />
</video>
}
</div>
</div>
</div>
</section>