PDA

View Full Version : A javascript technique to use FPP2.3 for Windows and 2.2 for Mac


Scott Witte
11-23-2008, 06:12 PM
Considering the problems FPP2.3 creates for Mac users it seemed dangerous to deploy. But I wanted a way for Windows users to get its benefits so I scratched out the javascript hack below. It seems to work:


<script type="text/javascript">
var so = new SWFObject("files/pano.swf", "VR_Tour", "100%", "100%", "9.0.28", "#CCCCCC");
if (navigator.appVersion.indexOf('Mac') != -1) {
var so = new SWFObject("files/pano22.swf", "VR_Tour", "100%", "100%", "9.0.28", "#CCCCCC");
}
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.addParam("SCALE","noborder");
so.addVariable("panoName", "images/Entrance_sm&panHome=-54&zoomHome=0.7");
so.addVariable("xml_file", "xml/reilly.xml");
so.useExpressInstall('files/expressinstall.swf');
so.addVariable("redirect", window.location);
so.write("flashContent");
</script>


The part in red detects the Mac OS and consequently uses FPP2.2. It needs to be placed after the original var statement so it replaces it only for Macs.
I renamed the 2.2 version of pano.swf to pano22.swf and placed that in my files folder along with the 2.3 version. You could also place the 2.2 version in its own folder and keep the original name. For instance, files22/pano.swf.

I am no expert, so if anyone who actually knows javascript wished to correct or expand on my code I would appreciate it.

BTW, this doesn't change the object/embed portion of the html but I have no idea why that is even necessary when using swfobject, anyway.

Hope this helps while we wait for a complete solution.

andrew22222
11-23-2008, 08:49 PM
Hi Scott,

I just read your post and had no idea FPP2.3 created any problems on the Mac. (I don't own one)

Next week I'll be uploading a completed project to someones server with 100 panoramas on there and they all use FPP2.3 so getting a little concerned as I reckon 20% of the viewers will be using some sort of Mac.

Any chance you could let me know what the issue is. If it's pretty bad I'm going to switch flash viewers all together for this one.

Thanks,

Andrew

Scott Witte
11-23-2008, 09:06 PM
Andrew,

Check out this thread (http://flashpanoramas.com/forum/showthread.php?t=1888) and Hans' example in his reply. Hans finds that the problem doesn't seem to happen with Pano2VR, but the other players seem to suffer similarly, as I recall. But understand, it only happens with version 2.3 and Mac. V2.2 is fine, although the performance suffers a little by comparison.

cheathamlane
11-23-2008, 11:01 PM
Hi Scott:

Huh, I haven't encountered the issue with FPP v2.3, _except_ for with Hans's example. :confused:

And, I haven't encountered it with other viewers, such as Pano2VR which you mention and one other one which I'm forbidden to mention on this list.

I run various flavors of Mac OS and browser.

[edit: and, my reason for posting was to say the javascript you post works exactly as it should, clean and neat]

Scott Witte
11-23-2008, 11:30 PM
Patrick,

That is kind of good news. I would love to offer the performance advantage of 2.3 to my Mac based visitors. After the discussions here and on the Google Groups list I feared it was universal.

I just changed the test pano from my other post (http://www.scottwitte.com/VR/box_test/) to be v2.3 only. I'm quite curious if anyone (on Mac) sees any shaking cube faces there. Please report back.

Trausti Hraunfjord
11-23-2008, 11:52 PM
The problem is absolutely present on the iMac on this end. One cube face goes half-way into the drapes at the foot end of the bed, and the next cube face which continues from there is jumping up and down. The other 3 connecting points are jumping as well.

Also tested it on a Mac Mini, and had the same result.

On PC it is rock solid.

Scott Witte
11-24-2008, 01:20 AM
Interesting. I just had another user with a one or two year old MacBook Pro (128MB Nvidia GPU) say he saw no jitter in this pano (using v2.3). There must be more at work than just FPP2.3 vs Flash 10.

Trausti Hraunfjord
11-24-2008, 02:10 AM
You have to know where to look I guess. The Mac Mini (PPC) is 3 years old, while the iMac (Intel) is only a few months old. Both show the same distortion. Moving the pano SLOWLY allows the jitterbug to be seen. In your pano it took a while for me to locate it, but once it has been spotted, it is easy to spot again.

aiwetir
11-24-2008, 08:52 AM
it happens on my year old intel mac and on a g5 ppc, i've seen it on every mac i've tried at stores too, if you aren't seeing it, you probably aren't looking.

krpano and pano2vr don't have the problem, it's the triangles that move, not necessarily the cube faces (the triangles edges reside on the cubefaces)

the script is nice, the actual solution would be to have denis fix the problem or at least acknowledge it :roll:

Sam Rohn
11-24-2008, 09:57 AM
scott, your pano looks fine on my mac pro tower, no jumping, mac pro 4x3ghz OSX 10.5.5 safari 3.1.2 flash 9.0.124.0 nvidia 7300 gpu 5GB ram

looked really closely at the area tuddi mentioned, still nothing

on my mac mini, intel 1.66 ghz core duo, 1GB ram,
same os, safari, flash - there it was, boom, the jumping is easy to spot

maybe its a graphics card thing ?

sam

andrew22222
11-24-2008, 04:32 PM
Thanks for the info Scott.

Dennis, are you there?
Is there any chance you can let me know if you'll have a Mac fix for the end of this week or working on one.

I'm going to get so many emails from annoyed visitors to my clients site if they can't view the panoramas on a Mac so I may run with krpano on this one as much as I like using FPP.

Thanks,

Andrew

Scott Witte
11-24-2008, 04:56 PM
Andrew,

Denis rarely monitors this forum except briefly after a major release so you won't get a reply from him here. You could email him directly and I encourage you to, but I doubt there will be a fix within a week. (Hoping I'm wrong but I fear the fix may not be trivial.)

That said, there is no reason Mac users wouldn't be able to view your panos. Using the technique I posted to start this thread they will simply use the Flash 9 player, which they effectively would be doing anyway if they haven't upgraded to Flash 10. (I'm surprised how many haven't including some flash programmers I know!) Worst case: Mac users with Flash ten wouldn't see the quality/performance improvements v2.3 offers but many of us have been pretty satisfied with v2.2 for some time.

You can even give Mac users an option to try the 2.3 player if they want by making that a separate link. In a few weeks, we likely will see a Mac fix and possibly even the much anticipated v2.4. If you would prefer to stay with FPP ideally, do you really want to make a crash effort to switch to another player temporarily?

Just food for thought. Your priorities are your own, of course.

Scott Witte
11-24-2008, 05:02 PM
Sam,

Thanks for testing. You may well be right about the graphics card being the culprit.

Maybe people could report what their GPU and video RAM are along with their results. That could help narrow this down.

nidrig
11-24-2008, 05:48 PM
Hi,

Here is a copy of the response Denis sent about Mac issues in fpp2.3:

Yes, looks like Adobe Flash 10 on Mac have some inaccuracy in bitmaps mapping. We posted this bug to Adobe already. Probably Adobe will release update with this bug patch. Currently we are seeking some trick to correct it manually...
You can use Flash 9 (FPP 2.2) for now.
Thanks,
Denis.

I doubt Denis will spend time coding a workaround if it's Adobe's fault.

cu

Scott Witte
11-24-2008, 05:56 PM
I doubt Denis will spend time coding a workaround if it's Adobe's fault.


You still have to wonder why the problem apparently doesn't show up using Pano2VR if it is a Flash10 problem.

nidrig
11-24-2008, 06:07 PM
You still have to wonder why the problem apparently doesn't show up using Pano2VR if it is a Flash10 problem.

Both player have different architecture. Maybe Denis is using a specific function that Pano2VR doesn't.

Btw, it seems people have trouble getting good results with pano2VR and flash10.

Sam Rohn
11-24-2008, 09:01 PM
Maybe people could report what their GPU and video RAM are along with their results. That could help narrow this down.

i added more info to my orig post, but here it is again -

mac pro 4x3ghz 5GB ram OSX 10.5.5 safari 3.1.2 flash 9.0.124.0 nvidia 7300 gpu - no jumping cube faces

mac mini, intel 1.66 ghz core duo, 1GB ram, OSX 10.5.5 safari 3.1.2 flash 10.0.12.36, core duo built in gpu - jumping cube faces are easily visible

sam

Trausti Hraunfjord
11-24-2008, 10:02 PM
iMac:
CPU: Intel Core 2 Duo 2.8 ghz
Memory: 2GB
GPU: ATI Radeon HD 2600 PRO with 256MB GDDR3 ram
OS: OSX 10.5.5
Browser:Firefox 3.0.4
Browser:Safari 3.1.2
Flash: 10.02.54

Mac Mini:
CPU: PPC 1.33ghz
Memory: 1GB
GPU: ATI Radeon 9200 32mb ram
OS: OSX 10.5.5
Browser:Firefox 3.0.4
Browser:Safari 3.1.2
Flash: 10.02.54

Both of the above show jitterbug

Scott Witte
11-24-2008, 10:37 PM
flash 9.0.124.0

Sam,

Please double / triple check your Flash version. If you really have Flash 9 and get the jumping cube faces it may point to FPP2.3 being the issue. Previously I only heard of FPP causing this with Flash 10 and Denis said the issue was with Flash 10.

Sam Rohn
11-25-2008, 12:21 AM
yep, you got me, i seem to have flash 10.0.12.36 on the mac mini, i will update my post above

and realized i may have been misunderstanding this issue, just upgraded my mac pro tower to flash 10, now i see the jumping here too :(

sorry if i have added any confusion here -

sam

HansNyberg
11-25-2008, 02:45 PM
Both player have different architecture. Maybe Denis is using a specific function that Pano2VR doesn't.

Btw, it seems people have trouble getting good results with pano2VR and flash10.

Pano2VR with flash 10 is better than any of the earlier versions.
It is almost up to FPP quality.
However if you look at it during panning you will se that lines are still wavy but at no motion they are straight.
So it might be that Thomas is optimizing the quality for motion different than FPP 2.3.

Regarding the moving cubefaces I checked them also on KRpano and it is only visible very little and only in his first example.
I guess this is a FPP optimizing problem and Denis told me he would try to do some more work on it.

On Mac PPC machines the problem is much smaller than on the new intels.

And also remember it is only visible if you have flash10. Flash 9+2,3 does not show it.

I do not find the problem that large compared to the wavy line which are now gone with flash 10

Hans

Scott Witte
11-29-2008, 04:42 AM
I do not find the problem that large compared to the wavy line which are now gone with flash 10

Now I really don't know what to do. Is it better to make FPP 2.3 the default for Mac users with Flash 10 or should I make 2.2 default and perhaps make 2.3 an option? I thought "jumping cube faces" made 2.3 in Flash 10 unusable on the Mac.

aiwetir
11-29-2008, 05:22 AM
scott, your pano looks fine on my mac pro tower, no jumping, mac pro 4x3ghz OSX 10.5.5 safari 3.1.2 flash 9.0.124.0 nvidia 7300 gpu 5GB ram

looked really closely at the area tuddi mentioned, still nothing

on my mac mini, intel 1.66 ghz core duo, 1GB ram,
same os, safari, flash - there it was, boom, the jumping is easy to spot

maybe its a graphics card thing ?

sam

sam, it's a fpp thing, the other players don't show it