In this chapter, I will attempt to give you a thorough understanding of the video display object of the Flex framework, with some specific insight into a few of the key video playback features in the RMX, including playlists and UI considerations for instream advertising. First, R Blank will start off with a brief word on some core video compression concepts that are important to understand—even for coders—in the preparation and delivery of Flash video. Next, I will go over playing back video in Flex.
Although this chapter is about working with Flash video, as opposed to creating Flash video, in this section, I want to cover some of the basic issues in the preparation of video in Flash, before Omar discusses how to load and display the video files.
Compressing video is much like compressing flat images to bitmap formats like JPG. The compressor examines the source media, breaks it into separate blocks of pixels, and seeks redundancies it can exploit to represent those blocks with less data. This is how a 20MB PSD can be prepared into a 78KB JPG file for placement in a web site. Of course, with video, you have an additional dimension of data. Just as JPG compression seeks these shortcuts in two dimensions of visual data, or within a frame, video compression analyzes and processes three dimensions of color pixels, within a frame and between frames—both intraframe and interframe compression. So, when compressing video as opposed to still imagery, you have some additional settings available to you.
It's also worth noting, if you are relatively new to video, that video encoding is more an art than a science. There is never a single set of encoding settings that will objectively work for your video. It depends both on the characteristics of your source file (both the nature of the content as well as the technical settings of the digital media file) and your eye. It is a process of trial and retrial until you are happy with the results. Of course, the more you know about what settings you have at your disposal, the more tools you have in this process. As video compression technologies improve in quality, and the pipes you use to distribute compressed video grow, the less you must compress your media, and the less this matters.
This chapter covers the following topics:
In order to make the most of this article, you need the following software and files:
Chapter 10: Working with video (PDF, 1.9 MB)
Some knowledge of Flex and Flash Player.
Omar Gonzalez is a senior application developer at Almer/Blank who has been developing for the web since 1997. He has acquired a strong sense for developing accessible sites employing web standards, open source projects, and frameworks like Drupal and CSS. During the quick rise of Flash, he began to incorporate the popular technology in the sites he worked on, adding Flash development as well as PHP and MySQL to his repertoire.
Omar has developed Flash video applications for companies like eHarmony and has spoken at conferences like FITC on such topics as Flash video, Motion XML, and AIR. Over the past two years he has been developing Flex applications, harnessing the power of Flash Platform technology to create cutting-edge Rich Internet Applications. Omar is on the resident faculty at the Rich Media Institute, teaching topics in Flex, HTML/CSS, and web development, and he is an active member of the LA Flash user groups.