|
|
Add video to Flash
Flash provides several methods by which you can import
video into Flash, incorporate the video into your Flash document,
and play it back for users.
Before you beginBefore you start working with video in Flash, it is important to understand
the following information:
Flash can only play specific
video formats.
These include FLV, F4V, and MPEG video. For
instructions on converting video in other formats, see Create video for use in Flash.
Use the separate Adobe Media Encoder application (included
with Flash) to convert other video
formats to FLV and F4V. For instructions, see Create video for use in Flash.
There are different ways of adding video to Flash, each with advantages in different
situations. See below for a list of these methods.
Flash includes a Video Import
Wizard that opens when you choose File > Import >
Import Video.
Using the FLVPlayback component is the simplest way to quickly
get video playing in a Flash file.
For
instructions, see Progressively download video using a web server.
Methods for using video in FlashYou can use video in Flash in
different ways:
Progressive download from a web server
This method
keeps the video file external to the Flash file
and the resulting SWF file. This keeps the SWF file size small.
This is the most common method of using video in Flash.
Stream video using Adobe Flash Media Streaming Server.
This
method also keeps the video file external to your Flash file. Adobe Flash Media Streaming
Server gives you secure protection of your video content in addition
to a smooth streaming playback experience.
Embed video data directly inside a Flash file
This
method results in very large Flash files,
and is only recommended for short video clips. For instructions,
see Embed video within a Flash file.
Progressively download video using a web serverProgressive downloading lets you use either the FLVPlayback
component or ActionScript that you write to load and play back external
FLV or F4V files in a SWF file at runtime.
Because the video file is kept external to the other Flash content, it’s relatively easy
to update video content without republishing the SWF file.
Progressive downloading provides the following advantages over
embedding video in the Timeline:
During authoring, you can publish only your SWF file
to preview or test part or all of your Flash content.
This results in faster preview times and quicker turnaround on iterative
experimentation.
During playback, video begins playing as soon as the first
segment of video is downloaded and cached to the local computer’s
disk drive.
At runtime, video files are loaded by Flash Player from the
computer’s disk drive into the SWF file, with no limitation on video
file size or duration. No audio synchronization issues or memory
restrictions exist.
The frame rate of the video file can be different from the
frame rate of the SWF file, allowing for greater flexibility in
authoring Flash content.
Import video for progressive downloadYou can import a video file that is stored locally on your
computer, and then upload the video file to a server after importing
it to your FLA file.
You can also import a video file that is already uploaded to
a standard web server, an Adobe Flash Media Server (FMS), or Flash
Video Streaming Service (FVSS).
Select File > Import > Import
Video to import the video clip into the current Flash document.
Select the video clip to import. You can select either a
video clip located on your local computer, or enter the URL of a
video already uploaded to a web server or Flash Media Server.
To import video located on your local computer, select Load
external video with playback component.
To import video already deployed to a web server, Flash Media
Server, or Flash Video Streaming Service, select Already deployed
to a web server, Flash Video Streaming Service, or Stream From Flash
Media Server, and enter the URL of the video clip.
Note: The
URL for a video clip located on a web server will use the http communication
protocol. The URL for a video clip located on a Flash Media Server
or Flash Streaming Service will use the RTMP communication protocol.
Select a skin for your video clip. You can choose to:
The Video Import Wizard creates an FLVPlayback video component
on the Stage that you can use to test video playback locally. When
you finish creating your Flash document and want to deploy the SWF
file and video clip, upload the following assets to the web server
or Flash Media Server hosting your video:
If using
a local copy of the video clip, upload the video clip (which is
located in the same folder as the source video clip you selected
with a .flv extension)
Note: Flash uses
a relative path to point to the FLV or F4V file (relative to the
SWF file), letting you use the same directory structure locally
that you use on the server. If the video was previously deployed
to your FMS or the FVSS hosting your video, you can skip this step.
The video skin (if you chose to use a skin)
To use
a predefined skin, Flash copies the
skin into the same folder as the FLA file.
The FLVPlayback component
To edit the FLVPlayback component’s
URL field to that of the web server or Flash Media Server that you
are uploading the video to, use the Component inspector (Windows >
Component inspector) to edit the contentPath parameter.
Stream video using Adobe Flash Media Streaming ServerIn streaming, each Flash client
opens a persistent connection to the Flash Media Server, and a controlled
relationship exists between the video being delivered and the client
interaction. Flash Media Server uses bandwidth detection to deliver
video or audio content based on the user’s available bandwidth.
This lets you provide different content for users based on their
ability to easily access and download content. For example, if a
user with a dial-up modem accesses your video content, you can deliver
an appropriately encoded file that doesn’t require too much bandwidth.
Flash Media Server also provides you with quality of service
metrics, detailed tracking and reporting statistics, and a range
of interactive features designed to enhance the video experience.
As with progressive downloading, the video content (FLV or F4V file)
is kept external to the other Flash content and
the video playback controls. This lets you easily add or change
content without having to republish the SWF file.
Streaming video with Flash Media Server (FMS) or Flash Video
Streaming Service (FVSS) provides the following advantages over
embedded and progressively downloaded video:
Video playback starts sooner than it does using other
methods of incorporating video.
Streaming uses less of the client's memory and disk space,
because the clients don’t need to download the entire file.
Network resources are used more efficiently, because only
the parts of the video that are viewed are sent to the client.
Delivery of media is more secure, because media is not saved
to the client’s cache when streamed.
Streaming video provides better tracking, reporting, and
logging ability.
Streaming lets you deliver live video and audio presentations,
or capture video from a web cam or digital video camera.
Flash Media Server enables multiway and multiuser streaming
for video chat, video messaging, and video conferencing applications.
By using server-side scripting to control video and audio
streams, you can create server-side play lists, synchronized streams,
and more intelligent delivery options based on the client’s connection
speed.
To learn more about Flash Media Server, see www.adobe.com/go/flash_media_server.
To learn more about Flash Video Streaming Service, see www.adobe.com/go/fvss.
Tutorials and examplesThe following videos and articles provide additional detailed
information about working with video in Flash.
Some videos show Flash CS3, but still
apply to Flash CS4.
|