如何自定义“旧版本” SWF 输出,带有 swfobject 2.1?

发布于 2024-10-10 06:11:37 字数 791 浏览 3 评论 0原文

我最近在一个项目中使用了 swfobject,它非常棒。但现在我已经成功地在 Firefox 中启动并运行 FlashSwitcher,我注意到当我运行 Flash Player 7 时,当我运行低于我指定的版本时显示的信息已被自定义(在本例中是由swfobject 嵌入代码所在的 Moodle 页面)。附件是由 Moodle 生成的输出 SWF 的屏幕截图。我可以确认我的一些用户也看到了这一点,所以我的 FlashSwitcher 运行正常。

我的大多数用例都在 Moodle 上下文之外,它们是独立的,我所追求的是他们如何定制它,我如何更改他们的定制,以及我如何做同样的事情当 swfobject 检测是独立的时。

请注意,客户端不赞成强制用户通过 ExpressInstall 升级其 Flash Player 插件,他们需要提示性操作和链接 - 但没有自动安装或类似功能。

我的实现使用“两次煮熟”方法,因为我有一个可访问性要求,即如果用户既没有 Flash、Javascript 也没有两者,则显示非 Flash 内容。这是我的嵌入方法调用,它在 YUI2 文档加载事件触发时执行:

swfobject.embedSWF("../../swf/video-loader.swf", "flash_object_a", "877", "400", "8.0");

最终我想将这个“旧版本”输出自定义为我创建/编写的内容。

Moodle 上下文中 swfobject 2.1 旧版本通知的屏幕截图

干杯, d

I've been using swfobject for a recent project, and its great. But now that I've managed to get FlashSwitcher up and running in Firefox I notice that when I'm running Flash Player 7 the info displayed when I am running a version lower than I've specified has been customised (in this case by the Moodle page the the swfobject embed code sits in). Attached is a screenshot of that output SWF, as generated by Moodle. I can confirm that some of my users also see this, so my FlashSwitcher is functioning correctly.

Most of my use cases are outside of the Moodle context, they're standalone, what I'm after is exactly how they customised it, how I can change their customisation, and how I can do the same when the swfobject detection is standalone.

Please note that enforcing the user to upgrade their Flash Player plugin via ExpressInstall has been frowned upon by the client, they want suggestive actions and a link - but no auto installs or similar.

My implementation uses the 'twice cooked' method as I have an accessibility requirement to show non-Flash content should a user have neither Flash, Javascript or both. Here's my embed method call, which executes when a YUI2 document load event fires:

swfobject.embedSWF("../../swf/video-loader.swf", "flash_object_a", "877", "400", "8.0");

Ultimately I want to customise this "old version" output to be something I've created/written.

Screenshot of swfobject 2.1 old version notification when in a Moodle context

cheers,
d

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沩ん囻菔务 2024-10-17 06:11:37

您可以使用 swfobject 的 getFlashPlayerVersion 方法(解释此处)检查 Flash Player 版本并采取适当的操作。

一个简单的例子是:

var has_version_8_or_greater = swfobject.hasFlashPlayerVersion("8");

if(has_version_8_or_greater){
   //embed SWF using SWFObject
} else {
   //Check to see whether an older version of Flash is found.
   var version = swfobject.getFlashPlayerVersion();
   if(version.major > 0){
      //You have Flash but it's too old.
      var version_str = version.major + "." + version.minor + "." + version.release;
      alert("You have Flash Player version " + version_str + ". Please update!");
   } else {
      //You don't have Flash.
   }
}

You can use swfobject's getFlashPlayerVersion method (explained here) to check for Flash Player version and take appropriate action.

A simple example would be:

var has_version_8_or_greater = swfobject.hasFlashPlayerVersion("8");

if(has_version_8_or_greater){
   //embed SWF using SWFObject
} else {
   //Check to see whether an older version of Flash is found.
   var version = swfobject.getFlashPlayerVersion();
   if(version.major > 0){
      //You have Flash but it's too old.
      var version_str = version.major + "." + version.minor + "." + version.release;
      alert("You have Flash Player version " + version_str + ". Please update!");
   } else {
      //You don't have Flash.
   }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文