kindeditor编辑器上传flv视频播放兼容ie8完美解决
你是否遇到过在使用kindeditor编辑器,后台传视频前台无法播放的问题,那是浏览器无法兼容导致的。ie8不支持embed标签,
下面介绍我的经验总结,在前台使用jquery替换掉原来的html5标签,让它变成使用传统的flash播放。
代码如下:
ie兼容性----
if(!!window.ActiveXObject || "ActiveXObject" in window){//ie8兼容性 deconcept.SWFObject.prototype.write=function(_20){ if(this.getAttribute("useExpressInstall")){ var _21=new deconcept.PlayerVersion([6,0,65]); if(this.installedVer.versionIsValid(_21) && !this.installedVer.versionIsValid(this.getAttribute("version"))){ this.setAttribute("doExpressInstall",true); this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl"))); document.title=document.title.slice(0,47)+" - Flash Player Installation"; this.addVariable("MMdoctitle",document.title) } } if(this.skipDetect||this.getAttribute("doExpressInstall") || this.installedVer.versionIsValid(this.getAttribute("version"))){ var n=(typeof _20=="string")?document.getElementById(_20):_20; $(n).html(this.getSWFHTML()); return true }else{ if(this.getAttribute("redirectUrl")!=""){ document.location.replace(this.getAttribute("redirectUrl")) } } return false }; }
主要代码------
<script src="/statics/home/js/mv/js/swfobject.js"></script> <script src="/statics/home/js/mv/js/ie8-patch.js"></script> <script> function createflv(vpath,id,w,h,autostart){ var s1 = new SWFObject("/statics/home/js/mv/flvplayer.swf","single",w,h,"7"); s1.addParam("allowfullscreen","true"); s1.addVariable("file","<{site_url('index/flvreader')}>?var=basepath/"+vpath); s1.addVariable("image",""); s1.addVariable("width",w); s1.addVariable("height",h); if(autostart==undefined || autostart=="undefined"){autostart="false";} s1.addVariable("autostart",autostart); s1.write(id); } </script> <script> $("embed").each(function(){ var vpath,id,w,h,autostart; vpath=$(this).attr('src'); id='v'+vpath.replace(/\//g,'_').replace(/\\./g,'_')+Math.floor(Math.random()*999+1).toString(); w=$(this).attr('width'); h=$(this).attr('height'); autostart=$(this).attr('autostart'); $(this).after('<p id="'+id+'" align="center"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>'); $(this).remove(); createflv(vpath,id,w,h,autostart); }); </script>
本文由php中文网提供,仅供参考,
不喜勿喷~~~
原文地址:http://www.php.cn/js-tutorial-374175.html
请勿转载~~~~
以上是kindeditor编辑器上传flv视频播放兼容ie8完美解决的详细内容。更多信息请关注PHP中文网其他相关文章!

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

JavaScript字符串替换方法详解及常见问题解答 本文将探讨两种在JavaScript中替换字符串字符的方法:在JavaScript代码内部替换和在网页HTML内部替换。 在JavaScript代码内部替换字符串 最直接的方法是使用replace()方法: str = str.replace("find","replace"); 该方法仅替换第一个匹配项。要替换所有匹配项,需使用正则表达式并添加全局标志g: str = str.replace(/fi

本教程向您展示了如何将自定义的Google搜索API集成到您的博客或网站中,提供了比标准WordPress主题搜索功能更精致的搜索体验。 令人惊讶的是简单!您将能够将搜索限制为Y

因此,在这里,您准备好了解所有称为Ajax的东西。但是,到底是什么? AJAX一词是指用于创建动态,交互式Web内容的一系列宽松的技术。 Ajax一词,最初由Jesse J创造

本文系列在2017年中期进行了最新信息和新示例。 在此JSON示例中,我们将研究如何使用JSON格式将简单值存储在文件中。 使用键值对符号,我们可以存储任何类型的

增强您的代码演示:开发人员的10个语法荧光笔 在您的网站或博客上共享代码片段是开发人员的常见实践。 选择合适的语法荧光笔可以显着提高可读性和视觉吸引力。 t

利用轻松的网页布局:8个基本插件 jQuery大大简化了网页布局。 本文重点介绍了简化该过程的八个功能强大的JQuery插件,对于手动网站创建特别有用

本文介绍了关于JavaScript和JQuery模型视图控制器(MVC)框架的10多个教程的精选选择,非常适合在新的一年中提高您的网络开发技能。 这些教程涵盖了来自Foundatio的一系列主题

核心要点 JavaScript 中的 this 通常指代“拥有”该方法的对象,但具体取决于函数的调用方式。 没有当前对象时,this 指代全局对象。在 Web 浏览器中,它由 window 表示。 调用函数时,this 保持全局对象;但调用对象构造函数或其任何方法时,this 指代对象的实例。 可以使用 call()、apply() 和 bind() 等方法更改 this 的上下文。这些方法使用给定的 this 值和参数调用函数。 JavaScript 是一门优秀的编程语言。几年前,这句话可
