Why does Flowplayer only work after reloading the page?

94 views Asked by At

I can't figure out why when I "first" open a page with a video on it, Flowplayer does not load, but after reloading the same page, it works fine.

I am dynamically creating Flowplayer videos in a ASP.NET repeater:

    /***** LOAD VIDEO *****/
    string src = Asset.getVideo(Request.QueryString["itemNbr"].ToString());
    string type = Path.GetExtension(src).Remove(0, 1);
    Panel player = (Panel)item.FindControl("videoPlayer");
    string control = "<video>"
        + "<source type='video/" + type + "' src='" + src + "' />"
        + "</video>";
    player.Controls.Add(new LiteralControl(control));
    lblError.Text += HttpUtility.HtmlEncode(control);

Here is the panel:

<asp:Panel ID="videoPlayer" runat="server" class="flowplayer">
</asp:Panel>

One thing I noticed is that when I Inspect Element in Chrome the first time I visit the page, the normally generated HTML is not created, but after reloading, it generates properly.

0

There are 0 answers