适配IE8+等浏览器的适配播放插件
function myBrowser(){
var userAgent = navigator.userAgent; //ȡ���������userAgent�ַ�
var isOpera = userAgent.indexOf("Opera") > -1;
if (isOpera) {
return "Opera"
} //�ж��Ƿ�Opera�����
if (userAgent.indexOf("Android") > -1||userAgent.indexOf("iPhone") > -1||userAgent.indexOf("iPad") > -1){
return "Mobile";
}
if (userAgent.indexOf("Firefox") > -1) {
return "FF";
} //�ж��Ƿ�Firefox�����
if (userAgent.indexOf("Chrome") > -1){
return "Chrome";
}
if (userAgent.indexOf("Safari") > -1) {
return "Safari";
} //�ж��Ƿ�Safari�����
if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
return "IE";
} //�ж��Ƿ�IE�����
}
function showVedio(url,coverurl,w,h,isAuto){
if(isAuto==null)
{
isAuto=false;
}
var b = myBrowser();var str;
if(b=="Safari"||b=="FF"||b=="Opera"||b=="Mobile")
{
str='<video width="'+w+'" height="'+h+'" controls poster="'+coverurl+'"><source src="'+url+'" type="video/mp4"/></video>'
}
else
{
str='<object id="vcastr3" data="js/vcastr/Flvplayer.swf" height="'+h+'px" width="'+w+'px" type="application/x-shockwave-flash">';
str+='<param name="movie" value="js/vcastr/Flvplayer.swf"><param value="transparent" name="wmode">';
str+='<param name="allowFullScreen" value="true">';
str+='<param name="FlashVars" value="xml=<vcastr><channel><item><source>'+url+'</source><image>'+coverurl+'</image></item></channel><config><isAutoPlay>true</isAutoPlay><isLoadBegin>'+isAuto+'</isLoadBegin><isShowAbout>false</isShowAbout><scaleMode>showAll</scaleMode></config>' +
'<plugIns><beginEndImagePlugIn><url>js/vcastr/beginEndImagePlugIn.swf</url><source>'+coverurl+'</source><type>begin</type><scaleType>exactFit</scaleType></beginEndImagePlugIn></plugIns></vcastr>"></object>';
//'<logoPlugIn><url>js/vcastr/logoPlugIn.swf</url><logoText>www.meowpet.com</logoText><logoTextAlpha>0.75</logoTextAlpha><logoTextFontSize>20</logoTextFontSize><logoTextLink>www.meowpet.com</logoTextLink><logoTextColor>0xffffff</logoTextColor><textMargin>20 20 auto auto</textMargin></logoPlugIn>">';
str+='';
}
document.write(str);
}
使用方法:
<script type="text/javascript">
showVedio("视频地址","视频封面图片",宽,高);
</script>
适配IE8+等浏览器的适配播放插件的更多相关文章
- 给Debian浏览器安装flash播放插件
sudo apt-get install flashplugin-nonfree
- 功能强大的滚动播放插件JQ-Slide
查看效果:http://keleyi.com/keleyi/phtml/jqplug/4.htmJQ-Slide插件功能强大,滚动方式自由多样全部滚动方式 方式一 方式二 方式三 方式四 方式五 方式 ...
- 自己做jQuery插件:将audio5js封装成jQuery语音播放插件
日前的一个项目需要用到语音播放功能.发现Audio5js符合需求且使用简单,又鉴于jQuery控件便于开发操作,于是有了以下的封装. 首先先简单介绍一下Audio5js吧. Audio5js是一个能够 ...
- jQuery语音播放插件
自己做jQuery插件:将audio5js封装成jQuery语音播放插件 日前的一个项目需要用到语音播放功能.发现Audio5js符合需求且使用简单,又鉴于jQuery控件便于开发操作,于是有了以 ...
- Web页面使用VLC播放插件
一.原生态Demo下载 选择原因:我们为什么选择VLC播放插件?原因是它支持IE8浏览器播放视频,如果高版本的浏览器大可不必选择该插件,很多html5插件既好用又简单,但是有些交管或政府 部门还是限制 ...
- 兼容IE8以下浏览器input表单属性placeholder不能智能提示功能
当前很多表单提示使用了表单属性placeholder,可这属性不兼容IE8以下的浏览器,我自己写了一个兼容处理js // 兼容IE8以下浏览器input不能智能提示功能 if(navigator.ap ...
- 分享8款精美的jQuery图片播放插件
本文将和大家一起分享8款精美的jQuery图片播放插件,每一款插件均有演示和源码下载,有兴趣的朋友可以下载使用和研究.废话不多说了,直接上这些插件. 1.3D轮播相册 这款3D相册插件利用了HTML5 ...
- 使用FlashWavRecorder实现浏览器录制wav音频和上传音频文件,兼容IE8以上浏览器
前言:本项目基于github开源插件实现,该插件使用flash实现,兼容IE8以上浏览器 感谢michalstocki的分享该项目,github项目地址:https://github.com/mich ...
- 浏览器未安装flash插件,js判断直接去官网安装
近期做了个活动页,里面根据需求插入了阿里云的视频,常见的浏览器都支持包括低版本的. 由于浏览器的更新换代很多版本放弃了flash的插件安装,火狐就是其中之一. 未安装flash的浏览器如果打开这个链接 ...
随机推荐
- ArcGIS Engine中的Symbols详解(转)
本文来源:http://blog.csdn.net/mengdong_zy/article/details/8980842 原文如下: Symbols Symbol level drawing Joi ...
- Andoid Intent学习之在各个活动之间传递数据
Intent是一种运行时绑定(run-time binding)机制,它能在程序运行过程中连接两个不同的组件.通过Intent,你的程序可以向Android表达某种请求或者意愿,Android会根据意 ...
- Laravel 获取当前 Guard 分析 —源自电商购物车的实际需求
iBrand 产品中关于购物车的需求比较复杂,我们基于 overture/laravel-shopping-cart 扩展出了更加符合电商需求的购物车包,之前有文章进行过简单的介绍: Laravel ...
- Docker build 安装报错, Could not open requirments file: [Errno 2] No such file or directory:'requirements.txt'
docker安装教程 https://docs.docker.com/get-started/part2/#build-the-app 相关帖子 https://stackoverflow.com/q ...
- C++指针、引用、const
; int *p = &a; //定义指针p指向变量a *p = ; //*p代表a的值 ; p = &b; //p指向变量b *p = ; //此时*p代表b的值 ] = {,,}; ...
- 2017.9.24 基于HTML+JavaScript+CSS的开发案例&&JavaScript+CSS+DIV实现表格变色
1.JavaScript+CSS+DIV实现下拉菜单 1.1 层标签<div> 基本语法: <div id="层编号" style="position: ...
- lintcode 77.Longest Common Subsequence(最长公共子序列)、79. Longest Common Substring(最长公共子串)
Longest Common Subsequence最长公共子序列: 每个dp位置表示的是第i.j个字母的最长公共子序列 class Solution { public: int findLength ...
- 编写第一个OpenACC程序
原文链接 在PGI的官方网站上获得示例代码: http://www.pgroup.com/lit/samples/pgi_accelerator_examples.tar 我们的第一个例子从一个简单的 ...
- 旧文备份:windows下编译和使用IT++
1.下载IT++最新版:<a href="http://sourceforge.net/projects/itpp/">http://sourceforge.net/p ...
- 第19章 通讯的基本概念—零死角玩转STM32-F429系列
第19章 通讯的基本概念 全套200集视频教程和1000页PDF教程请到秉火论坛下载:www.firebbs.cn 野火视频教程优酷观看网址:http://i.youku.com/firege ...