asp.net中将各种视频文件转换成.flv格式
前台调用代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>视频播放</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td><div id="video_content" runat="server" style=""></div> </td>
</tr>
</table>
</div>
</form>
</body>
</html>
后台调用代码
protected void Page_Load(object sender, EventArgs e)
{
this.video_content.InnerHtml = PlayMedia.Play("http://136.154.22.100/CamelDirectShow/x.flv", 472, 385); }
视频播放类:
using System;
using System.Collections.Generic;
using System.Text;
namespace Common
{
public class PlayMedia
{
public PlayMedia()
{
//
// TOD 在此处添加构造函数逻辑
//
}
public static string Play(string url, int width, int height)
{
string strTmp = url.ToLower();
if (strTmp.EndsWith(".flv"))
{
return flv(url, width, height);
}
else
{
return "视频文件数据错误";
}
}
/// <summary>
///&nbs |