Javascript让媒体通过指定的按钮播放


因为windows特定的mediaplayer的媒体代码只支持在IE里使用,所以以下代码不支持FF。功能实现通过外部按钮来控制媒体播放。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<object classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95 codebase="http://activex.microsoft.com/activex/controls/mplayer
/en/nsmp2inf.cab#Version=6,1,5,217"
id=MediaPlayer type=application/x-oleobject width=210 height=240 standby="Loading Microsoft Windows Media Player components..." VIEWASTEXT align=MIDDLE>
<param name=AudioStream value=-1>
<param name=AutoSize value=0>
<param name=AutoStart value=0>
<param name=AnimationAtStart value=0>
<param name=AllowScan value=-1>
<param name=AllowChangeDisplaySize value=0>
<param name=AutoRewind value=0>
<param name=Balance value=0>
<param name=BaseURL value="">
<param name=BufferingTime value=5>
<param name=CaptioningID value="">
<param name=ClickToPlay value=0>
<param name=CursorType value=32512>
<param name=CurrentPosition value=-1>
<param name=CurrentMarker value=0>
<param name=DefaultFrame value=1>
<param name=DisplayBackColor value=0>
<param name=DisplayForeColor value=16777215>
<param name=DisplayMode value=0>
<param name=DisplaySize value=0>
<param name=Enabled value=-1>
<param name=EnableContextMenu value=-1>
<param name=EnablePositionControls value=0>
<param name=EnableFullScreenControls value=0>
<param name=EnableTracker value=1>
<param name=Filename value="http://www.phpstudy.net/music/sejie/000025.mp3">
<param name=InvokeURLs value=-1>
<param name=Language value=-1>
<param name=Mute value=0>
<param name=PlayCount value=1>
<param name=PreviewMode value=0>
<param name=Rate value=1>
<param name=SAMILang value="">
<param name=SAMIStyle value="">
<param name=SAMIFileName value="">
<param name=SelectionStart value=0>
<param name=SelectionEnd value=true>
<param name=SendOpenStateChangeEvents value=-1>
<param name=SendWarningEvents value=-1>
<param name=SendErrorEvents value=-1>
<param name=SendKeyboardEvents value=0>
<param name=SendMouseClickEvents value=0>
<param name=SendMouseMoveEvents value=0>
<param name=SendPlayStateChangeEvents value=-1>
<param name=ShowCaptioning value=0>
<param name=ShowControls value=1>
<param name=ShowAudioControls value=1>
<param name=ShowDisplay value=1>
<param name=ShowGotoBar value=1>
<param name=ShowPositionControls value=1>
<param name=ShowStatusBar value=1>
<param name=ShowTracker value=1>
<param name=TransparentAtStart value=0>
<param name=VideoBorderWidth value=0>
<param name=VideoBorderColor value=0>
<param name=VideoBorder3D value=0>
<param name=Volume value=-1070>
<param name=WindowlessVideo value=1>
</object><br>
<script type="text/javascript">
function play(){
document.getElementById("MediaPlayer").play();
}
</script>
<input type="button" value="播放" onClick="play()">
</body>
</html>



相关阅读:
Apache负载均衡设置方法: mod_proxy
Javascript & DHTML DOM基础和基本API
Oracle表连接的奇怪问题
php中用数组的方法设置cookies
使弱类型的语言JavaScript变强势
PHP4在WinXP下IIS和Apache2服务器上的安装实例
使用静态类实现JSP自定义标签
redhat下磁盘配额设置!
JavaScrip单线程引擎工作原理分析
用DIV+CSS设计出圆角矩形的代码
快速清除SQLServer日志的两种方法
Dojo Javascript 编程规范 [1]
在Linux下配置基于策略的路由
HTML5网页3D技术标准发布 无需插件即可将网页3D化
快速导航

Copyright © 2016 phpStudy |