Not Detecting Flash 10: World's Most Widespread Web Video Bug? - javascript

Here's the Question: What is the best way to make sure that your requirement for Flash Version "x" on a site will properly detect presence of later-version Adobe Flash Player Version "10" (or "1y" for that matter)?
Now here's the mystery: Why are so many sites that require Flash Player versions 8 and 9 or better failing to detect Flash Player version 10?
And here's the juicy background, in technicolor screen captures in my post, "WTF: The Adobe Flash Version 1x Crisis."
UPDATE 2: I have since confirmed that the problem I am seeing is not about improper comparison for the same-or-more-recent version. It appears that some client-side detection is unable to determine whether there is any Flash Player installed at all, much less what version it is. I have also discovered that if I am running as admin I don't have the problem: detection of Flash 10 works just fine. That makes this a bigger can of snakes than I first thought. I'm not ready to change this question's title just yet, and I am continuing to dissect client-side code to see what wondrous logic unfolds. Details on these latest revelations are on my blog.
UPDATE: Although I did a search, I missed the related question "Why don't flash videos play after upgrading to Flash 10?" The speculations there are interesting but they don't get to the bottom of it. Also, it's not clear how Levi's problem was resolved. Interesting ... Maybe we can get to the bottom of things here.
Some Background
I managed to install the new Adobe Flash Player version 10.0.12.36 as a clean install (with previous versions removed using the Adobe-provided uninstaller).
The first disappointment was noticed when I couldn't play the latest NCIS program from the CBS Television site, not in HD, not in plain-old standard. But I could play videos of my favorite programs on Hulu. The more I nosed around, the more times I found those obnoxious you-don't-have-Flash, you-need-a-later-version-of-Flash, your-version-of-Flash-old messages that offered a button for downloading.
Every time I clicked the download/update button, and told the Adobe site to do the install (which should fail if attempted, because I am not running as admin), my already having version 10.0.12.36 was confirmed instantly and no update was attempted.
Curious, huh?
The Challenge
I think I know exactly what the most-likely bug is in the Flash-detection script that people are using. It is just too juicy to not be the bug.
Now, that does not mean all sites that fail to detect version 10 suffer from the same bug. I just think the one I have in mind is really likely. I should probably seal my theory in an envelope somewhere. Meanwhile, let's see what the StackOverflow community has to offer and what we conclude the lesson is.
I say the bug is really simple and very funny. What do you say?

My guess is the javascript is doing string comparison, and in string land, "10" < "9".
Also, Flash10 changed their security model somewhat (breaking a tool I use called SWFUpload) so it may be related to that (see: http://benr75.com/articles/2008/11/25/swfupload-with-flash-10-fix )

My guess would be detection from string which is something like "Flash Player version X.Y" by doing something like "get the character before '.' and convert it to number." I've done this a few times myself, it's just stupid.

Unfortunately the problem is caused because the poor version detection shipped with flash. That's right, the shoddy code it actually created by Adobe Flash (not sure which versions), which is the reason it's so widespread.
Personally I use swfObject to embed flash.

Related

Find current version AND Adobe's latest version of Flash

Recently, we found that Firefox had made a change towards plugins, such that the user will be temporarily blocked from running them if they are not using the latest version. Our site requires Flash to play sound and interact with the user's webcam/microphone, so we need to do whatever we can to ensure they're not getting these warnings.
One way suggested to me is to create a small Flash control, and wait for it to tell Javascript that it's been initialized. If not (and the user is using Firefox) then they are taken to a page prompting them to update. This may work, but I worry about its reliability, and about running it on every page in our site.
Alternatively, I've been researching a way to use Javascript to detect versions, without making a Flash control. I not only need the user's current version of Flash, but also the version Firefox will expect - and I haven't found an autonomous way of doing so. I don't want an admin to have to change a small value each time Adobe releases a new version. Does anyone have any advice how I could find Flash's latest available version, or an alternate way to solve my problem?
I recommend you have a look at SWFOject and the Express Install option which should ease upgrading considerably.
I just noticed someone upvoting this question, so I thought that I would provide my eventual solution, which I think reduced the impact of a recent issue where Firefox blocked the most recent edition of Flash, pending Adobe's fix.
Basically, I went with a variation on the second paragraph in my question. It does not direct the user to a new page; instead, it opens a dialog over the current page that explains it's having issues communicating with Flash. (It does not specifically say "Your Flash is out of date" because this can also happen if the browser is hiding flash under a Yes/No user dialog). It also contains a small fake flash object, with the idea being that if the browser wants to display a security warning, accept prompt, etc., it can do it inside that space.
The dialog goes away on its own if said Flash control ends up making its callback to JavaScript. It also installs a variable under sessionStorage so we don't bother checking for it again (Flash takes enough time on some computers that you might see the dialog for a split second).

Web-Based Game Engines - Request For Input

I'm creating a web-based online game and am trying to find the best fit in terms of a framework for the front end of the game. The back end of the game is currently using asp.net mvc 2. Given that I could take the controller actions and turn them into WCF service actions the choice in the back end should not affect my options of a front end.
One thing that is certain, it does need to play in a browser. I have done some research on an HTML 5-only front end as part of this process and am probably leaning in this direction but I have a few concerns:
Assuming this game is completed this time next year, what kinds of difficulties will I have with current HTML 5 adoption levels? Specifically I'm worried about Firefox 3.6 and IE 7/8 still having a large install base. I have looked at Chrome Frame to solve the IE problem but am not sure if there are drawbacks to that I am unaware of either (other than the installation requirement).
I'm used to doing C# with a nice IDE complete with realtime information about whether the code compiles and intellisense reminding me of symbol names. Am I going to run into a problem with Javascript where my code becomes big and difficult to manage? The accessibility problem that a Javascript only engine solves for my users is more important than convenience for me but it of course can't be unmanageable either.
Are the HTML 5 engines on the market right now mature enough to trust with my time investment? Am I at high risk of adopting a framework that will fall into disrepair in a year from now? Of the engines I have looked at, none seem to have really great community support, am I wrong? Are there others out there that do?
here are those I have found thus far:
CraftyJS (http://craftyjs.com/api/Sprite.html)
ImpactJS (http://impactjs.com/)
PropulsionJS (http://www.propulsionjs.com/)
The Render Engine (http://www.renderengine.com/demos.php)
RPG JS (http://rpgjs.com/)
EaselJS (http://easeljs.com/)
Does anyone know anything of the community with these or have any reason to trust that any of these will be well maintained or available for at least the next several years? Does anyone know of another framework that's out there? ImpatJS has the most impressive demo of them all and it's also the only one that isn't free.
Thanks for any help / advice. I'm just worried I'll choose a front-end that I regret and I don't want to have to start from scratch 4 or 5 months down the road.
This is a 2D browser-game. It's not targeting mobile now, but it will be moving to mobile immediately after first launch. One hope is that it will work on mobile fine if I do HTML 5. I may have to tweak it for display size but if I don't have to port it to mobile that would be a definite plus.
This is my two cents having just been through the same decision making process for my company.
Our goal was to create as broad a game as possible that means it needs to run on as many browsers as possible. I ruled out html5 right away because the adoption is not there and seems to be at least a couple years until it reaches more than 60% penetration.
This left me with Flash vs. Silverlight. Flash's installed base is huge and there are many game engines available for it. Flash is a safe bet unless you have specific requirements for video or 3d.
I choose Silverlight because I wanted a good installed base (60%) and I wanted to leverage my companies’ in-house .Net expertise. I also wanted to use WCF for the backend and did not want to mix environments.
Keep in mind that SL5 is going to support most of XNA which is a big deal. There are a ton of XNA engines and source code that you can use to start with.
Here's a great site for looking at html5 browser support:
http://caniuse.com/
I can't speak with expertise on the particulars of HTML5 and Canvas, but...
As far as support goes, you'll still have probably a large bunch of IE7-8 users. IE is a little different than other browsers because you have to DO something to install updates. (i.e, go to the Install Updates in Control Panel or visit ie.microsoft.com). Other browsers (like firefox) just tell you and make the update easy. So your FF 3.6 users should be gone, but IE will still probably be a problem. Keep in mind, though, that much of the old IE browser share is due to IT depts. keeping their users on older versions - something you won't need to worry about.
This could be a problem. However, developing JS in Visual Studio or a similar IDE isn't so bad - there's still IntelliSense and other helpful things, as well as realtime debugging. It's definitely going to be a bit more difficult than C#, especially as many of the new JS api's haven't been implemented into the Autocomplete's of many IDE's.
I don't think you need be afraid of this. At this point, HTML5 and Canvas have gotten far enough that they won't be revoked, only improved. There may be a few modifications of the APIS and such, but not enough to keep you from using it.
Is HTML5 going to replace Flash? No, because games and RIA that require more out of javascript cannot be done until enough of the world is using IE 15 (which is about 5 10 years). Safari, Chrome, FF (maybe), will be up to par here soon but their js engines are going to require good hardware and that's not always going to be there.
Silverlight is a good option but it's not as well supported as Flash. This is why flash will still be around. The next version will support video controllers. It' called Project Mole hill and you can check out my SO question here.
If you want to make super simple games without good graphics try out one of those services you suggested. impact.js is $100, the others look free. In the future we will be able to use node.js to handle request with servers, but in the meantime Flash is certaily the way to go!.
I would much much much rather use javascript but after you start coding and realize the limitations compared flash will make your application standout.
Then for mobile devise, iPad, iPhone, Android, etc.. If you really think your audience is there build the game in the their language. It's more epensive and and harder, but Objective C, Java, they are much faster than HTML, JS, CSS etc...
I did some trial runs with YUI3, Burst engine & Raphael for SVG animation - everything seemed to run well; YUI's dragdrop module even detects the same drag operations on Mobile without adding a single line of code.
I can only imagine that if I had the time, a YUI3 instance available on a Node.js server with Raphael SVG animation would be my choice. You could drop the SVG aspect and use more standard graphic techniques, or perhaps serve up alternate quality graphics for those User Agents with fewer testes. Maybe it could be that your alternate quality version is just another implementation of your game engine - and you might choose to develop games using non-SVG anyway.
Just thoughts mostly, that doesn't help with your real-time IDE debugging...
impact.js has a great community and documentation. It is well worth checking out. I believe iosimpact.js is part of the package (although beta???) allowing for the development of native games for the iphone/ipad.
Yes, indeed you will lose a large user base. But how relevant that user base will be to you will depend on what your target is. Every-day-RPG players are much more likely to have the latest browser than Sunday-Morning-Sudoku users.
Give Eclipse + Web Tools + Aptana a try. It worked really nice for me.
No experience there.
There are certainly people out there who think that HTML5 is going to replace flash in online games. Here is an HTML/Javascript based engine that I heard about few days ago
http://www.youtube.com/watch?v=_RRnyChxijA
I haven't actually used it but it looks really promising and It's designed for similar set of requirements that you've put. It lets you design 2D / 2.5D ( isometric projections ) games. And it does look promising.

Why is it acceptable to expect that Flash will be available/enabled, but not JavaScript?

It doesn't take long when surfing the web to observe the general consensus that Flash is an expected standard, that it's okay to say "If you don't have Flash, my website won't work." Yet in the same regard, JavaScript is expected to degrade peacefully if the user does not have it enabled.
I personally favor the "HTML5" approach, in opposition to Flash, due to the poor performance Flash brings to Mac OS X and Linux
The overall outlook of the Flash way vs. the JavaScript way seems like the biggest challenge to me in Steve Job's prediction of HTML5 overtaking Flash, and I personally haven't seen any sign of change.
Am I missing something?
HTML5 will probably not kill Flash. Although I'm an Actionscript 3 developer, I have little love for Adobe and if anyone is going to kill Flash, I believe it will be Adobe themselves by failing to adapt.
Web standards are great but inevitably changes take for ever.Solutions developed by smaller entities can implement changes and adapt faster. Look at how JQuery changed the perception of Javascript. Most people have already forgotten that until recently there was very little love for Javascript, which is probably where the degrade gracefully attitude comes from.
The consensus is now to complain about Flash , the real shame is what Adobe has done with it , or more to the point hasn't done to improve it. I agree with Steve Jobs on that one, Adobe are either lazy or misguided. In any case totally inefficient.
In my view there's nothing wrong with a plugin, provided it works as expected and with a penetration above 90% , Flash has/had the potential to become a standard itself... in another world that is.
You're talking about almost entirely different groups of people with very different worldviews. That's why they say two different things. Very few people are both gung-ho Flash fanatics and slavish adherents to progressive enhancement.
For the people who support Javascript, one of the big reasons many do so is that it's an open standard with free implementations that is accessible to anybody, not just those favored by Adobe. This feeling that Web content should be available to everybody on the Web also makes them hostile to Javascript that takes the same "My way or the highway" stance that led them to reject Flash.
It's not OK to say either of those, in the general case. However for some it's acceptable to give up on having a working site for some percentage of users.
It depends on the kind of project you are developing for.
It's only safe to assume the user will be able do interact only with the HTML (that's why it's a good idea to hijax your form instead of assuming the user will be able to run your ajax function)
As for FLASH I aways assume it will be unavailable to a small be considerable group of users (iphone, and ipad user won't be able to interact with your flash)
So basically, when developing a portal I assume that:
The user browser will be able to
display HTML
There's a great probability that the user's browser will be able to interpret javascript
There's a considerably smaller probability that the user will have the flash plugin
My rule of thumb is: If you have to have flash at all use it for non-important stuff. All important stuff should be able to work fine with just HTML
The reason is because Flash has a penetration of around 99% of all internet connected computers, and acts exactly the same across the board. Flash has many features which are not replaceable (until very recently, thanks to HTML5 and better JavaScript implementations) While JavaScript implementations are all incomplete as well as varying in between browsers.
I'm not a flash developer, but I'm guessing there would be different methodologies too. The whole mantra of modern web development is a sort of additive synthesis, so you start with something basic, then work up from there, building up features as you go along.
The real reason is that if you use flash on your website, you probably don't give a toss about things like accessibility and other minor concerns.
JavaScript developers are also much nicer people.
Typically JavaScript is used to support basic but important operations, and being important goes hand in hand with high usage frequency, large audience, possibly business critical. Thus it is important that they require "peaceful degradation".
Flash tends to be used for splashy stuff, like games, heavy UI apps (like paint style programs). These tend to be less important and so less reason for them to degrade peacefully.
For example, I can see the Flash part of Google's analytics site making way for HTML5 in the future. It is suited to it. But something like Google's street view I see no real reason to go down the HTML5 route for it (although I suspect they still might).

Adding WYSIWYG to a site that is not your own?

This website that I use has a WYSIWYG that ONLY works in IE. And I refuse to use IE or to tell my non-tech team to use IE.
I was wondering if there is a user script or browser plugin that would enable anyone to inject a WYSIWYG such as CKeditor.com onto any site textarea?
Edit: I would also be willing to work on it myself if anyone wants to help or give advice. We could then post it on userscripts or something ...
Since you don't have access to the code, anything you do will be a hack.
With that in mind, I would start looking at Greasemonkey. It is a firefox plugin that allows you to inject javascript code into any web page on your machine. Its a long road, but that's probably your first step.
One word of warning however: While I share in your dislike of IE, it sounds like your hatred has grown to the point where it is being counterproductive. Seriously consider whether what you are about to do is worth the effort.
You can use this extension in Firefox as long as you get at least a textarea in that CMS: https://addons.mozilla.org/en-US/firefox/addon/6147/
Would a Firefox extension that displays websites as if they were in IE do the trick?
I like Stargazer712's answer (look into Greasemonkey), but there is another option.
Suck it up and use IE for just this site.
Hey, I hate IE6 and 7 as much as the next Web developer. I advise non-techies to stay away from it, and to use Firefox or Chrome. My answer isn't meant to be flip or funny.
Sometimes, if you need to get the job done, you choose the best tool for the job (even if you don't like using the tool) to get the work done in the most efficient manner possible. In this case, it sounds like using IE to access this particular Web site takes care of the problem without a single line of code or documentation written on your part.
The alternative is spending hours finding (and testing -- because you won't be the only user) an alternative...or worse, spending hours or days developing (and, again, testing) your own code to fix the problem that, at the end of the day, is really only caused by your strong dislike of the one software application that works.

Some kind of task manager for JavaScript in Firefox 3?

Recently I have been having issues with Firefox 3 on Ubuntu Hardy Heron.
I will click on a link and it will hang for a while. I don't know if its a bug in Firefox 3 or a page running too much client side JavaScript, but I would like to try and debug it a bit.
So, my question is "is there a way to have some kind of process explorer, or task manager sort of thing for Firefox 3?"
I would like to be able to see what tabs are using what percent of my processor via the JavaScript on that page (or anything in the page that is causing CPU/memory usage).
Does anybody know of a plugin that does this, or something similar? Has anyone else done this kind of inspection another way?
I know about FireBug, but I can't imagine how I would use it to finger which tab is using a lot of resources.
Any suggestions or insights?
It's probably the awesome firefox3 fsync "bug", which is a giant pile of fail.
In summary
Firefox3 saves its bookmarks and history in an SQLite database
Every time you load a page it writes to this database several times
SQLite cares deeply that you don't lose your bookmarks, so each time it writes, instructs the kernel to flush it's database file to disk and ensure that it's fully written
Many variants of linux, when told to flush like that, flush EVERY FILE. This may take up to a minute or more if you have background tasks doing any kind of disk intensive stuff.
The kernel makes firefox wait while this flush happens, which locks up the UI.
So, my question is, is there a way to have some kind of process explorer, or task manager sort of thing for Firefox 3?
Because of the way Firefox is built this is not possible at the moment. But the new Internet Explorer 8 Beta 2 and the just announced Google Chrome browser are heading in that direction, so I suppose Firefox will be heading there too.
Here is a post ( Google Chrome Process Manager ),by John Resig from Mozilla and jQuery fame on the subject.
There's a thorough discussion of this that explains all of the fsync related problems that affected pre-3.0 versions of FF. In general, I have not seen the behaviour since then either, and really it shouldn't be a problem at all if your system isn't also doing IO intensive tasks. Firebug/Venkman make for nice debuggers, but they would be painful for figuring out these kinds of problems for someone else's code, IMO.
I also wish that there was an easy way to look at CPU utilization in Firefox by tab, though, as I often find myself with FF eating 100% CPU, but no clue which part is causing the problem.
XUL Profiler is an awesome extension that can point out extensions and client side JS gone bananas CPU-wise. It does not work on a per-tab basis, but per-script (or so). You can normally relate those .js scripts to your tabs or extensions by hand.
It is also worth mentioning that Google Chrome has built-in a really good task manager that gives memory and CPU usage per tab, extension and plugin.
[XUL Profiler] is a Javascript profiler. It
shows elapsed time in each method as a
graph, as well as browser canvas zones
redraws to help track down consuming
CPU chunks of code.
Traces all JS calls and paint events
in XUL and pages context. Builds an
animation showing dynamically the
canvas zones being redrawn.
As of FF 3.6.10 it is not up to date in that it is not marked as compatible anymore. But it still works and you can override the incompatibility with the equally awesome MR Tech Toolkit extension.
There's no "process explorer" kind of tool for Firefox; but there's https://developer.mozilla.org/en-US/docs/Archive/Mozilla/Venkman with profiling mode, which you could use to see the time spent by chrome (meaning non-content, that is not web-page) scripts.
From what I've read about it, DTrace might also be useful for this sort of thing, but it requires creating a custom build and possibly adding additional probes to the source. I haven't played with it myself yet.

Categories