Groups | Blog | Home
all groups > macromedia flash flashcom > october 2006 >

macromedia flash flashcom : NetStream.pause with Media Server 2


kaliatech
10/31/2006 3:33:23 PM
When using the NetStream.play(url, start, duration) method to play a smaller
segment of a larger video stream from Media Server 2, the pause method appears
not to work correctly. The first time it is called, it will pause, but
subsequent calls do not restart the playback.

This happens only when using a start parameter > 0. If using the more common
scenario where playback is started from the beginning (start == 0), the pause
function works as documented. A code example is below. If anyone could
confirm/unconfirm this and/or direct me to a more appropriate support avenue,
it would be much appreciated. I'm using Flash 8, On2 encoded FLV file, RMTP
protocol, FLVPlayback Components Update 1.0.1, and Media Server 2.0.2 - 2.0.3.

As would be expected, this problem is also evident using an extended version
of the FLVPlayback control. (The FLVPlayback control has to be customized to
verify the problem because, by default, it does not support a non-zero start
time. This is a big oversight in the FLVPlayback component's design in my
opinion.)

Example code to replicate the problem:
[Q]var nc:NetConnection = new NetConnection();
nc.connect(mediaServerUrl);

ns:NetStream = new NetStream(nc);

//This line starts the video 1000 seconds in to the FLV, but breaks
pause/unpause.
ns.play(videoUrl, 1000, 120);

//This line does not break pause/unpause.
//ns.play(videoUrl, 0, 120);

//Call pause every few secs, which should alternate between pause and play
setInterval(doPause, 5000);

test_video.attachVideo(inStream_ns);

function doPause():Void
{
inStream_ns.pause();
}[/Q]
kaliatech
11/1/2006 7:56:52 PM
In case anyone else comes across this...

I now believe the problem is specifically related to the On2 / VP6 encoding of
the flv files. If I use a Sorenson encoded FLV, there is no problem and
pause/seek works as expected.

My best guess is that FMS2 is not able to correctly handle "enhanced seeking"
(and indirecty pausing) with VP6 yet. Seems like that should be better
documented somewhere if that is correct.

I also tried encoding an On2 file with a keyframe for every frame and it still
didn't work. I found one other post that is probably related to this problem:
http://store1.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid
=578&threadid=1152398&enterthread=y

I really want to use the On2 encoding, so my next step will be to try one of
the "smart" progressive download solutions: Examples:

- http://blogs.ugidotnet.org/kfra/archive/2006/10/04/50003.aspx
-
http://www.flashcomguru.com/index.cfm/2005/11/2/Streaming-flv-video-via-PHP-take
-two
- http://www.rich-media-project.com/

I originally assumed FMS2 would be the easier (if more expensive) of these
solutions, but I guess not for my purposes.


AddThis Social Bookmark Button