日期:2014-05-17  浏览次数:20737 次

如何在网页中嵌入视频文件???
我是做网站前台的,想学习在网页中嵌入视频文件,可是琢磨了老半天,没有什么明显效果
http://www.expo2011.cn/2010/0826/497.html

就像世园会官方网站上这样的效果,

请赐教~~~

O(∩_∩)O~

------解决方案--------------------
我前面有用到一个JW 播放器,在网页上嵌套播放器就可以实现。

当然还有简单点的,直接使用windows 的midePlay


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
<TITLE> Media Player </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">

<script language="javascript">
 //<!--
var g_Browser = navigator.appName;
function controlType (setting)
{
if (g_Browser == "Netscape")
document.WMPlay.SetShowControls(setting);
else
document.WMPlay.ShowControls = setting;
}
function displaySize (setting)
{
if (g_Browser == "Netscape")
document.WMPlay.SetDisplaySize(setting);
else
document.WMPlay.DisplaySize = setting;
}
function PlayClick ()
{
document.WMPlay.Play();
}
function StopClick ()
{
document.WMPlay.Stop();
if (g_Browser == "Netscape")
document.WMPlay.SetCurrentPosition(0);
else
document.WMPlay.CurrentPosition = 0;
}
function PauseClick ()
{
document.WMPlay.Pause();
}
function PlayPauseClick ()
{
var state;
if (g_Browser == "Netscape")
state = document.WMPlay.GetPlayState();
else
state = document.WMPlay.PlayState;
if (state == 0)
document.WMPlay.Play();
else if (state == 1)
document.WMPlay.Play();
else if (state == 2)
document.WMPlay.Pause();
}
//-->
</script>
 </HEAD>

 <BODY>
<!-- ID是对象的名称,当用户在JavaScript要对Media Player进行控制时可以用该对象的名称WMPlay进行访问 -->
<!-- CODEBASE指明当用户的浏览器中没有安装Player控件时可以从该URL指定的位置去获取-->
<OBJECT
ID="WMPlay" 
WIDTH='500' 
HEIGHT='350'
CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
STANDBY="Loading Microsoft? Windows Media? Player components..."
TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="http://192.168.1.115/flv/4.flv">
<!--是否显示控件 http://content.longtailvideo.com/videos/flvplayer.flv-->
<PARAM NAME="ShowControls" VALUE="true">
<PARAM NAME="AutoRewind" VALUE="true">
<PARAM NAME="AutoStart" VALUE="true">
<!-- <embed id="MediaPlaye" type="application/x-mplayer2" id="embed" filename="flv/video_1.flv" height="260" width="300"></embed> -->
</OBJECT>

<form name="myform">
<input type="button" width="15" value="No Controls " name="NoControls"
OnClick="controlType(false)">
<input type="button" width="15" value="All Controls" name="Full"
Onclick="controlType(true)">
<input type="button" width="15" value=" Small " name="Small"
OnClick="displaySize(1)">
<input type="button" value=" Large " name="Large"
Onclick="displaySize(2)">
<input type