你是否遇到过在使用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中文網其他相關文章!

javaandjavascriptaredistinctlanguages:javaisusedforenterpriseandmobileapps,while javascriptifforInteractiveWebpages.1)JavaisComcompoppored,statieldinglationallyTypted,statilly tater astrunsonjvm.2)

JavaScript核心數據類型在瀏覽器和Node.js中一致,但處理方式和額外類型有所不同。 1)全局對像在瀏覽器中為window,在Node.js中為global。 2)Node.js獨有Buffer對象,用於處理二進制數據。 3)性能和時間處理在兩者間也有差異,需根據環境調整代碼。

JavaScriptusestwotypesofcomments:single-line(//)andmulti-line(//).1)Use//forquicknotesorsingle-lineexplanations.2)Use//forlongerexplanationsorcommentingoutblocksofcode.Commentsshouldexplainthe'why',notthe'what',andbeplacedabovetherelevantcodeforclari

Python和JavaScript的主要區別在於類型系統和應用場景。 1.Python使用動態類型,適合科學計算和數據分析。 2.JavaScript採用弱類型,廣泛用於前端和全棧開發。兩者在異步編程和性能優化上各有優勢,選擇時應根據項目需求決定。

選擇Python還是JavaScript取決於項目類型:1)數據科學和自動化任務選擇Python;2)前端和全棧開發選擇JavaScript。 Python因其在數據處理和自動化方面的強大庫而備受青睞,而JavaScript則因其在網頁交互和全棧開發中的優勢而不可或缺。

Python和JavaScript各有優勢,選擇取決於項目需求和個人偏好。 1.Python易學,語法簡潔,適用於數據科學和後端開發,但執行速度較慢。 2.JavaScript在前端開發中無處不在,異步編程能力強,Node.js使其適用於全棧開發,但語法可能複雜且易出錯。

javascriptisnotbuiltoncorc; sanInterpretedlanguagethatrunsonenginesoftenwritteninc.1)JavascriptwasdesignedAsignedAsalightWeight,drackendedlanguageforwebbrowsers.2)Enginesevolvedfromsimpleterterpretpretpretpretpreterterpretpretpretpretpretpretpretpretpretcompilerers,典型地,替代品。

JavaScript可用於前端和後端開發。前端通過DOM操作增強用戶體驗,後端通過Node.js處理服務器任務。 1.前端示例:改變網頁文本內容。 2.後端示例:創建Node.js服務器。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

SublimeText3 Linux新版
SublimeText3 Linux最新版

SublimeText3 英文版
推薦:為Win版本,支援程式碼提示!

VSCode Windows 64位元 下載
微軟推出的免費、功能強大的一款IDE編輯器

MantisBT
Mantis是一個易於部署的基於Web的缺陷追蹤工具,用於幫助產品缺陷追蹤。它需要PHP、MySQL和一個Web伺服器。請查看我們的演示和託管服務。

ZendStudio 13.5.1 Mac
強大的PHP整合開發環境