?
Solved

Flash Video player in asp.page with db connectivity.

Posted on 2009-07-09
2
Medium Priority
?
277 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

Linux Academy Android App Now Supports Chromecast

We have some fantastic news for our Android fans. We’re so excited to announce that the Linux Academy Android app is now available with Chromecast support. That’s right – simply download the latest update of the Linux Academy App and start casting your favorite course videos!

Question has a verified solution.

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

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…
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 live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

771 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