Hi this is Dave, the Test Lead for IE Mobile.
Yes, there is an Adobe Flash player for Pocket PC. The Adobe Flash Player 7 for Pocket PC (sorry Smartphone users) works on a ton of sites but there have been some complaints that it doesn’t work everywhere. The reason for this discrepancy was not openly clear so the IE Mobile Test team decided to conduct an investigation.
Our investigation quickly revealed some common issues:
· Many sites used a commonly shared JavaScript sniff for Adobe Flash support. This JavaScript would than write out VBScript to detect Adobe Flash support and appropriately render the ActiveX control object for Flash *or* some alternative non-Adobe Flash content.
Ø Unlike desktop IE, IE Mobile does not support VBScript and it is unlikely that we would add support because it would increase our memory footprint by as much as 400K.
· We also found a few rare cases of the use of the <embed> tag to host variables for Adobe Flash object.
Ø <embed> is not is not a part of the HTML 4 or xHTML 1 specifications and as of right now, IE Mobile does not support it.
Adobe’s warnings about using JavaScript:
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_14526#builtin
“Ease of use makes script-based detection the method of choice for most people. However, the drawbacks are significant.”
Examples of what not to do:
Here are some commonly used problematic JavaScript examples pulled from real websites.
…
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) { document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag document.write('on error resume next \n'); document.write('FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.")))\n'); document.write('</SCR' + 'IPT\> \n');}
…
Or
…
// Check the browser...we're looking for ie/win
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; // true if we're on ie
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; // true if we're on windows
// This is a js1.1 code block, so make note that js1.1 is supported.
jsVersion = 1.1;
// Write vbscript detection on ie win. IE on Windows doesn't support regular
// JavaScript plugins array detection.
if(isIE && isWin){
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
document.write('<\/SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}
…
Or even this:
…
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0 )) {
var tVersionString = "";
document.write('<SCRIPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('set tSWControl = CreateObject("SWCtl.SWCtl") \n');
document.write('if IsObject(tSWControl) then \n');
document.write('tVersionString = tSWControl.ShockwaveVersion("") \n');
document.write('end if');
document.write('</SCRIPT\> \n');
…
The common problem is that the UserAgent sniffs allow IE Mobile to pass through because we have ”MSIE” and “Windows” in our UserAgent.
IEMobile’s UserAgent values:
http://blogs.msdn.com/iemobile/archive/2006/08/03/Detecting_IE_Mobile.aspx
- Our old UA: Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320)
- Our new UA: Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.7)
Example of the use of <embed> tag. Please don’t do this.:
<a href="http://fakesite.com/index.htm">" Title for control</a><br><embed enableJSURL="false" allowScriptAccess="never" allownetworking="internal" enableJavascript="false" allowScriptAccess="never" allownetworking="internal" enableJavascript="false" src="http://fakesite.com/sample.swf" flashvars="m=1368734076&type=video" type="application/x-shockwave-flash" width="430" height="346"></embed>
How can site owners make sure that Adobe Flash will work on IE Mobile?
Adobe’s Recommendation:
How to detect the Flash 4 Player without using JavaScript
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_14086
“This approach to Flash Player detection relies on two key elements; a Flash plug-in "sniffer" that uses the GetURL action which only the Flash 4 Player will respond to, and an HTML page with a META refresh tag. The index page of the site will use a Flash movie to detect for version 4 of the Flash Player and direct those browsers to the Flash 4 content. If the user hits the index page either without the Flash Player or with version 2 or 3 of the player, the META refresh tag will automatically send them to a non-Flash page which will prompt them to download version 4 of the Flash Player. This scheme works without using any JavaScript, making it both simpler and more browser-compatible.”
IE Mobile’s recommendation:
We are not hopeful enough to think that sites that use JavaScript for Adobe Flash detection are going to switch over to a non-script dependent method just because Adobe Flash doesn’t work on IE Mobile. We are just not a big enough player. Our best hope is to ask site owners to slightly modify their existing site code to allow Adobe Flash to display on IE Mobile.
Our research determined that the easiest way for Adobe Flash to work on IE Mobile is to add an additional “else if” statement, to their existing JavaScript, to specifically sniff out IE Mobile (Look for “CE” and “Win”) and than to allow for the ActiveX Adobe Flash control to render. The existing desktop browser sniffing logic will continue to work and in just a few lines of code you give support to IE Mobile.
I know what you are thinking. “What if you’re using IE Mobile on a SmartPhone? There is no Adobe Flash Player 7 support for SmartPhone.” or “What if the PPC device doesn’t have the Adobe Flash player installed?”
It is clear that our recommendation is not ideal because we risk not displaying the alternative “non-Flash” content that I mentioned at the top of the Blog. Realistically this situation is no worse than today’s experience because we are not displaying the Adobe Flash or the alternate non-Flash content on these sites already.
We could make the first example from above work by entering in the green “else if” statement below:
…
else if (navigator.userAgent && navigator.userAgent.indexOf("CE")>=0
&& (navigator.appVersion.indexOf("Win") != -1)) {
FlashCanPlay = true;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) { document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag document.write('on error resume next \n'); document.write('FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.")))\n'); document.write('</SCR' + 'IPT\> \n');}
…
I hope this helps.
Dave