Learn how to load a video from the backend (ASP.NET) using the Youtube API
Let’s continue with this very simple series of articles about the Youtube API. The articles are:
- Load a single predefined video
- Load a custom video with the Youtube API in ASP.NET (this article)
- Create a video gallery with modal using ASP.NET and Bootstrap
On the previous article, we saw how to load a predefined video using the API. It was simple and clean, while we could load only that specific video. In the real world that would be a bit different since we would have to load the video from diferent sources, by using the backend. In this article we will see how we load the from the backend using ASP.NET
We will split this script in 2 parts: The general script, which makes the API calls and the Video script, which actually calls the video.
We use this one just once, as we did before.
Here is the trick. Since I am using ASP.NET MVC here and I need to have some flexibility since we are using the back end to bring the video, I will need to put the script in a partial view. Also, I am passing the Video model, which should bring all the parameters needed for the video.
Here is the model I am using. Keep in mind that such model could bring the video data from a database, for example. Or some web service.
Next article will be about a video gallery opening a video in a modal window. All of it using videos loaded from the backend in ASP.NET MVC and bootstrap.