Solved

Flash Video player in asp.page with db connectivity.

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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to repeat the data 4 30
How to structure query with count aggregate 4 44
Header Font Size in Grid View 6 25
Validation for Passport expiry in asp.net 2 13
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
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 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.

749 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