只使用URL嵌入视频 [英] embed video using just url

查看:123
本文介绍了只使用URL嵌入视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给YouTube网址,我怎么能使用.NET C#中嵌入视频的网页?

given a youtube url, how can i embed the video into a page using .net c#?

推荐答案

在ASP.NET MVC 3,你可以使用<$c$c>Video.Flash从<方法href=\"http://weblogs.asp.net/imranbaloch/archive/2010/11/07/using-asp-net-web-pages-in-asp-net-mvc.aspx\">ASP.NET网页助手:

In ASP.NET MVC 3 you could use the Video.Flash method from the ASP.NET Web Pages Helpers:

@Microsoft.Web.Helpers.Video.Flash("http://www.youtube.com/v/xxxxxx")

下面是一个欢颜博客文章,解释你怎么能实现它:

Here is a worthwile blog post explaining how you could implement it:

  • Video Web Helper in ASP.NET MVC 3 RC 2 - Add Videos to your Web Pages

更新

如果你不想使用微软的网页助手当然你也可以写你自己的的HtmlHelper 扩展方法。你可以找到一个很好的例子下载一个的HtmlHelper 在这篇博客中显示的ASP.NET MVC的YouTube视频:

If you don't want to use Microsoft's Web Pages Helpers you can of course write your own HtmlHelper extension method. You can find a good downloadable example for a HtmlHelper to display YouTube videos in ASP.NET MVC in this blog post:

  • Display youtube video in asp.net mvc using "YouTubePlayerHelper"

这篇关于只使用URL嵌入视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆