Dune FlashLite information ++++++++++++++++++++++++++ General information =================== Dune FlashLite is based on Adobe Flash Lite for the digital home. It is a Flash player implementation optimized for Dune player software and hardware platform. Dune FlashLite features Flash player 8 rendering capabilities and Flash player 10 media support. It can be viewed also as Adobe Flash Lite 3.1 implementation supporting ActionScript 2.0 for developing Flash applications. However there are some differences between Flash Lite 3.1 and Flash Lite for the digital home. For details please refer to document "Developing Applications for Adobe Flash Lite for the Digital Home". Media URL for SWF file ====================== FlashLite SWF files can be launched directly from Dune GUI or via dune_folder functionality. In both cases SWF files must have "swf" extension. Syntax of SWF file URL in dune_folder.txt is as follows: media_url = swf://[:::] Syntax for is described in dune_folder documentation. (also known as "flashvars") is list of names and values of Flash variables in name=value form separated by ampersand. Names and values should be URL encoded. E.g.: media_url = swf://http://192.168.1.1/player.swf media_url = swf://http://192.168.1.1/player.swf:::id=29&vid=33 list is passed to FlashLite instance. Variables from list can be accessed directly from ActionScript, e.g.: if (id != "29") trace("Error: invalid id " + id); If HTTP URL is specified in media_url Dune player downloads corresponding SWF file to local temporary file. This local file is used for running FlashLite instance. Download is done every time dune_folder.txt is run. Since firmware version 110127_2105_beta special parameter with name "fip" can be used in URL. Value of this parameter is displayed on Dune player's FIP (for models without FIP the parameter is ignored). E.g., for the following URL: media_url = swf://http://192.168.1.1/player.swf:::id=29&fip=PLAY FIP will display word PLAY. Note: - FIP can display only a few characters; - scrolling of text on FIP is not supported in Dune FlashLite; - FIP text is displayed on start of FlashLite instance and cannot be changed while FlashLite application is running; - normally it is good idea to use capital letters and digits only for FIP text. SWF file name ============= Dune FlashLite implements additional platform specific features for SWF files running on Dune player. They are abilities to: - specify output window size; - select OSD size; - choose between speed and quality of rendering. At the moment listed features are not supported for SWF files loaded via HTTP URLs. All parameters are specified in SWF file name. Overall syntax is as follows: file_name[__x][__(480p|576p|720p|1080p)][__(speed|quality)].swf Note, the double underscore symbol is used as separator between parameters. Order of parameters is significant: first is window size, second is OSD size, and third is speed/quality parameter. Any or all parameters can be skipped, but if present they must be last in SWF file name and follow the order. For example: test_1__640x480__720p__quality.swf test_2_a__576p.swf test3__200x400__speed.swf Window size specifies size of FlashLite instance window used for displaying FlashLite application. Window is x pixels. If FlashLite application has different stage sizes, the stage is scaled up or down to the window. If window size is not specified full screen (see OSD size parameter) is used. Aspect ratio of FlashLite application's stage is preserved in case it is scaled up or down to window or full screen. Note, some TVs have overscan area that is not shown to user. FlashLite application should be implemented in such a way that it displays essential information in safe area only. OSD size parameter allows to select size of full screen window. Supported OSD sizes are: - 480p (720x480 pixels); - 576p (720x576 pixels); - 720p (1280x720 pixels); - 1080p (1920x1080 pixels). By default, if not specified, OSD size coincides to resolution of current video mode of Dune player. E.g., for 720p video mode OSD size is 1280x720 pixels. Note, if aspect ratio of selected OSD does not correspond to aspect ratio of current Dune player video mode, FlashLite application output may look distorted. Note, if OSD size is lesser the performance of FlashLite application may be better. Dune FlashLite application can be run in one of two modes: "quality" or "speed". If mode is not specified in SWF file name, "quality" is used. - In "speed" mode rendering of FlashLite application is done by Dune FlashLite to rendering plane of size equal to application's stage size. After that result is scaled up or down to output window (or full screen) by Dune player hardware. As a result rendering is performed faster (since output window in most cases is larger than stage), but quality is poorer. - In "quality" mode rendering and scaling of FlashLite application is done by Dune FlashLite to rendering plane of size equal to window (or full screen). As a result rendering is slower, but quality provided by software scaling is noticeably better. Security model ============== Adobe FlashLite supports two security modes that FlashLite instance runs in. They are "trusted" and "sandboxed". Dune FlashLite always uses "trusted" security mode and it cannot be changed. In "trusted" mode FlashLite application can access local filesystem and the network at the same time independently of mode specified in SWF file. Flash quality setting ===================== Adobe FlashLite supports three values for rendering quality: "low", "medium" and "high". Dune FlashLite always uses "high" rendering quality and it cannot be changed. Number of FlashLite instances ============================= Although Adobe FlashLite supports up to four FlashLite instances running simultaneously, Dune FlashLite supports only single FlashLite instance at the moment. It means only single SWF file can be played by Dune player at the same time. From other side FlashLite application has means to load additional SWF files if needed, e.g. with help of MovieClip class. Dune ActionScript extensions ============================ Dune FlashLite extends Adobe FlashLite with additional functionality by implementing new ActionScript classes. At the moment all available functionality is implemented in ExtCommand class. The class is implemented using ActionScript extensions mechanism. It means the class has ActionScript declaration and corresponding C++ implementation specific to Dune player. ActionScript declaration of ExtCommand class is as follows: intrinsic dynamic class ExtCommand { public static function exitFlash():Void; public static function requestWebBrowserOnExit(url:String):Boolean; public static function requestWebBrowserOnExitWithReturn(url:String):Boolean; public static function cancelWebBrowserOnExit():Void; public static function requestFilePlayerOnExit(url:String):Boolean; public static function requestFilePlayerOnExitWithReturn(url:String):Boolean; public static function cancelFilePlayerOnExit():Void; public static function requestPlaylistPlaybackOnExit(url:String):Boolean; public static function requestPlaylistPlaybackOnExitWithReturn(url:String):Boolean; public static function cancelPlaylistPlaybackOnExit():Void; public static function requestDVDPlayerOnExit(url:String):Boolean; public static function requestDVDPlayerOnExitWithReturn(url:String):Boolean; public static function cancelDVDPlayerOnExit():Void; public static function requestBlurayPlayerOnExit(url:String):Boolean; public static function requestBlurayPlayerOnExitWithReturn(url:String):Boolean; public static function cancelBlurayPlayerOnExit():Void; public static function getMainStoragePath():String; public static function getSerialNumber():String; public static function getProductId():String; public static function getFirmwareVersion():String; public static function sync():Void; } The ExtCommand class has the following methods: - exitFlash() Finishes FlashLite instance. Since Adobe FlashLite does not support fscommand("quit") functionality, this extension was added to allow FlashLite application to terminate running FlashLite instance. - requestWebBrowserOnExit() Rquests launching of Web browser with given URL on exit from FlashLite instance. If FlashLite application is terminated some time later, Web browser with that URL is started by Dune player. The method returns true if request succeeded and false otherwise. E.g., usage scenario might look as follows: FlashLite application shows advertisement, user presses URL RC button, at this moment application calls requestWebBrowserOnExit() method, sends advertisement notification request to server and upon receive of reply calls exitFlash(). In result Dune player opens Web browser with specified advertisement URL. - requestWebBrowserOnExitWithReturn() The method is similar to requestWebBrowserOnExit() except after finish of Web browser, FlashLite application called this method is started again by Dune player. This method is available since firmware version 110511_2007_beta. - cancelWebBrowserOnExit() Cancels request to launch Web browser on exit from FlashLite instance. This method is opposite to requestWebBrowserOnExit() and requestWebBrowserOnExitWithReturn(). - requestFilePlayerOnExit() By analogy with requestWebBrowserOnExit() requests launching of File player with given URL on exit from FlashLite instance. - requestFilePlayerOnExitWithReturn() The method is similar to requestFilePlayerOnExit() except after finish of File player, FlashLite application called this method is started again by Dune player. This method is available since firmware version 110511_2007_beta. - cancelFilePlayerOnExit() Cancels request to launch File player on exit from FlashLite instance. This method is opposite to requestFilePlayerOnExit() and requestFilePlayerOnExitWithReturn(). - requestPlaylistPlaybackOnExit() By analogy with requestWebBrowserOnExit() the method requests launching of File player with given playlist URL on exit from FlashLite instance; This method is available since firmware version 120531_2200_beta. - requestPlaylistPlaybackOnExitWithReturn() The method is similar to requestPlaylistPlaybackOnExit() except after finish of File player, FlashLite application called this method is started again by Dune player. this method is available since firmware version 120531_2200_beta. - cancelPlaylistPlaybackOnExit() Cancels request to launch File player on exit from FlashLite instance. This method is opposite to requestPlaylistPlaybackOnExit() and requestPlaylistPlaybackOnExitWithReturn(). This method is available since firmware version 120531_2200_beta. - requestDVDPlayerOnExit() By analogy with requestWebBrowserOnExit() the method requests launching of DVD player with given URL on exit from FlashLite instance. This method is available since firmware version 120531_2200_beta. - requestDVDPlayerOnExitWithReturn() The method is similar to requestDVDPlayerOnExit() except after finish of DVD player, FlashLite application called this method is started again by Dune player. This method is available since firmware version 120531_2200_beta. - cancelDVDPlayerOnExit() Cancels request to launch DVD player on exit from FlashLite instance. This method is opposite to requestDVDPlayerOnExit() and requestDVDPlayerOnExitWithReturn(). This method is available since firmware version 120531_2200_beta. - requestBlurayPlayerOnExit() By analogy with requestWebBrowserOnExit() the method requests launching of Bluray player with given URL on exit from FlashLite instance; This method is available since firmware version 120531_2200_beta. - requestBlurayPlayerOnExitWithReturn() The method is similar to requestBlurayPlayerOnExit() except after finish of Bluray player, FlashLite application called this method is started again by Dune player. This method is available since firmware version 120531_2200_beta. - cancelBlurayPlayerOnExit() Cancels request to launch Bluray player on exit from FlashLite instance. This method is opposite to requestBlurayPlayerOnExit() and requestBlurayPlayerOnExitWithReturn(). This method is available since firmware version 120531_2200_beta. - getMainStoragePath() Returns absolute Unix path to main storage. FlashLite application can open then user files on this storage. - getSerialNumber() Returns serial number of Dune player (the same as reported in Setup / Information / Serial Number). This method is available since firmware version 110127_2105_beta. - getProductId() Returns product id of Dune player (the same as reported in Setup / Information / Product ID). This method is available since firmware version 110511_2007_beta. - getFirmwareVersion() Returns firmware version of Dune player (the same as reported in Setup / Information / Firmware version). This method is available since firmware version 110511_2007_beta. - sync() Does sync on all file systems (performs sync() system call), so all data not flushed from applications or operating system buffers are written to disks. The method is useful, for example, when SharedObject class is used for storing persistent application data. This method is available since firmware version 110127_2105_beta. Note, the following methods: - requestWebBrowserOnExit(); - requestWebBrowserOnExitWithReturn(); - requestFilePlayerOnExit(); - requestFilePlayerOnExitWithReturn(); - requestPlaylistPlaybackOnExit(); - requestPlaylistPlaybackOnExitWithReturn(); - requestDVDPlayerOnExit(); - requestDVDPlayerOnExitWithReturn(); - requestBlurayPlayerOnExit(); - requestBlurayPlayerOnExitWithReturn(); are mutually exclusive ones. It means only last call to one of these methods from FlashLite application takes effect, previous calls are ignored. SharedObject implementation details =================================== ActionScript class SharedObject can be used for managing persistent objects: storing them on filesystem, retrieving, modifying and deleting them. Dune FlashLite implementation uses internal directory for storing persistent data. Every object is stored in separate file in separate subdirectory identified by SWF file. One FlashLite application cannot manage persistent objects of another one. E.g., if SWF file is changed persistent objects will be stored in new subdirectory. Contents of data directory is not preserved between reboots of Dune player. Because of this persistent objects are removed every time player is turned off (including hardware standby but not software one) or rebooted. Dune FlashLite has two limits on size of persistent data. First limit is total size of persistent data per SWF file. Dune FlashLite has it set to 1 KB. Second limit is total size of all stored persistent data. Dune FlashLite has it set to 64 KB. The following improvements take place since firmware version 110127_2105_beta: - contents of data directory is preserved between reboots of Dune player (including power off), so SharedObject class can be used for storing really persistent data; - limits on size of persistent data have being increased. Limit on total size of persistent data per SWF file is set to 16 KB. Limit on total size of all stored persistent data is set to 1 MB. Access to data files ==================== FlashLite application can access data files that are stored on Web server or on local to Dune player storages. For this purpose the following classes can be used. LoadVars class provides access to text files, that has key=value format. XML class provides access to XML text files. MovieClip class provides access to images, video clips and SWF files. All three classes can be used in Dune FlashLite with HTTP URLs, relative Unix paths and absolute main storage path (see ExtCommand.getMainStoragePath() method) in order to access data on corresponding storages. Remote control button mapping ============================= Mapping of remote control (RC) buttons implemented by Dune FlashLite differs from one implemented by Adobe FlashLite. For convenience of Flash programmer Dune FlashLite offers DuneKey ActionScript class. The class contains mapping of all supported RC buttons. Some Dune RC buttons are mapped to standard Key class values: - numbers, letters and standard symbols; - DuneKey.UP = Key.UP; - DuneKey.DOWN = Key.DOWN; - DuneKey.LEFT = Key.LEFT; - DuneKey.RIGHT = Key.RIGHT; - DuneKey.ENTER = Key.ENTER; - DuneKey.ESCAPE = Key.ESCAPE; - DuneKey.INSERT = Key.INSERT; - DuneKey.DELETEKEY = Key.DELETEKEY; - DuneKey.END = Key.END; - DuneKey.TAB = Key.TAB; - DuneKey.CAPSLOCK = Key.CAPSLOCK; - DuneKey.SPACE = Key.SPACE; - DuneKey.SHIFT = Key.SHIFT; - DuneKey.CONTROL = Key.CONTROL. DuneKey class contains the following mapping for Dune RC specific buttons: class DuneKey extends Key { public static var ALT:Number = 18; public static var CLEAR:Number = BACKSPACE; public static var SELECT:Number = SHIFT; public static var VOLUME_UP:Number = 16777217; public static var VOLUME_DOWN:Number = 16777218; public static var MUTE:Number = 16777219; public static var PAGE_UP:Number = PGUP; public static var PAGE_DOWN:Number = PGDN; public static var RECORD:Number = 16777222; public static var PLAY:Number = 16777223; public static var PAUSE:Number = 16777224; public static var FWD:Number = 16777226; public static var REW:Number = 16777227; public static var SLOW:Number = 16777228; public static var NEXT:Number = 16777230; public static var PREV:Number = 16777231; public static var MODE:Number = 16777232; public static var ZOOM:Number = 16777233; public static var POPUP_MENU:Number = 16777234; public static var INFO:Number = 16777235; public static var ANGLE:Number = 16777236; public static var SHUFFLE:Number = 16777237; public static var RETURN:Number = 16777238; public static var AUDIO:Number = 16777239; public static var SUBTITLE:Number = 16777240; public static var REPEAT:Number = 16777241; public static var SEARCH:Number = 16777242; public static var URL:Number = 16777243; public static var SETUP:Number = 16777244; public static var TOP_MENU:Number = 16777246; public static var RED:Number = 16777247; public static var GREEN:Number = 16777248; public static var YELLOW:Number = 16777249; public static var BLUE:Number = 16777250; public static var DUNE:Number = 16777472; public static var F1:Number = 16777473; public static var F2:Number = 16777474; public static var F3:Number = 16777475; public static var F4:Number = 16777476; public static var F5:Number = 16777477; public static var F6:Number = 16777478; public static var F7:Number = 16777479; public static var F8:Number = 16777480; public static var F9:Number = 16777481; public static var F10:Number = 16777482; public static var F11:Number = 16777483; public static var F12:Number = 16777484; public static var NUM_LOCK:Number = 16777485; public static var SCROLL_LOCK:Number = 16777486; public static var META:Number = 16777487; public static var SUPER:Number = 16777488; public static var ALTGR:Number = 16777489; public static var PC:Number = 16777490; public static var PRINT:Number = 16777491; public static var NUMPAD5:Number = 16777492; public static var FAVORITES:Number = 16777493; public static var REDSUN:Number = 16777494; public static var MODE2:Number = 16777495; } Other RC buttons are processed in special way. They are: - POWER OFF - finish FlashLite instance and send Dune player to standby; - EJECT - eject optical disk drive (if exists); - STOP - finish FlashLite instance. Dune FlashLite extensions ========================= Dune FlashLite extensions described in this document (ActionScript classes ExtCommand and DuneKey) are available for download in single archive: http://dune-hd.com/firmware/flash/Dune_FlashLite_Extensions.zip. To use the extensions implement your own FlashLite application, compile it with supplied classes and run with Dune FlashLite. Links to documentation ====================== "Developing Adobe Flash Lite 2.x and 3.x Applications" http://help.adobe.com/en_US/FlashLite/2.0_FlashLiteDevGuide2/index.html "Adobe Flash Lite 2.x and 3.x Adobe ActionScript Language Reference" http://help.adobe.com/en_US/FlashLite/2.0_FlashLiteAPIReference2/index.html "Getting Started with Adobe Flash Lite for the Digital Home" http://www.adobe.com/content/dam/Adobe/en/devnet/devices/pdfs/flash_lite_digital_home_getting_started.pdf "Optimizing Adobe Flash Lite for the Digital Home" http://www.adobe.com/content/dam/Adobe/en/devnet/devices/pdfs/optimizing_flash_lite_digital_home.pdf "Developing Applications for Adobe Flash Lite for the Digital Home" http://www.adobe.com/content/dam/Adobe/en/devnet/devices/pdfs/developing_apps_flash_lite_digital_home.pdf "Developing ActionScript Extensions for Adobe Flash Lite for the Digital Home" http://www.adobe.com/content/dam/Adobe/en/devnet/devices/pdfs/as_extensions_flash_lite_digital_home.pdf