Flash Media Server |
|||
| Client-Side ActionScript Language Reference for Flash Media Server 2 > Client-Side ActionScript Language Reference > NetStream class > NetStream.seek() | |||
public seek(offset : Number) : Void
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.
offset.myRecordedStream_ns.seek(15).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).Nothing.
Method; seeks the specified number of seconds into the recorded stream that is currently playing, either from the beginning of the stream or from the current position. This method is available only to clients subscribed to the specified stream, not to the stream's publisher.
If you require an accurate return value from seeking, you may need to change the Application.xml file's EnhancedSeek flag on the server.
EnhancedSeek is a Boolean flag in the Application.xml file. By default, this flag is set to false. When a seek occurs, the server seeks to the closest video keyframe possible and starts from that keyframe. For example, if you want to seek to time 15, and there are keyframes only at time 11 and time 17, seeking actually starts from time 17 instead of time 15. This is an approximate seeking method that works well with compressed streams.
If the flag is set to true, some compression is invoked on the server. Using the example above, if the flag is set to true, then the server creates a keyframe--based on the preexisting keyframe at time 11--for each keyframe from 11 through 15. Even though a keyframe does not exist at the seek time, the server generates a keyframe. This, of course, involves some processing time on the server.
For more information about the EnhancedSeek tag, see Application.xml file in Managing Flash Media Server.
NetStream.play(), NetStream.time
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/fms/2/docs/00000592.html
Comments
normanhua said on Dec 11, 2006 at 1:58 AM :