Community
Participate
Working Groups
Build Identifier: SWT 3.7 If you try to display a page with Flash content (Flash 10.1 or later) in the Browser widget inside an applet the Flash content only draws when the applet is dragged out of the web page. This is because Flash is using CALayers for its drawing. Recent Mac Java builds will let you obtain a CALayer instead of an NSView, which is how we normally parent the embedded shell. Using that to back the NSView might be a possible solution. Reproducible: Always Steps to Reproduce: Show a page which contains a Flash animation/application in a Browser embedded in an applet.
Created attachment 199718 [details] Test case showing the issue This is the original test case that I sent to Scott Kovatch. To run it, simply: - Unzip "TestSWTAWTApplet.zip" - cd TestSWTAWTApplet - ant -f build.xml - Go to "/Applications/Utilities/Java Preference" and check "Run applets in their own process". - open SWTAWTAppletMac.html It uses SWT 3.7M5, 32-bit (JVM is forced with -d32, even in 64-bit systems). The default test page is a full-screen Flash animation with sound, but you can change it to anything you like in the HTML applet params. e.g.: "http://www.adobe.com/software/flash/about/" to actually see html and Flash in the same page.
This was found in a Java application that manipulates Flash applications, among other things, and is accessible from within a web browser. It is deployed as a JNLP-based Java applet, using the new out-process plugin2, which integrates SWT Browsers (SWT_AWT bridge), which load a web page, which loads a flash application. All was working fine on Windows and Mac (and maybe Linux), until they upgraded from Flash 9 to Flash 10: on Mac, the Flash content is there (can hear sound) but there is nothing diplayed anymore. Notes: - The rest of the web page shows up. - It works fine on Windows. - It works fine on Mac with Flash 9. - It works fine on Mac with Flash 10 when run from WebStart. - It works fine on Mac with Flash 10 when run from the applet viewer.
The test case was actually used to investigate bug 337499.
What is interesting is that if you embed the SWT browser in Safari which uses the older, Apple developed, Java Plugin 1, flash videos render fine. The problem with that, though, is that the old plugin 1 is no longer being developed and both Firefox and Chrome on Mac use the new Java Plugin 2 by default.
While investigating the iFrame shim solution for Mac, I came across this question on Stack Overflow. "Masking a plugin (or applet) to show html content over it in Chrome on the Mac - Stack Overflow" The top answer to this question may provide some clues as to why WebKit is not rendering flash videos in the SWT browser. Also, I noticed that I do not need the iFrame shim on Mac when I use the Firefox browser to embed the SWT browser. I.e. Firefox allows light weight HTML components to overlay the heavy-weight Java applet, whereas in Google Chrome the heavy-weight applet always show through the light weight components. One possibility to make flash work on Mac in the SWT browser (not a fix) would be to use the Mozilla engine (SWT.MOZILLA) instead of the default WebKit (SWT.NONE). I have not tried this myself, but will report back here when I do.
Here is the link to that Stack Overflow question: http://stackoverflow.com/questions/6760330/masking-a-plugin-or-applet-to-show-html-content-over-it-in-chrome-on-the-mac
Have there been any developments on this bug? Plugin 1 is now completely gone on Mac, even in Safari. Flash videos were rendering fine with Plugin 1 which was an Apple developed Java Plugin. The current Java Plugin for Mac (Plugin 2) is now being maintained by Oracle. Did Apple turn over their plugin 1 code to Oracle? If so, the clues to fixing this may lie in that code. The question is... in which codebase can this be fixed? Does this require a fix in the Java Plugin 2 or can this be fixed in SWT? Since Flash videos worked in Plugin 1, it would indicate the perhaps the fix needs to happen in the new Java Plugin 2. Anyways, I think the root of the problem remains the same. The SWT browser is being embedded using a NSView which is incapable of rendering video. The CoreAnimation CALayer is the correct Mac OS component to render video. Here is a link to Apple's documentation on Views Vs Layers, and Layer Backed Views. http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/Animation_Overview/ChooseAnimTech/ChooseAnimTech.html
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the "stalebug" whiteboard tag.