Sarah, Max,
here's how you can test the updated version:
Compile test/fullscreen/fullscreentest1.lzx?lzr=swf9
There's a new attribute on canvas: @fullscreen
@fullscreen is set to "true", that means you can switch to fullscreen
mode by calling canvas.showFullScreen(true). That method call has to
be triggered either by a keypress or mouse click to work (Flash
security!).
If you set fullscreen="false" and compile, clicking on the "Toggle
Fullscreen" button will give you an error message in the debug window.
I've changed the template for lzt=html as well, so app-console.xslt
and html-reponse.xslt are the only ones that work for now.
What do you think of this approach? Feedback welcome!
- Raju
Change 20090613-raju-r by r...@atlantia on 2009-06-13 23:52:31 CEST
in /Users/rajubitter/src/svn/openlaszlo/trunk
for http://[email protected]/openlaszlo/trunk
Summary: Add support for Flash Player's ability to switch to full
screen mode for SWFx
New Features:
Bugs Fixed: LPP-8107
Technical Reviewer: max
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
The documentation has to be updated, to reflect the new functionality.
Release Notes:
Works with Flash Player version 9.0.28. and all later versions.
Details:
http://jira.openlaszlo.org/jira/browse/LPP-8107
Embedding code
lps/includes/sources/embednew.js
+ method lz.embed.swf
- added allowFullScreen: properties.fullscreen
lps/includes/sources/flash.js
+ method lz.embed.dojo
+ added value to defaults: fullscreen: true
+ lz.embed.dojo.Embed.prototype.write
object.html: added param/attribute allowFullScreen
LFC changes for all runtimes
WEB-INF/lps/lfc/views/LaszloCanvas.lzs
+ @initarg documentation added for fullscreen
+ public var fullscreen added
+ onfullscreen event added
+ public var diplaystate added
+ handling of @initarg fullscreen added to construct() method
+ Warning for runtimes that don't support fullscreen (DHTML)
added to construct method
+ method function showFullScreen(fullscreen=true) added
SWF9 specific changes
WEB-INF/lps/lfc/kernel/swf9/LzScreenKernel.as
+ Added method showFullScreen
+ Added handler for FullScreenEvent fullScreenEventHandler
WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
+ added fullscreen: true to capabilities
Compiler (Java classes)
WEB-INF/lps/server/src/org/openlaszlo/compiler/CanvasCompiler.java
+ private static final boolean DEFAULT_FULLSCREEN = false;
+ /** Fullscreen setting for canvas */
private boolean mFullscreen = false;
+ methods setFullscreen() and isFullscreen()
+ in method public String getXML(String content) {
- added "fullscreen='" + isFullscreen() + "' " + to buffer
WEB-INF/lps/server/src/org/openlaszlo/compiler/Canvas.java
+ in method public void initializeFromElement(Canvas canvas,
Element elt)
if (fullscreen != null) {
canvas.setFullscreen(fullscreen.equals("true"));
}
XSLT template files
WEB-INF/lps/templates/html-response.xslt
WEB-INF/lps/templates/app-console.xslt
+ added allowFullScreen: '<xsl:value-of select="/canvas/
@fullscreen"/>' to lz.embed.dhtml({})
Tests:
test/fullscreen/fullscreen1.lzx
Simple test file for to go into fullscreen mode by clicking a button.
Files:
A test/fullscreen
A test/fullscreen/fullscreentest1.lzx
M WEB-INF/lps/lfc/kernel/swf9/LzScreenKernel.as
M WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
M WEB-INF/lps/lfc/views/LaszloCanvas.lzs
M WEB-INF/lps/server/src/org/openlaszlo/compiler/
CanvasCompiler.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/Canvas.java
M WEB-INF/lps/templates/html-response.xslt
M WEB-INF/lps/templates/app-console.xslt
M lps/includes/source/embednew.js
M lps/includes/source/flash.js
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20090613-raju-r.tar