在自己的电脑上播放三分屏教学视频时,总觉得左边那两个小屏幕太占位置,还有右上方的小屏幕的播放进度条太短而无法精确拖放。虽然不是很懂HTML,但修改一下代码,还是单屏能播放的!
下面是单屏播放asf和vga文件的设置:
(1)文件夹结构
index.htm(播放视频的主文件)
frm000.htm(上方,演示窗口)
frmleftup.htm(下方,主讲人窗口)
localclip.asx(本机播放asf视频文件名)
remoteclip.asx(远程播放asf视频文件名)
Screen.vga(每集的VGA视频演示文件)
000.asf(每集的主讲人视频文件)
index.htm,frm000.htm,frmleftup.htm,localclip.asx,remoteclip.asx这些文件都需要手动创建,或者直接在原来的文件上修改
Screen.vga,000.asf这两个文件下载视频的时候就有的。
(2)具体的配置文件
index.htm:
<HTML><HEAD><TITLE>标准C编程</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML" name=GENERATOR></HEAD><FRAMESET rows=91%,*>
<FRAME id=UpFrame name=UpFrame marginWidth=0 borderColor=white marginHeight=0 src="frm000.htm" frameBorder=2 scrolling=no BGCOLOR="#000000">
<FRAME id=DownFrame name=DownFrame marginWidth=0 borderColor=white marginHeight=0 src="frmleftup.htm" frameBorder=2 scrolling=no target="UpFrame">
</FRAMESET>
</HTML>
frm000.htm:
<HTML><HEAD><TITLE>VGA Frame</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR>
<META content=none name="Microsoft Border">
<STYLE>A:link {
TEXT-DECORATION: none
}
A:visited {
TEXT-DECORATION: none
}
A:active {
TEXT-DECORATION: none
}
A:hover {
FONT-WEIGHT: bold; COLOR: rgb(255,255,0); TEXT-DECORATION: none
}
</STYLE>
<SCRIPT language=javascript>
if (window.name != "UpFrame") location = "index.htm";
</SCRIPT>
<SCRIPT language=javascript event=OnSkip(Seconds) for=VGAPlayer>
parent.DownFrame.MediaPlayer.Controls.CurrentPosition = Seconds;
</SCRIPT>
<SCRIPT language=javascript event=onload for=window>
//Load VGA File
Dir = new String(location);
Dir = Dir.substring(0, Dir.length - 10);
VGAPlayer.Open(Dir + 'Screen.vga');
</SCRIPT>
</HEAD>
<BODY bgColor=#000000>
<P>
<OBJECT id=VGAPlayer style="LEFT: 0px; POSITION: absolute; TOP: 0px"
codeBase=VGAPlayer.cab#version=3,0,1,648 height="100%" width="100%"
classid=clsid:339C1EE2-1029-46B8-81F1-360217F26FC4><PARAM NAME="Visible" VALUE="-1"><PARAM NAME="AutoScroll" VALUE="0"><PARAM NAME="AutoSize" VALUE="0"><PARAM NAME="AxBorderStyle" VALUE="1"><PARAM NAME="Caption" VALUE="ZoomPic"><PARAM NAME="Color" VALUE="2147483663"><PARAM NAME="Font" VALUE="MS Sans Serif"><PARAM NAME="KeyPreview" VALUE="0"><PARAM NAME="PixelsPerInch" VALUE="96"><PARAM NAME="PrintScale" VALUE="1"><PARAM NAME="Scaled" VALUE="-1"><PARAM NAME="DropTarget" VALUE="0"><PARAM NAME="HelpFile" VALUE=""><PARAM NAME="DoubleBuffered" VALUE="0"><PARAM NAME="Enabled" VALUE="-1"><PARAM NAME="Cursor" VALUE="0"></OBJECT></P></BODY></HTML>
frmleftup.htm:
<HTML><HEAD><TITLE>Video</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<SCRIPT language=javascript>
if (window.name != "DownFrame") location = "index.htm";
</SCRIPT>
<SCRIPT language=javascript event=onload for=window>
//Load ASF File
if(document.location.protocol == "file:")
AsxFileName = "localclip.asx";
else
AsxFileName = "remoteclip.asx";
MediaPlayer.URL = AsxFileName;
</SCRIPT>
<SCRIPT language=javascript>
var mpStopped=1, mpPaused=2, mpPlaying=3,
mpScanForward=4, mpScanReverse=5, mpEnded=8,
NeverUpdatePosition=1,TimerID=0,
Waiting=0,WaitingCount=0,
AsxFileName;
function Syn()
{
TimerID = setTimeout("Syn()",1000);
if (MediaPlayer.PlayState == mpPlaying)
{
if ((MediaPlayer.Controls.currentPosition * 1000 > parent.UpFrame.VGAPlayer.Max) &&
(parent.UpFrame.VGAPlayer.Max < parent.UpFrame.VGAPlayer.Duration))
{
Waiting = 1;
WaitingCount = 10;
MediaPlayer.Controls.Pause();
}
parent.UpFrame.VGAPlayer.CurrentPosition = MediaPlayer.Controls.currentPosition * 1000;
}
else
if (Waiting)
{
WaitingCount--;
if (WaitingCount == 0)
{
if (MediaPlayer.Controls.currentPosition * 1000 < parent.UpFrame.VGAPlayer.Max)
{
Waiting=0;
MediaPlayer.Controls.Play();
}
else
WaitingCount = 10;
}
}
}
</SCRIPT>
<SCRIPT language=javascript event=Buffering(Start) for=MediaPlayer>
if (Start)
{
parent.UpFrame.VGAPlayer.Pause();
}
else
{
parent.UpFrame.VGAPlayer.Play();
}
</SCRIPT>
<SCRIPT language=javascript event=playStateChange(NewState) for=MediaPlayer>
switch(NewState)
{
case mpPlaying:
parent.UpFrame.VGAPlayer.Play();
if (TimerID == 0) Syn();
break;
case mpPaused:
parent.UpFrame.VGAPlayer.Pause();
break;
case mpStopped:
parent.UpFrame.VGAPlayer.Stop();
break;
case mpEnded:
parent.UpFrame.VGAPlayer.Stop();
}
</SCRIPT>
<SCRIPT language=javascript
event="PositionChange(dblOldPosition, dblNewPosition)" for=MediaPlayer>
parent.UpFrame.VGAPlayer.CurrentPosition = dblNewPosition * 1000;
</SCRIPT>
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY bgColor=black>
<OBJECT id=MediaPlayer height="100%" width="100%" align=right
classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6><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="100"><PARAM NAME="mute" VALUE="0"><PARAM NAME="uiMode" VALUE="full"><PARAM NAME="stretchToFit" VALUE="-1"><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="ShowTracker" Value="1">
type=application/x-oleobject standby="Loading Microsoft? Windows?
Media Player components...">
</OBJECT></OBJECT></BODY></HTML>
localclip.asx和remoteclip.asx一样设置为以下内容的:
<ASX VERSION=3.0>
<Entry>
<Ref href="000.asf"/>
</Entry>
</ASX>