全兼容ie chrome firefox 的 windows media play 示例
来源:互联网 发布:统计局数据自查报告 编辑:程序博客网 时间:2024/05/01 13:18
IE直接使用,firefox需要装插件wmpfirefoxplugin,chrome需要装wmpChrome
wmp api 见:wmp api
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>无标题文档</title><script type="text/javascript">function showPlayer(id,url){ var vhtml = '<object id="wmp"'; var userAg = navigator.userAgent; if(-1 != userAg.indexOf("MSIE")){ vhtml+=' classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"'; } else if(-1 != userAg.indexOf("Firefox") || -1 != userAg.indexOf("Chrome") || -1 != userAg.indexOf("Opera") || -1 != userAg.indexOf("Safari")){ vhtml+=' type="application/x-ms-wmp"'; } vhtml+=' width="700" height="400">'; vhtml+='<param name="URL" value="'+url+'"/>'; //下面这些播放器的参数自己配置吧 vhtml+='<param name="autoStart" value="true" />'; vhtml+='<param name="invokeURLs" value="false">'; vhtml+='<param name="playCount" value="100">'; vhtml+='<param name="Volume" value="100">'; vhtml+='<param name="defaultFrame" value="datawindow">'; vhtml+='</object>'; document.getElementById(id).innerHTML = vhtml; } //showPlayer(id,url)id=为要插入播放器的父层id url=歌曲地址 function play(elem){document.getElementById('wmp').URL=elem.href;}</script><style type="text/css"></style></head><body onLoad='showPlayer("player","");'><div id="player"> </div> <a href="http://video-js.zencoder.com/oceans-clip.mp4" onClick="play(this);return false;">视频示例1</a> <a href="http://www.w3school.com.cn/example/html5/mov_bbb.mp4" onClick="play(this);return false;">视频示例2</a> <a href="http://html5video.org/media/sintel.mp4" onClick="play(this);return false;">视频示例3</a></body></html>
0 0
- 全兼容ie chrome firefox 的 windows media play 示例
- 兼容IE-FireFox-Chrome的背景音乐播放
- 兼容IE-FireFox-Chrome的背景音乐播放
- 使window.open() 全兼容IE, Firefox, Chrome的最新写法
- pasteHTML兼容ie,firefox,chrome
- FLASH兼容IE FireFox Chrome
- 兼容ie,firefox,chrome的跨域加载js脚本
- 兼容firefox、chrome、ie的wmp网页播放器代码
- 兼容IE,FireFox,Chrome主流的文字阴影功能。
- 兼容IE、FireFox、Chrome等浏览器的xml处理函数
- JSP上放置兼容Firefox、IE、Chrome的applet
- IE、Firefox、Chrome 的JS代码兼容注意事项
- iframe框架取值兼容ie/firefox/chrome的写法
- event 兼容调用(IE,Firefox,Chrome)
- js操作select 兼容ie、chrome、Firefox
- 回到顶部代码,兼容IE CHROME FIREFOX
- pasteHTML兼容ie,firefox,chrome等浏览器
- js鼠标滚轮事件详解(全兼容ie、chrome、firefox)实现图片缩放
- Asp.Net 用户验证(自定义IPrincipal和IIdentity)
- 【分享】500人东北方言手机语音数据库(样例)
- htts忘记配置证书
- iOS 关于枚举的使用
- ASPCMS后台产品参数增加编辑器字段报错修复
- 全兼容ie chrome firefox 的 windows media play 示例
- linux top命令格式详解
- Python中的动态类型
- A new Nova service: nova-conductor
- Axure高级教程--在原型中插入视频
- 机器学习中的相似性度量
- Microsoft Accelerator for Windows Azure Alum Azuqua 今天启动
- C#使用LitJson解析JSON
- myeclipse6.5 date格式设置