关于插件使用问题
公司之前有人做了一个PPTVClient.dll,用来实现P2P直播的,现在我要在网页上用到它,但总有错,说PPTVEngine1未定义,代码如下:<object classid="clsid:D97A4183-B39B-46E4-BC3A-03D4B8004D05" id="PPTVEngine1" codeBase="../PPTVClient.dll#version=1,0,0,1" data="data:application/x-oleobject;base64,ShO8k1wG0hGMqqUnOjiGOAADAACsFAAAwAoAABMAzc3NzQIADwACAAAA" width="11" height="5">
</object>
<script language=javascript>
PPTVEngine1.Open( "{D97A4183-B39B-46E4-BC3A-03D4B8004D05}","203.86.5.22:8000" );
function PPTVEngine1::OnUrl( url )
{
WindowsMediaPlayer1.URL = url;
}
function PPTVEngine1::OnError(errorcode,errormsg)
{
alert( errormsg );
}
</script>
PPTVClient.ocx我是注册过的,但还是说找不到
这些代码也是前人写的,我不是很懂,现在要在我自己的页面上用到这些,不知道怎么改,大家都说说 --------------------编程问答-------------------- PPTVEngine1未定义应该是PPTVEngine1不能访问.
用document.getElementById("PPTVEngine1")来访问.
如果是控件没有注册应该是报对象不支持方法或属性. --------------------编程问答-------------------- 还是不行,说"a未定义"
var a=document.getElementById("PPTVEngine1");
function a::OnUrl( url )
{
WindowsMediaPlayer1.URL = url;
}
--------------------编程问答-------------------- function a::OnUrl( url )
这种写法是不对的。 --------------------编程问答--------------------
<script language=javascript>--------------------编程问答-------------------- 关注 --------------------编程问答-------------------- 慕白兄,我按你的方法改了后没有再报那样的错了,但我现在要实现的是,左边有一个节目列表,当我点击其中一个节目时,能实现播放,他们的后台代码原型如下:
var PPTVEngine1 = document.getElementById("PPTVEngine1");
PPTVEngine1.Open( "{D97A4183-B39B-46E4-BC3A-03D4B8004D05}","203.86.5.22:8000" );
PPTVEngine1.OnUrl = function(url)
{
WindowsMediaPlayer1.URL = url;
}
PPTVEngine1.OnError = function(errorcode,errormsg)
{
alert( errormsg );
}
</script>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using MediaPlayer;
public partial class TVOnline : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Channel channellist = new Channel();
GridView1.DataSource = channellist.ListChannel();
this.GridView1.DataBind();
//PPTVEngine1.Open("{D97A4183-B39B-46E4-BC3A-03D4B8004D05}", "203.86.5.22:8000");
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.Equals("TVOn"))
{
int rows = int.Parse(e.CommandArgument.ToString());
int ID = int.Parse(GridView1.DataKeys[rows]["ID"].ToString());
string ChannelGuid = GridView1.DataKeys[rows]["ChannelGuid"].ToString();
string ChannelName = GridView1.DataKeys[rows]["ChannelName"].ToString();
string ChannelLink = GridView1.DataKeys[rows]["ChannelLink"].ToString();
//WindowsMediaPlayer1.URL = ChannelLink;
//PPTVEngine1.Open("ChannelGuid", "ChannelLink");
}
}
}
前端脚本我改后的如下:
<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="WindowsMediaPlayer1" width="462" height="331">
<param name="URL" value>
<param name="rate" value="1">
<param name="balance" value="0">
<param name="currentPosition" value="0">
<param name="defaultFrame" value>
<param name="playCount" value="1">
<param name="autoStart" value="-1">
<param name="currentMarker" value="0">
<param name="invokeURLs" value="-1">
<param name="baseURL" value>
<param name="volume" value="50">
<param name="mute" value="0">
<param name="uiMode" value="mini">
<param name="stretchToFit" value="0">
<param name="windowlessVideo" value="0">
<param name="enabled" value="-1">
<param name="enableContextMenu" value="-1">
<param name="fullScreen" value="0">
<param name="SAMIStyle" value>
<param name="SAMILang" value>
<param name="SAMIFilename" value>
<param name="captioningID" value>
<param name="enableErrorDialogs" value="0">
<param name="_cx" value="12224">
<param name="_cy" value="8758">
</object>
<object runat=server classid="clsid:D97A4183-B39B-46E4-BC3A-03D4B8004D05" id="PPTVEngine1" codeBase="PPTVClient.dll#version=1,0,0,1" data="data:application/x-oleobject;base64,g0F62Zuz5Ea8OgPUuABNBQADAACLCgAAGQYAAA==" width="11" height="5">
</object>
<script language=javascript>
var PPTVEngine1=document.getElementById("PPTVEngine1");
PPTVEngine1.Open( "{D97A4183-B39B-46E4-BC3A-03D4B8004D05}","203.86.5.22:8000" );
PPTVEngine1.OnUrl=function(url)
{
WindowsMediaPlayer1.URL = url;
}
PPTVEngine1.OnError =function(errorcode,errormsg)
{
alert( errormsg );
}
</script> --------------------编程问答-------------------- 向慕白兄 致敬! --------------------编程问答-------------------- 这个恐怕要看PPTVEngine1.Open方法是如何定义的。
看上去貌似第一个参数是指定一个频道,第二个参数指定视频服务器。
应该是能够根据你选择的频道号,加载不同的影像url给MediaPlayer.
如果是这样那么你左边指需要列出所有的频道号,然后根据用户点击的频道号,传递对应的参数即可。
补充:.NET技术 , ASP.NET