大家讨论:用windows media encoder sdk 开发网上视频点播系统

cclxj 2001-07-09 06:27:35
在服务器上存有多种多媒体文件,powerpoint课件,如何用 media player进行播放?
...全文
377 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
csteven 2001-07-31
  • 打赏
  • 举报
回复
liugys(liuliu):

这是你自己写的 么 ???

很高兴看到!!!
三杯倒 2001-07-31
  • 打赏
  • 举报
回复
to liugys(liuliu)
你的代码很管用呀
mildface 2001-07-11
  • 打赏
  • 举报
回复
看看msdn吧,接口定义的很详细
-Platform SDK
-Graphics and Multimedia Services
-Windows Media
-Windows Media Encoder 7
mildface 2001-07-11
  • 打赏
  • 举报
回复
差一点的视频采集卡好象只要1000多块
liugys 2001-07-11
  • 打赏
  • 举报
回复
如果你是要实时录像转播的话,就要一个视频卡了!普通的4~5千,贵的1~2万
gottazhang 2001-07-11
  • 打赏
  • 举报
回复
Windows Media 编码器
cccmx 2001-07-11
  • 打赏
  • 举报
回复
就是用Windows Media Encoder SDK!能帮一下吗?
mildface 2001-07-11
  • 打赏
  • 举报
回复
应该可以用Windows Media Encoder SDK吧。
cccmx 2001-07-11
  • 打赏
  • 举报
回复
这个问题我也想参与。
liugys 2001-07-11
  • 打赏
  • 举报
回复
我这里有一个播放本地媒体文件的代码:


<html>
<head>
<title>网页式DivX播放器</title>



<script LANGUAGE="VBScript">
<!--
'播放文件类变量
dim ClipList(), SAMIList(), SubWindList()
dim ClipFilePre,ClipFileExt,SAMIFilePre,ListNumber,ClipTitle,ClipNoLength

'播放器相关变量
Dim PlayerOriginWidth,PlayerOriginHeight,PlayerAspect, ToolBarHeight,CloseCaptionHeight,WinWidthMore, WinHeightMore

Dim FullScreenMode, FullXOff, FullYOff, bLocalFileList, bLocalPlay
bLocalFileList=FALSE '是否使用本地文件列表
bLocalPlay=FALSE '是否启动本地播
FullScreenMode=False '是否进入全屏播放状态

dim Tid, CurrentClipNo
CurrentClipNo=0

'由ASP设定播放文件相关变量
sub SetFileVarByASP
'设定有规律文件
'设定影片数量
ListNumber=1
'有规律文件的播放
ClipFilePre=""
SAMIFilePre=""
ClipTitle=""

ClipFileExt="asf"
ReDim ClipList(ListNumber) ,SAMIList(ListNumber), SubWindList(ListNumber)
end sub

'设定连续文件
sub SetFileSeries
if ListNumber=1 then
SAMIList(1)=SAMIFilePre & ".smi"
ClipList(1)=ClipFilePre & "." & ClipFileExt
else
ClipNoLength=len(trim(ListNumber))
for i=1 to ListNumber
SAMIList(i)=SAMIFilePre & right("00"&trim(i),ClipNoLength) & ".smi"
ClipList(i)=ClipFilePre & right("00" &trim(i) ,ClipNoLength) & "." & ClipFileExt
next
end if
end sub

sub SetFileListLocal
'手工输入影片和字幕的文件名或URL,注意播放本地文件时用"/"代替"\",设置播放参数
'ListNumber=4
'bLocalFileList=TRUE
'ReDim ClipList(ListNumber) ,SAMIList(ListNumber), SubWindList(ListNumber)
'SAMIList(1)="file://g:/xmen.smi"
'ClipList(1)="mms://vod3.agri.sjtu.edu.cn/efishing/en/xmen.asf"
'SAMIList(2)="file://g:/mi2b.smi"
'ClipList(2)="mms://vod3.agri.sjtu.edu.cn/efishing/en/mi2b.asf"
'SAMIList(3)="file://f:/film/divx03.smi"
'ClipList(3)="file://f:/film/divx03.avi"
'ClipTitle="Mission Impossible 2"
end sub

'设置播放器原始参数
sub SetPlayerVar
PlayerOriginWidth=640
PlayerOriginHeight=360

ToolBarHeight=62
CloseCaptionHeight=60
WinWidthMore=32
WinHeightMore=32
FullXOff=-6
FullYOff=-26
PlayerASpect=PlayerOriginWidth/PlayerOriginHeight
end sub


'播放
sub BtnCloseSMI_onclick()
smi.style.visibility="hidden"
DisplayPlayer
BtnClip 1
end sub

sub DisplayPlayer
ToolBar.style.visibility="visible"
ShowVideoInfo.style.visibility="visible"
DivPlayer.style.visibility="visible"
window.resizeTo WMP1.width+WinWidthMore, WMP1.height+ToolBarHeight+CloseCaptionHeight+WinHeightMore
end sub

sub BtnRefresh_OnClick()
window.location.href=window.location.href
end sub


Sub BtnPlay_OnClick
On error resume next
WMP1.Play
End Sub

'暂停
Sub BtnPause_OnClick
On error resume next
WMP1.Pause
End Sub

'停止
Sub Btnstop_OnClick
On error resume next
WMP1.Stop
End Sub


'全屏
Sub BtnFullscreen_OnClick
if FullScreenMode then
window.moveTo 20,1
WMP1.width=PlayerOriginWidth
WMP1.height=PlayerOriginHeight
MyChangeWindowSize
WMP1.ShowStatusbar=TRUE
else
window.moveTo FullXOff, FullYOff
WMP1.width=Screen.width
WMP1.height=int(WMP1.Width/PlayerAspect)
WMP1.ShowStatusbar=FALSE
WMP1.ShowControls= FALSE
divPlayer.style.top=int((screen.height-WMP1.height)/2)
ToolBar.style.visibility="hidden"
showvideoinfo.style.visibility="hidden"
window.resizeTo screen.width+WinWidthMore,screen.height+WinHeightMore
FullScreenMode=TRUE
end if
End Sub

'放大
Sub Btnzoomout_OnClick
WMP1.width=WMP1.width+16
WMP1.height=WMP1.height+16/PlayerAspect
MyChangeWindowSize
End Sub

'缩小
Sub Btnzoomin_OnClick
if WMP1.width > 160 then
WMP1.width=WMP1.width-16
WMP1.height=WMP1.height-16/PlayerAspect
MyChangeWindowSize
end if
End Sub


'改变窗口大小的子程序
sub MyChangeWindowSize
window.resizeTo WMP1.width+WinWidthMore, WMP1.height+ToolBarHeight+CloseCaptionHeight+WinHeightMore
if FullScreenMode then
window.moveTo 20,1
divPlayer.style.top=ToolBarHeight
FullScreenMode=False
end if
end sub

'按下控制,打开关闭控制栏
Sub BtnControl_OnClick
WMP1.ShowControls= not WMP1.ShowControls
End Sub

'按下状态,打开关闭状态栏
Sub BtnStatus_OnClick
WMP1.ShowStatusBar= not WMP1.ShowStatusBar
End Sub

'按下数字按钮选片的子程序
Sub BtnClip(ListNo)
if ListNo > ListNumber then
MsgBox "无此部影音片断"
exit sub
end if
CurrentClipNo=ListNo
PlayCLipNo(ListNo)
End Sub

sub PlayCLipNo(ListNo)
ClipInfo.Value=":"&ListNo & "/" & ListNumber
On error resume next
WMP1.Stop
WMP1.SAMIFileName=SAMIList(ListNo)
WMP1.FileName=ClipList(ListNo)
WMP1.Play
end sub

'关闭窗口
Sub Btnclosewin_OnClick
On error resume next
WMP1.Stop
window.close
End Sub

Sub WMP1_EndOfStream(lResult)
if lResult=0 and CurrentClipNo < ListNumber then
CurrentClipNo=CurrentClipNo+1
tid=SetTimeOut("BtnClip(CurrentClipNo)",500)
end if
End Sub

Sub ToggleToolBar
select case ToolBar.style.visibility
case "hidden"
ToolBar.style.visibility="visible"
showvideoinfo.style.visibility="visible"
case "visible"
ToolBar.style.visibility="hidden"
showvideoinfo.style.visibility="hidden"
end select
end sub

'sub window_OnResize
' msgbox "Resize"
'end sub

'双击打开关闭按钮栏
sub OnDblClick()
if DivPlayer.style.visibility="visible" then
ToggleToolBar
end if
End Sub

sub BtnLocalPlay_OnClick
'将浏览器工具栏算在里面
if lcase(left(MyURL,4))="file" then
WinHeightMore=WinHeightMore+75
FullYOff=FullYOff-75
end if
if not bLocalFileList then '当用browse方式选择播放文件时
ListNumber=1
redim ClipList(ListNumber), SAMIList(ListNumber)
ClipList(1)="file:///"&replace(fileASFFile.value,"\","/")
SAMIList(1)="file:///"&replace(fileSAMIFile.value,"\","/")
end if
local.style.visibility="hidden"
DisplayPlayer
BtnClip 1
end sub
-->
</script>
</head>

<body bgcolor="#000000" text="#FFFF00" topmargin="0" leftmargin="0" ondblclick="OnDblClick()">
<script>

bLocalPlay=TRUE

'设定各种变量的值
dim MyURL
MyURL=window.location.href
SetFileVarByASP
SetFileSeries
if lcase(left(MyURL,4))="file" then
SetFileListLocal
end if
</script>

<!-- 控制按钮 -->
<div id="ToolBar" style="left: 0; top: 0; position: absolute; visibility: hidden; height: 30">
<table border="0" cellspacing="0" cellpadding="0" bordercolordark="#000000" width="635">
<tr>
<td align="center" height="1" valign="top" bgcolor="#000000">
<map name="FPMap0">
<area href="http://www.agri.sjtu.edu.cn/vod/default.htm" target="_blank" shape="rect" coords="3, 6, 101, 56">
<area shape="rect" coords="114, 40, 167, 54" onclick="btnplay_onclick" alt="播放">
<area shape="rect" coords="171, 40, 193, 54" onclick="btnstop_onclick" alt="停止">
<area shape="rect" coords="198, 39, 220, 53" onclick="btnpause_onclick" alt="暂停">
<area shape="rect" coords="249, 42, 306, 52" onclick="btncontrol_onclick" alt="控制栏">
<area shape="rect" coords="321, 44, 377, 53" onclick="btnstatus_onclick" alt="状态栏">
<area shape="rect" coords="390, 6, 412, 15" onclick="btnclip 1" alt="Clip1">
<area shape="rect" coords="425, 6, 450, 15" onclick="btnclip 2" alt="Clip2">
<area shape="rect" coords="459, 6, 483, 15" onclick="btnclip 3" alt="Clip3">
<area shape="rect" coords="492, 6, 518, 15" onclick="btnclip 4" alt="Clip4">
<area href="readme.htm" target="_blank" shape="circle" coords="464, 47, 7" alt="说明">
<area shape="circle" coords="494, 46, 8" onclick="btnfullscreen_onclick" alt="全屏/恢复">
<area shape="circle" coords="521, 47, 7" onclick="btnzoomin_onclick" alt="缩小">
<area shape="circle" coords="549, 47, 9" onclick="btnzoomout_onclick" alt="放大">
<area shape="circle" coords="576, 47, 8" onclick="btnclosewin_onclick" alt="关闭"></map><img border="0" src="control_0403.jpg" usemap="divxcc.asp#FPMap0" WIDTH="600" HEIGHT="60">
</td>
</tr>
</table>
</div>

<!-- 视频信息显示 -->
<div id="showvideoinfo" style="position:absolute; visibility: hidden; left:165; top:10; z-index:100">
<input type="text" name="ClipInfo" size="4" value=":1/?" style="font-family: Courier; border:0; background-color:black; color: yellow; margin: 0; padding: 0"></font>
</div>


<!-- 媒体播放器ActiveX控件 -->
<div id="divPlayer" style="left: 0; top: 60; visibility: hidden; position: absolute;">
<table border="0" cellspacing="0" cellpadding="0" bordercolordark="#000000" width="640">
<tr>
<td valign="bottom" align="left">
<p align="center">
<object classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="WMP1" height="360" width="640">
<param name="AutoStart" value="0">
<param name="ClickToPlay" value="1">
<param name="SendMouseClickEvents" value="1">
<param name="ShowControls" value="0">
<param name="ShowStatusBar" value="1">
</object>
</td>
</tr>
<tr>
<td height="80" align="center" valign="top"><div id="CaptionText"></div></td>
</tr>
<tr>
<td height="80" align="center" valign="bottom"> </td>
</tr>
</table>
</div>

<!--显示字幕-->
<div id="smi" style="position:absolute; left: 0; top: 640; visibility: hidden; ">
<table border="0" width="580">
<tr>
<td width="580">
<p align="center"><font color="#FFFF00"><font size="2">为防止浏览器停止响应,请等到字幕文件在以下各栏中正常显示后,再按下播放,否则请按刷新<br>
</font><input TYPE="button" NAME="BtnCloseSMI" VALUE="播 放">
<input type="button" name="BtnRefresh" value="刷 新" >
</font>
</td>
</tr>
</table>

<script>
'在表格中显示字幕文件
if lcase(left(MyURL,4))="http" and (not bLocalPlay) then
document.write "<table border='1' width='100%' cellspacing='0' cellpadding='0'>"
for i=1 to ListNumber
document.write "<tr>"
document.write " <td width='14%'>"
document.write " <p align='center'><font size='2' color='#FFFF00'>第" & i & "集</font></p>"
document.write " </td>"
document.write "<td width='86%'><iframe SRC='" & SAMIList(i) &"' FRAMEBORDER='0' WIDTH='520' HEIGHT='200' scrolling='yes' MARGINWIDTH='10' MARGINHEIGHT='10'></iframe></td>"
document.write "</tr>"
next
document.write "</table>"
end if
</script>
</div>

<div id="local" style="position:absolute; left: 0; top: 720; visibility: hidden; ">
<table border="0" width="580">
<tr>
<td width="580">
<p align="center"><font color="#FFFF00"><font size="2">影片文件可以为网上的文件,但字幕文件请选择本地文件,否则浏览器会停止响应<br>
</font><input TYPE="button" NAME="BtnLocalPlay" VALUE="播 放"> </font></p>
</td>
</tr>
</table>

<table border="0" width="640" cellpadding="2" height="114">
<tr>
<td width="482" height="64"><font size="2">
影片文件名:(文件后缀名为asf,avi,asx,mpg等)<br>
<input type="file" name="fileASFFile" size="56" style="font-family: Courier New"></font></td>
<td width="60" height="64"> </td>
</tr>
<tr>
<td width="482" height="38"><font size="2">字幕文件名:(文件后缀名为smi)<br>
<input type="file" name="fileSAMIFile" size="56" style="font-family: Courier New"></font></td>
<td width="60" height="38"> </td>
</tr>
</table>

</div>

<script LANGUAGE="VBScript">
'设定播放器的原始状态
window.moveTo 20,1
SetPlayerVar
divPlayer.style.top=ToolBarHeight
WMP1.width=PlayerOriginWidth
WMP1.height=PlayerOriginHeight
WMP1.CaptioningID="CaptionText"

if lcase(left(MyURL,4))="file" or bLocalPlay then '本地播放
local.style.top=0
local.style.visibility="visible"
if bLocalFileList then
BtnLocalPlay_onClick
else
window.resizeTo 600,320
end if
ClipTitle="[网页式DivX播放器]"
else '网上播放时打开字幕并等待第一部影片的播放
window.resizeTo 600,460
smi.style.top=0
smi.style.visibility="visible"

'设置浏览器标题
if ClipTitle="" then
ClipTitle=ClipList(1)&"-"&ListNumber & "集"
end if
ClipTitle=ClipTitle & " [网页式DivX播放器]"
end if
window.document.title=ClipTitle
</script>
</body>
</html>
wei54321 2001-07-11
  • 打赏
  • 举报
回复
我好像见过这种技术!在阅览器里的win media 播放器,但是源代码没有看到,速度不错!

gz
ashes 2001-07-11
  • 打赏
  • 举报
回复
关注
runbuff 2001-07-10
  • 打赏
  • 举报
回复
gz
cclxj 2001-07-10
  • 打赏
  • 举报
回复
我想在点播时进行实时的转化(多媒体文件- >asf,转换用media sdk 编程实现),然后在客户端用media player进行流式播放。
stanely 2001-07-10
  • 打赏
  • 举报
回复
用客户端activex

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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