Skip navigation
Currently Being Moderated

FLVPlayback source with query strings (parameters) doesn't load

Aug 31, 2010 8:36 AM

Flash version: CS4

AS version: AS3



I'm currently trying to use the FLVPlayback component and pass a source FLV that's living on a cloudfront webserver. The problem is that the cloudfront requires authentication in the form of query strings in the source FLV. For example:



var mainMovie:FLVPlayback = new FLVPlayback();
mainMovie.source = "";



As soon as I take away the "dummyquery", it works fine. When I add a query string, it breaks (nothing loads).


Here is the error output I get:


[object FLVPlayback]
VideoError: 1005: Invalid xml: URL: "" No root node found; if url is for an flv it must have .flv extension and take no parameters


It adds on "&FLVPlaybackVersion=2.1" to the end.


I saw a different article that said I should add a dummy variable at the end like "&dummy=.flv" because I was told that Flash is basically looking for an .flv extension at the end and you can trick it, but it doesn't work because they add on additional code.


Does anyone know how to work around this?

  • Currently Being Moderated
    Aug 31, 2010 8:48 AM   in reply to

    I don't know how cloudfront authentication works but I doubt you can use FLVPlayback for urls structured this way. Chances are, you need to write your own player taking into account cloudfront NetConnection/NetStream routine.

    Mark as:
  • Currently Being Moderated
    Aug 31, 2010 9:27 AM   in reply to

    Again, I don't believe you can use FLVPlayback for this purpose and you should look into writing your own streaming routine because, it seams, FLVPlayback's way of dealing with urls is not flexible enough.

    Mark as:
  • kglad
    72,253 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 31, 2010 9:32 AM   in reply to Andrei1

    (i think there is a way to append an identifying query string to the source parameter.  check these forums for a similar issue within the past few weeks that, i believe, the op found a work-around.)

    Mark as:
  • Currently Being Moderated
    Aug 31, 2010 9:55 AM   in reply to

    Here is an excerpt from Adobe article ( t.html). It seems it explains xml error:


    Because a video file can originate from a variety of locations and because a URL can specify an XML or SMIL file in addition to a video file, the FLVPlayback component analyzes the URL that you supply. After  installing Flash Player 9 Update 3, the FLVPlayback component performs the following checks on the URL in this order:


    • If you specify the RTMP, RTMPT,  RTMPS, RTMPE, or RTMPTE protocol for streaming from Flash Media Server (FMS), the source URL is assumed to be streaming video from Flash Media Server
    • If the URL does not include a query string, for example:
      and the URL does not end in .txt, .xml or .smil, the source is assumed to be a video file
    • If the URL cotains the string "/fms/fpad" then the source is assumed to be a FPAD XML file from Flash Media Server
    • If none of  the above is true, the FLVPlayback component assumes the source URL is a SMIL file
    Mark as:
  • Currently Being Moderated
    Nov 30, 2010 11:53 AM   in reply to

    Hey supervu,


    I know you already found a workaround to make this work, just figured I'd post an alternative to editing the FLVPlayback compoent. I also am retrieving an FLV file via a .Net ASHX file. To keep both worlds happy, I used a URLRewriter module to translate for me... this one translates what I am using for the FLVPlayback component source:

   to be resolved as


    There is of course no flv folder in the root of my application...


    Here is my very simple URLRewriter class in




    Imports Microsoft.VisualBasic
    Imports System
    Imports System.Web

    Public Class URLRewriter
        Implements IHttpModule

        Public Sub Init(ByVal inst As System.Web.HttpApplication) Implements System.Web.IHttpModule.Init
            AddHandler inst.BeginRequest, AddressOf Me.OnBeginRequest
        End Sub

        Public Sub OnBeginRequest(ByVal app As Object, ByVal e As EventArgs)
            Dim inst As HttpApplication = CType(app, HttpApplication)
            Dim req_path As String = inst.Context.Request.Path
            Dim trans_path As String = ""
            Dim search As String = "/flv/"
            Dim pos As Integer = req_path.IndexOf("/flv/")
            If pos > -1 Then
                Dim key as string = req_path.Substring(pos + search.Length, (req_path.LastIndexOf(".flv") - (pos + search.Length)))
                HttpContext.Current.Response.Redirect("~/API/resource.ashx?ID=" & key )
            End If

        End Sub

        Public Sub Dispose() Implements System.Web.IHttpModule.Dispose

        End Sub

    End Class




    and make sure you add this to your web.config.. this will cause URLRewriter to intercept all HTTP requests, and redirect as needed.




              <add name="URLRewriter" type="[Namespace].URLRewriter"/>



    Hope this helps someone.

    Mark as:
  • Currently Being Moderated
    Nov 29, 2011 2:32 AM   in reply to

    I'm having the same problem and I've tried to solve it the same way. But it does't seem to work.


    No READY-event is fired. I added a STATE_CHANGE listener, the event is fired and the event.state is VideoState.CONNECTION_ERROR...


    Has the behaviour perhaps changed in one of the latest Flash versions? I'm using FLVPlayback version

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points