How can I host and embed a video in an MVC application on Azure?

前端 未结 2 433
眼角桃花
眼角桃花 2021-02-04 21:42

I have created a basic application and uploaded to Azure. I want to embed videos, so that a user can make a selection from a list and see a video for each one; like choosing a

2条回答
  •  我在风中等你
    2021-02-04 22:16

    Have your model return paths like "~/Videos/myvideo.mp4" and then in the view, use @Url.Content(Model.VideoUrl).

    As far as if the videos got deployed, first check your solution and check that the Compile property on each video is set to "Content". This will ensure they get deployed with the package. To verify, you should be able to browse to http://mywebsite.azurewebsites.net/Videos/myvideo.mp4. Also, if this is a Cloud Service, you can enable remote access and RDP into the instance to verify the files got deployed. They'll be on E: or F: under \sitesroot\0\videos.

提交回复
热议问题