Solved

Flash Video player in asp.page with db connectivity.

Posted on 2009-07-09
2
269 Views
Last Modified: 2012-06-21
Hey all, I'm trying to add a flash video player to my asp.net site, using the common way to insert flash (below is snippet from the overall object tag)

<param name="movie" value="player.swf?video = videos/video1.flv" /><param name="quality" value="high" /><param>

What i want is to query the database for the video location and insert it into the value="" part.

Any ideas how I can go about this? I have so far used formview to grab the URL (Might not be the best way to do it..) and I'm struggling how to get that query result into the above code!

Thanks!

Below is formview code which grabs the url (through wizard in Visual Web Developer)
<asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1">

        <EditItemTemplate>

            VideoURL:

            <asp:TextBox ID="VideoURLTextBox" runat="server" Text='<%# Bind("VideoURL") %>' />

            <br />

            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"

                Text="Update" />

            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False"

                CommandName="Cancel" Text="Cancel" />

        </EditItemTemplate>

        <InsertItemTemplate>

            VideoURL:

            <asp:TextBox ID="VideoURLTextBox" runat="server" Text='<%# Bind("VideoURL") %>' />

            <br />

            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"

                Text="Insert" />

            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"

                CommandName="Cancel" Text="Cancel" />

        </InsertItemTemplate>

        <ItemTemplate>

            VideoURL:

            <asp:Label ID="VideoURLLabel" runat="server" Text='<%# Bind("VideoURL") %>' />

            <br />

        </ItemTemplate>

    </asp:FormView>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ELEARNConnectionString1 %>"

        SelectCommand="SELECT [VideoURL] FROM [Video] WHERE ([VideoName] = @VideoName)">

        <SelectParameters>

            <asp:ControlParameter ControlID="Videolbl" Name="VideoName" PropertyName="Text" Type="String" />

        </SelectParameters>

    </asp:SqlDataSource>

    <asp:Label ID="Videolbl" runat="server" Text="Scrubs"></asp:Label>

Open in new window

0
Comment
Question by:area96
2 Comments
 
LVL 14

Accepted Solution

by:
_Stilgar_ earned 500 total points
ID: 24813320
I would use a literal control (or even a simple response.write) to output the tag with the desired value in it. Something like:

In the ASPX:
<asp:Literal ID="myLiteral" runat="server" />

In your code:
// Here you populate myLiteral.Text with the HTML for the Flash player (<object etc..).
myLiteral.Text += string.Format("<param name=\"movie\" value=\"player.swf?video={0}\" /><param name=\"quality\" value=\"high\" /><param>", moviePath);
myLiteral.Text += "</object>";
0
 

Author Closing Comment

by:area96
ID: 31601534
Excellent, for the time and hassle it saved they are well deserved points!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now