Skip to main content
miquael
Inspiring
July 4, 2009
Question

Dynamic Video shifting

  • July 4, 2009
  • 1 reply
  • 852 views

I'm creating a custom video player where the user can select to play the same video at different speeds (100%, 75%, and 50%).  We have rendered 3 different MP4 files, one for each speed, and then there is a mechanism in the video player to load each video as the user demands it.  It works fine so far, except that when a new video loads, it begins to play from the beginning, not at the point where the previous video left off (which is crucial).

I thought it would be as simple as using either ns.play("videoname", videotime) or using a ns.seek(videotime), but in ether case, the new video still will only play from the beginning.

Here is the code, which includes some calculation for adjust the time depending on the shift from 100%, 75%, and 50%.

function switchSpeedVideo() {

var currentTime:Number = ns.time;

output.text = currentTime.toString(); // outputs correctly

var adjustedTime:Number = (ns.time) * speedFactor;

output.text = adjustedTime.toString(); // outputs correctly

ns.play(currentVideoURL, adjustedTime);

ns.seek(adjustedTime);

videoSwitch = false;

}

I've also tried using just, without seek:

ns.play(currentVideoURL, adjustedTime);

and I've tried both this way:

ns.play(currentVideoURL);

ns.seek(adjustedTime)

What is missing here?  Currently, I am using HTTP connection ("HTTP Pseudo Streaming" with Wowza on SimpleCDN).  Does this require RTMP?

    This topic has been closed for replies.

    1 reply

    July 4, 2009

    Hi miquael,

    This is the "Flash Media Server" forum.

    Your post concludes:

    Currently, I am using HTTP connection ("HTTP Pseudo Streaming" with Wowza on SimpleCDN).  Does this require RTMP?

    Are you considering using FMS?

    If you are using Wowza, you likely are going to have better success posting to wowzamedia.com/forums/

    Just a thought.

    Best of luck in your development efforts.

    g

    miquael
    miquaelAuthor
    Inspiring
    July 4, 2009

    As I understand it, Wowza and FMS are very similar. If someone can show me that the ActionScript methods and RTMP methods are different for Wowza than they are for FMS -- then that would be VERY useful information to me.  Yet, until then, I am assuming that the methods are the same.

    I am only using HTTP currently as we have not yet been able to get RTMP to work (another problem, which may be related to this problem).

    Yet the dynamic seeking method I am describing above should be possible with ether streaming media system.  Regardless of which system, my questions are:

    1) is RTMP required to get the results I am seeking (described above)

    2) or what else do I need to know?

    I am querying here (as well as with Wowza forums), as again, this may be more of an ActionScript / RTMP / FLV / FMS / Flash streaming technology in general type of question ...

    As we are on a tight production line (for a video site that goes public in a few days), I am open to receiving any useful information I can get.

    miquael
    miquaelAuthor
    Inspiring
    July 4, 2009

    Framing the question more simply:

    This is standard ActionScript 3.0 useful in streaming media:

    ns.play(currentVideoURL, adjustedTime);

    Yet the "adjustedTime" is not working.  The video loads, yet begins at "0".  Why?