[转]在网页中加入声音文件,并且用JavaScript对其进行播放控制
2007-06-01 11:04
405 查看
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" validateRequest="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script language="javascript" type="text/javascript">
//用javascript进行声音播放控制
function ManageSoundControl(action)
...{
var soundControl = document.getElementById("soundControl");
if(action == "play")
...{
soundControl.play();
}
if(action == "stop")
...{
soundControl.stop();
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<table width="100%">
<tr>
<td>
<embed id="soundControl" src="求佛.mp3" mastersound hidden="true" loop="false" autostart="false"></embed>
<input id="btPlay" type="button" value="播放" onclick="ManageSoundControl('play')" />
<input id="btStop" type="button" value="播放" onclick="ManageSoundControl('stop')" />
</td>
</tr>
</table>
</form>
</body>
</html>
相关文章推荐
- 用javascript进行声音播放控制
- Web网页中使用Media Player播放MPG视频的代码,并且支持JavaScript控制播放,暂停等功能
- ASP.NET中将声音文件添加到资源中并进行播放的方法
- VC资源文件中加入自己的声音资源,使自己的应用程序可以播放声音
- 在网页上播放声音文件的方式
- 利用vedio播放视频和原生js对其进行控制
- ASP.NET中将声音文件添加到资源中并进行播放的方法
- 原生javascript爬取网页内所有的js文件并且排序
- 在XNA 3.0 项目添加声音——播放并控制简单的.wav声音文件
- 网页嵌入播放器,并且可以控制播放列表的
- MFC点击按钮发出声音_playsound_循环/单次播放_声音文件加入程序中
- 在网页中用JavaScript控制Flash的播放
- Javascript控制网页内Quicktime插件音视频播放
- 在网页中用JAVASCRIPT控制FLASH的播放
- 网页上播放声音的简单实现(兼容IE/CHROME)
- pocket PC 播放声音文件
- JavaScript控制网页层收起和展开效果的方法
- 如何播放声音文件
- Git 忽略一些文件不加入版本控制
- Fortran 从文件中读取数据放入数组中,然后对其进行bubble sort,使用了一些方法防止人为错误