106
Client-Side ActionScript Language Reference
If you pass the
FPS
parameter to limit the frame rate of the video, Flash Media Server attempts
to reduce the frame rate while preserving the integrity of the video. The server sends the
minimum number of frames needed to satisfy the desired rate between every two keyframes.
Keep in mind, however, that i-frames (or
intermediate frames
) must be sent contiguously;
otherwise, the video will be corrupted. Therefore, the desired number of frames is sent
immediately and contiguously following a keyframe. Since the frames are not evenly
distributed, the motion appears smooth in segments punctuated by stalls.
Example
The following example opens a stream and specifies that the video play at a specified rate:
var my_ns:NetStream = new NetStream(my_nc);
my_ns.receiveVideo(false); // Don’t display video being published.
// Later....
my_ns.receiveVideo(12); // Display video at 12 FPS.
See also
NetStream.currentFps
,
NetStream.receiveAudio()
,
NetStream.time
NetStream.seek()
Availability
■
Flash Player 6.
■
Flash Communication Server MX 1.0.
Usage
public seek(
offset
: Number) : Void
Parameters
offset
The approximate time value, in seconds, to move to in an FLV file. The playhead
moves to the keyframe of the video that is closest to
offset
.
■
To return to the beginning of the stream or playlist, pass 0 for
offset
.
■
To seek forward from the beginning of the stream or playlist, pass the number of seconds
you want to advance. For example, to position the playhead at 15 seconds from the
beginning, use
myRecordedStream_ns.seek(15)
.
■
To seek relative to the current position, pass
myRecordedStream_ns.time
+ n
or
myRecordedStream_ns.time
- n
to seek
n
seconds forward or backward, respectively,
from the current position. For example, to rewind 20 seconds from the current position,
use
myRecordedStream_ns.seek(my_ns.time - 20)
.