Flash Lite and Video Streaming

The aim of this article is to provide the basic knowledge needed to start with Flash Lite and its compelling multimedia capabilities. We start with a basic introduction to Flash Lite, describing its history and capabilities. This is followed by a description of the tools necessary to develop Flash Lite applications. Towards the end we outline a simple application for streaming video with Flash Lite.

What is Flash Lite?

Flash Lite, as the name suggests, is a lightweight version of the Flash Player targeted for mobile devices that don't usually have powerful hardware capabilities (memory size, cpu speed, etc.). The key features of this lightweight version are:

  • Runs on less memory
  • Requires a less powerful CPU
  • Takes advantage of the capabilities of mobile devices

The Flash Player version used as the base of the Flash Lite versions present on the market at the time of writing of this article are Flash Player 4 and Flash Player 7. Flash Lite offers an easy way to produce stunning interactive multimedia content for mobile devices via the familiar Flash IDE. Flash Lite offers more or less the same timeline features and functionality of the traditional Flash Player:

  • Movie Clips and Buttons
  • Bitmap and Vector graphic
  • Scripting
  • Audio and Video capabilities
  • User input

One of the most interesting features of Flash Lite, since version 1.1, is the ability to access native device properties. For instance a Flash Lite application can retrieve information such as:

  • Battery level
  • Network connectivity status
  • Date and time
  • Multimedia supported formats (audio, video, images)

The Flash Lite player can also render a wide variety of content produced with the Flash IDE.

A brief history of Flash Lite

Today there are four versions of Flash Lite:

  • Flash Lite 1.0
  • Flash Lite 1.1
  • Flash Lite 2.0
  • Flash Lite 2.1

Flash Lite 1.0 was launched in February 2003 for NTT DoCoMo 505i handsets in Japan and provided an easy way to put Flash content onto a mobile device. Flash Lite experienced great success since it was shipped pre-installed in 25 different handset models.
In 2004 Flash Lite 1.1 was released with a more elaborate feature set and API, and supporting more content types, thus opening up new possibilities to developers beyond the simple animations that were possible with version 1.0.
Building its base in the Asian Pacific region Flash Lite 1.1 became a global phenomenon pre-installed in a great variety of devices.
During 2006 Flash Lite 2.0 was released and it offered a more common ground between the classic Flash development since the new player was based on the Flash Player 7 specification. This meant that a developer could now easily migrate an application to a mobile device since there was now support for ActionScript 2.0, dynamic image loading, and video support etc.
At the end of 2006 Flash Lite 2.1 was released. One of the most compelling characteristics of this player is that it is compatible with both Symbian and Windows Mobile 5.0 operating systems. Version 2.1 adds support for the Binary Runtime Environment for Wireless® (BREW), enables socket communication using the XMLSocket class on devices that support it and adds support for inline text input.
Flash Lite 3.0 due to be released in the last quarter of the 2007, looks likely to contain the following interesting features:

  • Flash Video support
  • Flash Video Codec build into the player
  • Flash Media Server support
  • Graphics rendering acceleration
  • Run-time memory reduction

Getting set up to develop Flash Lite

In order to start with the Flash Lite development you need Flash MX 2004 (version 7.02 or better) installed on your PC and a device on which you can test your content. The second requirement isn't mandatory but in order to develop a good application there is no substitute for testing on real devices. A complete list of devices that support Flash Lite is available on the Adobe's web site http://www.adobe.com/mobile/supported_devices/handsets.html. As an illustation, we have included a short list of Nokia devices here, among which you may find the right device for your new development adventure.

 

Series 60 3 rd Ed Series 40 3 rd Ed
Flash Lite 1.1 E50, E60, E61, E62, E65, E70, E90, N71,N72, N73, N75, N76, N80, N91, N92, N93, N93i, 3250, 5500 6126, 6130, 6131, 6133, 6136, 6151, 6233, 6234, 7373, 7390, 8800 Scirocco
Flash Lite 2.0 N95, 5700 5300, 5200, 6085

As mentioned, Flash MX 2004 version is sufficient, but for quicker and easier development it is strongly recommended to download the CS3 version of Flash that is bundled with Device Central, which provides great mobile content emulation dedicated to Flash Lite.
If you are using the Flash 8 IDE you will need to download the Flash Lite 2.x Authoring update and the Device Profiles updates. Note that you need to have QuickTime player installed in order to use the video feature introduced with Flash Lite version 2.x. If you plan to develop an application integrated with C++ for Symbian or if you plan to deliver your content to BREW devices, you will also need to install one of the following SDKs:

  • Nokia SDK and Flash Lite 1.1
    – Flash Lite 1.1 standalone and browser
    – Nokia S60 3 rd Edition C++ SDK (January 17 th 2006)
    – Nokia S60 J2ME 3 rd Edition
    – Flash Lite 1.1 standalone, browser, wallpapers, screensaver
    – Nokia S40 3 rd Edition FP 1 SDK
  • Nokia SDK and Flash Lite 2
    – Nokia S60 3 rd Edition FP 1 C++ SDK
    – Nokia S40 3 rd Edition FP 2 SDK
  • BREW SDK with emulator and Flash Lite 2.1

The main reasons to develop your mobile content with Flash Lite may be summarised as follows:

  • Familiar development environment
  • Rapid development
  • Re-use of assets
  • Excellent testing framework faciliated by Adobe Device Central
  • Reduced porting costs

Most of these are self explanatory, but it's worth focussing attention on some of them. The development environment is familiar and easy to use because is based on Flash and there are more than one million flash developers all around the world, and there are millions of web pages that describe the key concepts of this software. Flash development is often based on the re-use of assets such as scripts, GUI elements, and so on, so you may include in your mobile development almost all your previous work, and most of the resources that you find on the web.
The development workflow in Flash Lite is more or less the same followed with other technologies:

  • Mockup and test in Adobe Device Central
  • Design/develop in Flash
  • Test in Adobe Device Central
  • Test on device(s)
  • Package for distribution

Flash Lite support and content type

When working with Flash Lite localised content types may exported that are specialized versions of the SWF file, and which are strongly dependent on the target region of your content. For instance, the Browser content type that uses Flash Lite to render Flash content embedded in mobile web pages and viewed in the device's web browser is supported only on the NTT DoCoMo, KDDI, and Vodafone (Japan only) networks. This will probably change in the near future with the launch of Flash Lite 3.0.
Another content type is the Standalone Player. When this kind of Flash Lite file is launched, the content is loaded in its own window and it behaves like an independent application. There are some content types that are more ineteresting and that run more like embedded applications deeply integrated with a device's user interface, such as Wallpapers and Chacku Flash (animated ringtones available only on the KDDI Japanese network).
Since available content types may vary across device models, it is important to keep the device profiles installed in your IDE up to date. The links below provide up to date profiles:

The complete list of content types available for Flash Lite can be found in the IDE help. Many of the content types available are specific to i-mode. In addition to mobile phones, Flash Lite content can be developed for devices like the PlayStation Portable, personal Media Players (e.g. iriver u10 and u20), the Chumby, the PlayStation 3, etc.

Flash Lite multimedia capabilities

In a mobile application the media can have a primary role and it's very important to use them in the right context and with a specific purpose. Imagine for instance the role media can play in a mobile learning application, or in a mobile music store. The goals of these applications are very different, but they are based on the same concept: the multimedia mobile application. When media such as video and sound are used in an application, careful consideration should be given to the target devices. While Flash Lite inherits rich multimedia capabilities from its predecessors, there are also a lot of differences between the multimedia capabilities of the available Flash Lite versions.

  • Flash Lite 1.x – media features
    – video not supported (image sequences trick)
    – audio formats: MP3, PCM, ADPCM, SMAF, MIDI
  • Flashlite 2.x – media features
    – video is supported
    – audio features:
    – Supports all the formats supported by Flash Lite1.x.
    – Finally Flash Lite 2.x has the very useful feature of allowing the external loading of MP3's.

The most interesting medium supported in Flash Lite is the video. When dealing with video and Flash Lite the video formats supported by the target devices should be considered. The following table is a quick reference to the video formats supported by a Symbian device with optimal size to use on each different OS version

 

Platform baseline Video Codecs Audio codecs Max Frame Rate Max Bit Rate (kbps)
Optimal Size
S40 2nd edition (6230i or more) H.263, PO L10,
MPEG-4
AMR-NB 25 128 176 x 144
S40 3rd edition H.263, PO L10,
MPEG-4
AMR-NB 30 384 352 x 288
S60 1st edition H.263, PO L10 AMR-NB 10 64 176 x 144
S60 2nd edition
H.263, PO L10,
MPEG-4, Real Video (7 and 8)
AMR-NB,
Real Audio 7,8,
AAC
15 128 176 x 144
S60 3rd edition
H.263, PO L10,
MPEG-4, Real Video (7, 8, 9 and 10)
AMR-NB,
Real Audio 7,8,10,
AAC,
AAC+
15 128 352 x 288

 

As the table indicates, support for each video format varies from device to device. In order to show the main features of the video capabilities of Flash Lite we cover the 3GP format which is supported on a lot devices for which the Flash Lite player is also available. 3GP files encode video streams as MPEG-4 or H.263 and audio streams like AMR-NB or AAC-LC.
In Flash Lite 1.1 you can open a video file using the getURL or the fscommand instructions e.g.

However, the video can't be controlled for the Flash Lite player and it is opened directly in the media player installed on the device. The most difficult part of video in Flash Lite 1.1 is to determine correctly the paths of the media player and of the video file. With Flash Lite 1.1 it is possible to load a video through the HTTP protocol but it is worth noting that there can be only one getURL instance in the foreground, that an active network connection is needed, and that the file must be downloaded completely in order to be manipulated.
With Flash Lite 2.x the scenario is quite different; in fact the player offers 4 possible methods of video playback:

  • Bundled device video
  • Local device video
  • External device video (HTTP)
  • Streaming video (RTSP)

We use the term device video to refer to the video formats supported by the target device. When the player encounters a video for playback, it calls the native video player (almost like in Flash Lite 1.1) but the video is played within the confines of Flash Lite content in a predefined window with a specific height, width and coordinates.
The video may be controlled as in a classic Flash application but the following features are not supported:

  • Volume Control
  • Masking and alpha
  • Rotation
  • Cue points

In a Flash Lite application you may control a video trough these simple instructions:

  • play()
  • stop()
  • pause()
  • resume()
  • close()

These are self explanatory with the possible exception of the close() method. This method stops the playback and frees the memory associated with the current video object.

To add a video object to a SWF file, it is first created through the menu at the top right corner of the library panel (CTRL + L), and it is dragged onto the stage.

Through the System class the capabilities of the device on which your content is running can be detected

  • hasEmbeddedVideo:Boolean
  • hasStreamingAudio:Boolean
  • hasStreamingVideo:Boolean
  • hasVideoEncoder:Boolean

The last property always returns false in Flash Lite versions prior to 3.0. If you need to check that a particular video format is supported in the target devices you can access to the .videoMIMETypes specifying the MIME as a the parameter of the Array:

 

 

The Bundled Device Video is embeded in your Flash Lite content but with no frames addiction as in the classic Flash video development. When you import the video you need to export it for ActionScript and assign an identifier in order to control it.

 

In order to start the playback you can drag an instance from the library and call the play() method on it, or put an empty place holder on the stage and pass the video identifier as an argument in the play() method:

 

 

The Local Device Video is loaded from the device calling the play() method on an empty place holder passing the path of the file as an argument. The External Device Video is very useful because storage is always a concern on a mobile device and because it gives to you the flexibility of offer multiple files inside your Flash Lite application.

However this is not to say that there aren't potential limitations; in fact certain carriers block some network ports and files, and the file has to be completely downloaded before the device makes a call to the video player in order to render it in Flash Lite.
The Streaming video is perhaps the most difficult aspect to replicate in Flash Lite 2.x because there are several limitations on the target device Not all the devices actually support the streaming of a video and some operators block the streaming if you are not using their services.
In order to start the playback of a streaming video through ActionScript you need only to pass the URL of the video to the play method

but you still have to consider that you need an Helix Streaming Server (Real Networks) and a 3GP file generated with Real Helix Mobile Producer.
In the near future Adobe has announced that Flash Lite 3.0 will support Flash Video and that the Flash Media Server 3 will support Flash Lite, this feature represent the new challenge for all the Flash Lite developers.

 

A simple Flash Lite streaming application

Let's start with a short sample of a Flash Lite application that is able to load a streaming video file. This application will allow the user to choose between two different videos to playback. The application will also inform the user of which video is playing at any time. Note that this application will stream a local video file, rather than from an external streaming server, but the principle is the same.

First of all we open Flash and create a new empty file for mobile, with the Nokia N95 selected as the target device.
We next put our GUI elements onto the Stage. We start with some text, and a video place holder:

 

Next we add an instance of a dynamic text field and name it video_txt. This text field will inform the user about which video is currently playing. It changes whenever the current playing video changes.

Your FLA file is now ready for the small script you need to launch the video streaming:

 

Deployment

Deployment of Flash Lite files is relatively simple. To deploy your application to the real world you can export the SWF file from your authoring tool and transfer it to your device through Bluetooth or cable or through the Application Loader for Flash Lite Brew development.
Another two file formats available are SIS and CAB. The first one is specific for Symbian devices and the second is for Windows Mobile.
An easy way to create the SIS file is with SWF2Go.

Conclusion

As you have seen the Flash Lite world is full of attractions and challenges for all developers (mobile or not) who want to create multimedia applications with a great user experience. As demonstrated, it is relatively simple to set up a streaming video application using the well-known Flash IDE and a small amount of scripting. It is worth noting that Flash Lite is still an emerging technology and there is great scope for developers to discover and implement novel applications.

Resources

http://www.flashdevices.net/
http://www.adobe.com/devnet/devices/
http://forum.nokia.com/
http://brew.qualcomm.com/brew/en/developer/overview.html
http://www.chumby.com/developers
http://mobile.actionscript.it
http://www.ozmadgroup.com/
http://www.flashmobilegroup.org/
http://www.flashlite.com.br/brmad/
http://www.indimadgroup.com/blog/
http://www.blocketpc.com/
http://www.flashmobilebook.com/

Exclusive tips, how-tos, news and comment

Receive monthly updates on the world of mobile dev.

Other Products

Market leading device intelligence for the web, app and MNO ecosystems
DeviceAtlas - Device Intelligence

Real-time identification of fraudulent and misrepresented traffic
DeviceAssure - Device Verification

A free tool for developers, designers and marketers to test website performance
mobiReady - Evaluate your websites’ mobile readiness

© 2024 DeviceAtlas Limited. All rights reserved.

This is a website of DeviceAtlas Limited, a private company limited by shares, incorporated and registered in the Republic of Ireland with registered number 398040 and registered office at 6th Floor, 2 Grand Canal Square, Dublin 2, Ireland