Solved

Flash Video player in asp.page with db connectivity.

Posted on 2009-07-09
2
267 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

743 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

15 Experts available now in Live!

Get 1:1 Help Now