安卓手机上怎么装UnityWebPlayer

网上有关“安卓手机上怎么装UnityWebPlayer”话题很是火热,小编也是针对安卓手机上怎么装UnityWebPlayer寻找了一些与之相关的一些信息进行分析,如果能碰巧解决你现在面临的问题,希望能够帮助到您。

WebPlayer,又称泰初影音,它融合了本地播放、网络播放等多种服务,全面支持远古流媒体系统,一直以良好的兼容性,完美的播放效果,下面我们一起来看看利用js检测我们是不是安装了WebPlayer哦。

<script language='VBScript'>

function detectUnityWebPlayerActiveX

on error resume next

dim tControl, res, ua, re, matches, major

res = 0

set tControl = CreateObject("UnityWebPlayer.UnityWebPlayer.1")

if IsObject(tControl) then

if tControl.GetPluginVersion() = "2.5.0f5" then

' 2.5.0f5 on Vista and later has an auto-update issue

' on Internet Explorer. Detect Vista (6.0 or later)

' and in that case treat it as not installed '

ua = Navigator.UserAgent

set re = new RegExp

re.Pattern = "Windows NT (d+)."

set matches = re.Execute(ua)

if matches.Count = 1 then

major = CInt(matches(0).SubMatches(0))

if major < 6 then

res = 1

end if

end if

else

res = 1

end if

end if

detectUnityWebPlayerActiveX = res

end function

</script>

<script language="javascript1.1" type="text/javascript">

function detectUnityWebPlayer () {

var tInstalled = false;

if (navigator.appVersion.indexOf("MSIE") != -1 &&

navigator.appVersion.toLowerCase().indexOf("win") != -1)

{

tInstalled = detectUnityWebPlayerActiveX();

}

else if (navigator.mimeTypes && navigator.mimeTypes["application/vnd.unity"])

{

if (navigator.mimeTypes["application/vnd.unity"].enabledPlugin &&

navigator.plugins && navigator.plugins["Unity Player"])

{

tInstalled = true;

}

}

return tInstalled;

}

</script>

检测代码:

if (detectUnityWebPlayer()) {//新检查unity是否安装 added by shanmao

alert(‘测试检测已安装111′)

}else{

setTimeout(“check_unity_down()”,1000);

alert(‘测试检测未安装222′)

}

另:

自动安装unity webplayer 代码:unityObject.enableAutoInstall(true);

关于“安卓手机上怎么装UnityWebPlayer”这个话题的介绍,今天小编就给大家分享完了,如果对你有所帮助请保持对本站的关注!

本文来自作者[书荷]投稿,不代表海宁号立场,如若转载,请注明出处:https://m.hnjsjm.com/hainin/6721.html

(2)
书荷的头像书荷签约作者

文章推荐

发表回复

作者才能评论

评论列表(3条)

  • 书荷的头像
    书荷 2025年09月06日

    我是海宁号的签约作者“书荷”

  • 书荷
    书荷 2025年09月06日

    本文概览:网上有关“安卓手机上怎么装UnityWebPlayer”话题很是火热,小编也是针对安卓手机上怎么装UnityWebPlayer寻找了一些与之相关的一些信息进行分析,如果能碰巧解...

  • 书荷
    用户090611 2025年09月06日

    文章不错《安卓手机上怎么装UnityWebPlayer》内容很有帮助