100分求.net播放FLV格式的源码(帮帮忙)

aspnetzq 2009-09-02 02:06:53
网上查了好像有几部分,我测试了都没成功
如果有可用的源码 可以打包发给我 aspnetzq@gmail.com
...全文
706 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
duan421114 2009-09-02
  • 打赏
  • 举报
回复
http://www.jb51.net/article/15151.htm 挺不错的 推荐
aimserver 2009-09-02
  • 打赏
  • 举报
回复
播放FLV视频 要在IIS 配置

这个是发布以后的
Lovely_baby 2009-09-02
  • 打赏
  • 举报
回复
额 现在做这个都是先把格式转换一下
你参考一下转换代码吧
http://hi.baidu.com/czh0221/blog/item/9f1c19d1eeab5ed0562c843b.html
frank55444 2009-09-02
  • 打赏
  • 举报
回复
有个简单的
<body>
<form id="form1" runat="server">
<div>
 <table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%">
<tr>
<td style="width: 200px">
<object width="500" height="400">
<param name="movie" value="flvplayer.swf" />
<param name="quality" value="high" />
<param name="allowFullScreen" value="true" />
<param name="FlashVars" value="vcastr_file=yo.flv&LogoText=lhking&BufferTime=3" />
<embed src="flvplayer.swf" allowfullscreen="true" flashvars="vcastr_file=yo1.flv" quality="high" type="application/x-shockwave-flash" width="500" height="400"></embed>

</object>
</td>
</table>
</div>
</form>
</body>
pdsnet 2009-09-02
  • 打赏
  • 举报
回复
直接带的 有 个教程 .配置自己设置 .很舒服
pdsnet 2009-09-02
  • 打赏
  • 举报
回复
wszhoho 2009-09-02
  • 打赏
  • 举报
回复
谷歌 “jwFlvPlayer”
lfywy 2009-09-02
  • 打赏
  • 举报
回复
有源码嘛 打个包给我吧 lifuyun023@163.com
谢谢了!
aspnetzq 2009-09-02
  • 打赏
  • 举报
回复
有源码嘛 打个包给我吧 aspnetzq@gmail.com
bzhyan 2009-09-02
  • 打赏
  • 举报
回复
这里有一个挺好用的
http://d.download.csdn.net/down/1374966/tiger00598
zzxap 2009-09-02
  • 打赏
  • 举报
回复
可以用c#调用DirectShowLib.dll
using DirectShowLib;

使用里面的方法,写一个播放器
zzxap 2009-09-02
  • 打赏
  • 举报
回复
http://blog.csdn.net/diskonline/archive/2008/04/15/2293170.aspx
红街咖啡 2009-09-02
  • 打赏
  • 举报
回复
哇。那么多人都有源码啊。收藏。
urtrcc 2009-09-02
  • 打赏
  • 举报
回复

<script language="javascript" type="text/javascript" id="javascript_id">
var nowfile = "";
var vvv = window.parent.parent.document.getElementById("isReview").value;
if(vvv == "false")
{
nowfile = window.parent.parent.document.getElementById("Advertfile").value;
}
else
{
nowfile = window.parent.parent.document.getElementById("ReAdvertfile").value;
}

//15秒动态控制时间
var timer = null;
var cnt = 14;
function setTime()
{
if(cnt>=0)
{
if(document.getElementById("txtTip")!=null)
{
document.getElementById("txtTip").innerText=cnt+'秒内未确定视为自动放弃本次抽奖机会';
cnt--;
}
}else
{
window.clearInterval(timer);
window.parent.parent.firstView(0);
window.parent.parent.GB_hide();
}
}


// some variables to save
var currentPosition;//当前播放秒数
var currentVolume;//当前音量
var currentItem;//当前播放项

// these functions are caught by the JavascriptView object of the player.
function sendEvent(typ,prm)
{
alert(thisMovie("player_id"));
thisMovie("player_id").sendEvent(typ,prm);
};
//case "playpause": 暂停
//"prev": "next":"stop": 上一项 下一项 停止
//scrub":秒数"volume":音量 playitem 播放项"getlink": "fullscreen": "complete": "captions":标题 "audio":
function getUpdate(typ,pr1,pr2,pid) {

if(typ == "time")
{
currentPosition = pr1;

if(pr1 != 0 && pr2 ==0)
{
var v = window.parent.parent.document.getElementById("isReview").value;

if(v == "false")
{
document.getElementById("divContant").innerHTML =
'<table style="background-color:Black;height:300px;width:400px;"><tr><td align="center" valign="middle"><input id="btn" type="button" style="background-image: url(../../image/adico3.gif); background-color: transparent;width:278px;height:40px;border-style:none; cursor:pointer;" value="" onclick="stopPlay(1);" /> <input id="txtTip" type="text" value="15秒内未确定视为自动放弃本次抽奖机会" readonly="readonly" style="width: 278px;height:38px;background-image: url(../../image/adico4.gif); border-style:none; text-align:center; font-weight: bold; vertical-align: bottom; color: white;"/> </td></tr></table>';

timer = window.setInterval('setTime();', 1000);
}
else
{

document.getElementById("divContant").innerHTML =
'<table style="background-color:Black;width:400px;height:300px"><tr><td align="center" valign="middle"><input id="ok" type="button" style="background-image: url(../../image/adico3.gif); background-color: transparent;width:278px;height:40px;border-style:none; cursor:pointer;" value="" onclick="stopPlay(0);"  /></td></tr></table>';
}
}
}
else if(typ == "volume") { currentVolume = pr1; }
else if(typ == "item") { currentItem = pr1; setTimeout("getItemData(currentItem)",100); }
var id = document.getElementById(typ);
id.innerHTML = typ+ ": "+Math.round(pr1);
pr2 == "undefined" ? null: id.innerHTML += ", "+Math.round(pr2);
if(pid != "null") {
document.getElementById("pid").innerHTML = "(来自播放器 <i>"+pid+"</i>的消息)";
}
};



// These functions are caught by the feeder object of the player. RSS专用
function loadFile(obj) { thisMovie("mpl").loadFile(obj); };
function addItem(obj,idx) { thisMovie("mpl").addItem(obj,idx); }
function removeItem(idx) { thisMovie("mpl").removeItem(idx); }
function getItemData(idx) {
var obj = thisMovie("player_id").itemData(idx);
var nodes = "";
for(var i in obj) {
nodes += "<li>"+i+": "+obj[i]+"</li>";
}
document.getElementById("data").innerHTML = nodes;
};

// This is a javascript handler for the player and is always needed.
function thisMovie(movieName) {
if(navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
};


function stopPlay(i)
{
if(i == "1")
{
window.parent.parent.firstView(1);
}

window.parent.parent.GB_hide();

}
</script>




页面播放器代码
<script type="text/javascript">
var s1 = new SWFObject('<% = ResolveClientUrl("~/Vedio/player/mediaplayer.swf")%>','mpl','400','300','9');

s1.addVariable("file",nowfile);
s1.addVariable("enablejs","true");
s1.addVariable("javascriptid","javascript_id");
s1.addVariable('allowscriptaccess','always');
s1.addVariable("autostart","true");
s1.addVariable("overstretch","fit");
s1.addVariable("showdigits","false");
s1.addVariable("displayheight","300");
s1.addVariable("controlbar","none");
s1.addVariable("showdownload ","false");
s1.write('player');
</script>


代码比较乱。。LZ要是不懂我可以发源码你。。
周公 2009-09-02
  • 打赏
  • 举报
回复
为什么要用Label呢?
这个代码是我们播放视频文件通用类库中的一部分,我们一直在用,不可能有问题的。
你通过最终的页面的HTML源代码看看问题到底在哪里吧。
aspnetzq 2009-09-02
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 zhoufoxcn 的回复:]
其实就是输出HTML代码而已,如下:
C# code///<summary>/// 生成播放Flv格式文件的HTML代码///</summary>///<param name="url">Flv格式文件的URL</param>///<param name="width">播放控件的显示宽度</param>///<param name="height">播放控件的显示高度</param>///<returns></returns>publicstaticstring MakeFlvHtml(string url,int width,int height)
{
StringBuilder buffer=new StringBuilder(1024);if (!string.IsNullOrEmpty(url))
{
buffer.Append("<object type=\"application/x-shockwave-flash\" data=\"/images/vcastr3.swf?xml=<vcastr>\n");
buffer.Append("<channel>\n");
buffer.Append("<item>\n");
buffer.Append("<source>"+ url+"</source>\n");
buffer.Append("<duration></duration>\n");
buffer.Append("<title></title>\n");
buffer.Append("</item>\n");
buffer.Append("</channel>\n");
buffer.Append("</vcastr>\"\n");
buffer.Append("width="+ width+" height="+ height+" id=\"vcastr3\">\n");
buffer.Append("<param name=\"wmode\" value=\"transparent\">\n");
buffer.Append("<param name=\"movie\" value=\"/images/vcastr3.swf?xml=<vcastr>\n");
buffer.Append("<channel>\n");
buffer.Append("<item>\n");
buffer.Append("<source>"+ url+"</source>\n");
buffer.Append("<duration></duration>\n");
buffer.Append("<title></title>\n");
buffer.Append("</item>\n");
buffer.Append("</channel>\n");
buffer.Append("</vcastr>\" />\n");
buffer.Append("<param name=\"allowFullScreen\" value=\"true\" />\n");
buffer.Append("</object>\n");
}else
{
buffer.Append("暂无视频!");
}return buffer.ToString();
}
[/Quote]
不能播放 练播放的窗口都没有 我使用如下:请指正
lbl_MediaPlayer.Text = MakeFlvHtml("movie/aa.flv", 500, 400);
周公 2009-09-02
  • 打赏
  • 举报
回复
其实就是输出HTML代码而已,如下:

/// <summary>
/// 生成播放Flv格式文件的HTML代码
/// </summary>
/// <param name="url">Flv格式文件的URL</param>
/// <param name="width">播放控件的显示宽度</param>
/// <param name="height">播放控件的显示高度</param>
/// <returns></returns>
public static string MakeFlvHtml(string url, int width, int height)
{
StringBuilder buffer = new StringBuilder(1024);
if (!string.IsNullOrEmpty(url))
{
buffer.Append("<object type=\"application/x-shockwave-flash\" data=\"/images/vcastr3.swf?xml=<vcastr>\n");
buffer.Append("<channel>\n");
buffer.Append("<item>\n");
buffer.Append("<source>" + url + "</source>\n");
buffer.Append("<duration></duration>\n");
buffer.Append("<title></title>\n");
buffer.Append("</item>\n");
buffer.Append("</channel>\n");
buffer.Append("</vcastr>\"\n");
buffer.Append("width=" + width + " height=" + height + " id=\"vcastr3\">\n");
buffer.Append("<param name=\"wmode\" value=\"transparent\">\n");
buffer.Append("<param name=\"movie\" value=\"/images/vcastr3.swf?xml=<vcastr>\n");
buffer.Append("<channel>\n");
buffer.Append("<item>\n");
buffer.Append("<source>" + url + "</source>\n");
buffer.Append("<duration></duration>\n");
buffer.Append("<title></title>\n");
buffer.Append("</item>\n");
buffer.Append("</channel>\n");
buffer.Append("</vcastr>\" />\n");
buffer.Append("<param name=\"allowFullScreen\" value=\"true\" />\n");
buffer.Append("</object>\n");
}
else
{
buffer.Append("暂无视频!");
}
return buffer.ToString();
}
aspnetzq 2009-09-02
  • 打赏
  • 举报
回复
把全部代码贴出来也可以

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧