如何根据平台切换资产:适用于Windows的Flash和适用于iOS的HTML5

how to switch assets based on the platform: flash for windows and HTML5 for ios

本文关键字:适用于 Flash Windows HTML5 iOS 何根 平台      更新时间:2023-09-26

我是一名电子学习开发人员,在我的课程中使用动画闪光灯(*swf)。

我们提供针对ipad的html5格式的相同课程:使用Google Swiffy完成的Flash到html 5转换。

缺点是相同的内容被打包两次 - 一个使用flash,另一个使用Html5,并放置在两个不同的位置,学习者可以根据他/她将用于访问课程的设备注册到任一版本。

我相信这不是正确的策略,我应该能够将课程作为一个整体提供。

任何人都可以通过自动检测正在访问的内容来帮助如何使用等效的 html5 代码段切换 swf?

提前谢谢你。

PS:许多学习者仍然使用旧版本的IE,我们不能单独提供HTML5。

它一定是为了帮助检测您的设备:

 var isMobile = {
    Android: function() {
        return navigator.userAgent.match(/Android/i);
    },
    BlackBerry: function() {
        return navigator.userAgent.match(/BlackBerry/i);
    },
    iOS: function() {
        return navigator.userAgent.match(/iPhone|iPad|iPod/i);
    },
    Opera: function() {
        return navigator.userAgent.match(/Opera Mini/i);
    },
    Windows: function() {
        return navigator.userAgent.match(/IEMobile/i);
    },
    any: function() {
        return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
    }
};