4 Replies Latest reply on Apr 9, 2007 8:15 AM by brettlyman

    FLVPlayback with NetConnection

    brettlyman
      I am building a content management system that stores all user-submitted files in a database (rather than on the filesystem), and the files are retrieved via a "GetFile.aspx?file=some_id" url. This script correctly outputs the mime-type, name/title, size, binary data, etc. It works great when downloading files, displaying images in web pages, and other uses, but does NOT work when used in the "contentPath" attribute of my FLVPlayback component instance.

      myFlvPlayback.contentPath = "GetFile.aspx?file=1"; // does not work!

      Storing the .flv file on the filesystem and referencing it by name works great, however, but that's not possible with my content management system.

      I'm hoping that using a NetConnection with the FLVPlayback component will allow it to work, but can't find any documentation for attaching the NetStream video to the FLVPlayback component instance.

      Any ideas? Does a solution exist, or am I forced to create my own custom player? Any help is greatly appreciated.
        • 1. Re: FLVPlayback with NetConnection
          Greg Dove Level 4
          I'm sorry I can't give you the answer you seek but I can add something from my recent experience. I discovered the FLVPlayback seemed to be sensitive to the file extension... whereas the older MediaDisplay component wasn't e.g. I could change the name (even remove the extension completely) of a flv and the older components would play it. FLVPlayback didn't. So it may be sensitive to the fact there is no .flv in the contentPath at the player level irrespective of how well things are set up to be sent from the server. Maybe you can test this to check.

          Also another recent gotcha for me was the need to update the component. I hadn't used it for a long time and a bugfix release came out mid 2006. I don't think it mentioned anything like you describe as an issue, but check you've got it anyhow. version_1_0_1 in the components inspector.

          I know FLVPlayback does the NetConnection management itself and don't know much about it. Others may know how to do this. There's an example of something quite sophisticated that works with PHP and custom player here (I had a look inside the fla after download... it might help you - although I realise you're not trying to do the same thing)
          http://www.flashcomguru.com/index.cfm/2005/11/2/Streaming-flv-video-via-PHP-take-two


          • 2. Re: FLVPlayback with NetConnection
            brettlyman Level 1
            Thank you so much!!! I have been searching all day for a solution...

            If I simply put "&type=.flv" on the end of the url, it works. That eliminates the need for NetConnection and greatly reduces the complexity...

            YOU ROCK!
            • 3. Re: FLVPlayback with NetConnection
              Greg Dove Level 4
              I'm pleased it led you in the right direction... I believe its got something to do with how the component decides whether its going to be a progressive download or rtmp stream, and that it was attempting a streaming connection based on a URL without the .flv extension.

              Without being sure, because I haven't tried it and don't know the internal workings of the component, it could be that specifiying an absolute URL with http:// at the start might do it too. Whether that works would depend on what the component's internal criteria are and their priorities for choosing which type of content its attempting to play.
              • 4. Re: FLVPlayback with NetConnection
                brettlyman Level 1
                I checked in "Temporary Internet Files" and Flash saves the file with the name of the URL that I used, instead of the file name provided in the headers. And without the ".flv" on the end of the URL, the local system doesn't know what type of file it is, and neither does the Flash movie.

                It's strange that flash would do it that way, because browsers use the file name in the headers when downloading, not the URL, and they store the file correctly.

                I also tested with " http://" and an absolute URL, but it still doesn't work unless I add ".flv" to the end.