Skip to main content
Known Participant
February 19, 2010
Question

playing f4v files in FMS3.1

  • February 19, 2010
  • 1 reply
  • 1480 views

I thought that FMS3.1 supported f4v files but I cannot get mine to play.  It says it cannot find the stream specified but the file is right where all my other files are that do play fine (both flv and mp4 files).  Am I incorrect in thinking that FMS3.1 supports f4v files or do I have the wrong code?  Thank you.

var vidfile = String(playerData.videoName);

if (playerData.videoStreamType == "MP4")
      vidfile = "mp4:" + vidfile + ".mp4";
else if (playerData.videoStreamType == "F4V")
      vidfile = "mp4:" + vidfile + ".f4v";

ns.play(vidfile, 0, -1);

    This topic has been closed for replies.

    1 reply

    February 19, 2010

    I assume you maybe on FMS 3.0.1 as there is no version named FMS 3.1. Yes it does support the streaming of F4V files. And you have to use Flash Player 9 update 3 or above which I think you must have. As you say you are able to stream the other flv files kept at same location but not the F4V files, I think there may be a mistake in the way you are forming the stream name. From your code snippet,

    var vidfile = String(playerData.videoName); ---> Can you trace out the value of vidfile? It might already have the file extension.

    if (playerData.videoStreamType == "MP4")
          vidfile = "mp4:" + vidfile + ".mp4";        ---> Maybe the file extension(.mp4) need not be appended as vidfile might already have the extension.
    else if (playerData.videoStreamType == "F4V")
          vidfile = "mp4:" + vidfile + ".f4v";           ---> Maybe the file extension(.f4v) need not be appended as vidfile might already have the extension.

    ns.play(vidfile, 0, -1);

    Hope this helps you. Do let me know.

    Thanks

    Mamata

    vtxr1300Author
    Known Participant
    February 19, 2010

    Yes, you're correct about the version number.  Sorry for the confusion.  The file does not come through with an extension no matter what format it is, only the title of the file and then based on an enum value in the xml string we know whether it's flv, mp4 or f4v.

    vtxr1300Author
    Known Participant
    February 19, 2010

    I found the problem.  My enum was not returning F4V for some reason.  However, one thing that puzzles me is that I don't have any meta data.  I wanted to use the F4V format because I thought it put in the metadata necessary to get the video's length?  Here's the basic code that gets the duration from flv files but isn't getting anything from mp4 or f4vs.

    private var myClient:Object = new Object();

    ....

    ns = new NetStream(connection);
    ns.client = myClient;

    ......

    myClient.onMetaData = metaDataHandler;

    private function metaDataHandler(metaData:Object):void
    {
        trace(metaData.duration);
        duration = metaData.duration;

    }

    When I run this I get no trace information which seems to indicate it's not getting into the metaDataHandler function.  Is there something I need to do in the adobe media encoder to get the metadata exported with the file?