怎么判断客户端是否安装了flash播放器

shukewu 2010-11-18 03:32:53
有一个页面程序包含了一个flash,怎么给用户提醒,当客户端没有安装播放器或者播放器版本比较低的时候个客户提示。
...全文
213 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
byyoung 2010-11-19
  • 打赏
  • 举报
回复
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="GiftDesign" width="100%" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="XXX.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="XXX.swf" quality="high" bgcolor="#869ca7"
width="100%" height="100%" name="XXX" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
byyoung 2010-11-19
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 hanxing0 的回复:]

这个嵌入浏览器时由解释器自动执行的吧?似乎不必考虑
[/Quote]
保留发布时与swf同时生成的html、playerProductInstall.swf和history文件夹即可,html里将需要的flash player版本和是否需要安装的代码都已经定义好了:
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 124;
// -----------------------------------------------------------------------------
// -->
</script>

<script language="JavaScript" type="text/javascript">
<!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);

// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

if ( hasProductInstall && !hasRequestedVersion ) {
// DO NOT MODIFY THE FOLLOWING FOUR LINES
// Location visited after installation is complete if installation is required
var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
var MMredirectURL = window.location;
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var MMdoctitle = document.title;

AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "GiftDesign",
"quality", "high",
"bgcolor", "#869ca7",
"name", "GiftDesign",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else if (hasRequestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"src", "GiftDesign",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "GiftDesign",
"quality", "high",
"bgcolor", "#869ca7",
"name", "GiftDesign",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here. '
+ 'This content requires the Adobe Flash Player. '
+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
document.write(alternateContent); // insert non-flash content
}
// -->
</script>
leemiki 2010-11-18
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 luckliuyi 的回复:]
swfObject可以方便的用来检测是否有FLASH PLAYER
[/Quote]

正解~~~
清风水岸 2010-11-18
  • 打赏
  • 举报
回复
这个嵌入浏览器时由解释器自动执行的吧?似乎不必考虑
luckliuyi 2010-11-18
  • 打赏
  • 举报
回复
swfObject可以方便的用来检测是否有FLASH PLAYER
byyoung 2010-11-18
  • 打赏
  • 举报
回复
只要保证发布文件的结构就可以,你不妨卸载flash player试试。
shukewu 2010-11-18
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 byyoung 的回复:]
flex发布的文件中包括一个html页面、一个swf档还有一个history文件夹以及playerProductInstall.swf,只要具备以上内容,就可以自动判断了。
[/Quote]

把这些发在服务下面就可以了嘛?
byyoung 2010-11-18
  • 打赏
  • 举报
回复
flex发布的文件中包括一个html页面、一个swf档还有一个history文件夹以及playerProductInstall.swf,只要具备以上内容,就可以自动判断了。

4,328

社区成员

发帖
与我相关
我的任务
社区描述
多媒体/设计 Flex
社区管理员
  • Flex
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧