Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Flash Video player in asp.page with db connectivity.

Posted on 2009-07-09
2
Medium Priority
?
279 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
_Stilgar_ earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

650 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