Skip to main content
Known Participant
March 8, 2007
Question

cuepoints usage?

  • March 8, 2007
  • 6 replies
  • 585 views
Dear List

I'm looking into my options on the achieving the following:

1) A progressive download of an .flv file (we don't have media server, otherwhise we'd stream).
2) Once whole file is downloaded display all the cuepoints in the flv file on the timeline (with some sort of markers)
3) Markers get actionscript that when you click on them the movie seeks to this marker point and continues playing from there

It seems like I can get everything working besides obtaining the cuepoints information. So far the only way of getting cuepoint information is by playing back the entire video in real time, which is very unpractical. I've tried using the onMetaData function but I get no information on the cuepoints, just an array of undefined elements. something like this:

------------------------------------------------
canSeekToEnd = true
cuePoints = undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined
audiocodecid = 2
audiodelay = 0.038
audiodatarate = 96
videocodecid = 4
framerate = 29.9699859619141
videodatarate = 400
height = 240
width = 360
duration = 227.46
---------------------------------------------------------

All this information is great, but yes the cuepoints are missing, or am I missing something? It seems like the cuepoint sare stored in an array, but why are its elemens undefined?

Is this possible at all? Or do we need the media server for this?

Any other way of getting the information? Is there a cuepoints property that is undocumented?

Any help appreciated.

Thank you very much.

Best Regards

Stephan
    This topic has been closed for replies.

    6 replies

    March 24, 2007
    Any more pointers on inserting the cue points? We are trying to find a way to insert live cue and metadata points into a live FLV stream. Can we do this either in the encoder or in the FMS server?
    March 8, 2007
    Stephan,
    Serialization is what you accomplished looping through the metaData. Firstly, don't type your propName as Strings, since Objects, Arrays, etc are returned. Once you "discover" the cuePoint array, then you can loop through that array to retrieve cuePoint data.

    Something like this should work. Haven't tested it, but you can get the idea...

    ns.onMetaData = function(infoObject:Object) {
    for (var propName in infoObject) {
    if(infoObject[propName] == "cuePoints"){
    var cuePointArray = infoObject[propName];
    for(var i=0; i<=cuePointArray.length;i++){
    trace(cuePointArray );
    }
    }
    }
    };


    Shack

    stephan_kAuthor
    Known Participant
    March 8, 2007
    Excellent! Thanks that's great news.

    I'm not quite sure how the serializing works. Could you give me a hint?

    I've used this so far:
    -----------------------------------
    ns.onMetaData = function(infoObject:Object) {
    for (var propName:String in infoObject) {
    trace(propName + " = " + infoObject[propName]);
    }
    };


    which gave me this information (cuepoints undefined...):
    ----------------

    canSeekToEnd = true
    cuePoints = undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined
    audiocodecid = 2
    audiodelay = 0.038
    audiodatarate = 96
    videocodecid = 4
    framerate = 29.9699859619141
    videodatarate = 400
    height = 240
    width = 360
    duration = 227.46


    Thanks!!

    Stephan
    March 8, 2007
    Stephan,
    The metadata object contains an array of all cuePoints. This array can be serialized during the metadataReceived event. From there, you can do what you would like to with the cuePoint information.

    To trigger the cuePoint, the playhead passes the cuePoint time or you call the appropriate cuePoint method.

    Any FLV can contain cuePoint information and you can programmatically inject cuePoints to an FLV via actionscript (addASCuePoint()). So, FMS is not required.

    Shack
    stephan_kAuthor
    Known Participant
    March 8, 2007
    Thank you for your message B_Shack.

    That means the cuepoints can only be read when the movie is playing the the playhead "triggers" them?

    Is there no way of getting all cuepoints at once? Shouldn't it be in the MetaData as well? The real issue is I'd like to display all cuepoints with a marker before the movie has started playing, after it downloaded OR after is started downloading (either one is fine). So what I need is a list of cuepoints, rather than one cuepoint at a time...

    Is this doable without media server?

    Hope my explanation is not too confusing.

    Thanks

    Stephan

    March 8, 2007
    Stephan,
    Not documented well, but to access cuePoint information, the event object has an aditional "info" property. Use the following as an example on how to retrieve the cuePoint info.

    var listenerObject:Object = new Object();
    listenerObject.cuePoint = function(eventObject:Object):Void {
    trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime);
    trace("Cue point name is: " + eventObject.info.name);
    trace("Cue point type is: " + eventObject.info.type);
    }
    my_FLVPlybk.addEventListener("cuePoint", listenerObject);

    If you have parameters, attach parameters after info, then your cuePoint parameter key.

    As for collecting cuePoints during download, they will only launch when the playhead reaches that specific time. So, you would have to play the video for the cuePoint to fire.

    Hope this helps...

    Shack