Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > flash flv player with an AJAX playlist

Thread Tools

flash flv player with an AJAX playlist

Posts: n/a
I'm trying to create a playlist control using AJAX to be used with a flash
video player. I have created the playlist control out of a 2 GridView
controls in an update panel. The first GridView is my list of playlists and
the second GridView is a list of playlist items for the selected playlist.
When a playlist item is selected the html for the flash video player is
generated and inserted into a DIV and the video begins playing. My problem
is that when a new playlist is clicked to be browsed and before another
playlist item is selected my video starts over. I've included my code below.
Any help would be greatly appreciated. Thanks,
Scott W.


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Player.aspx.cs"
Inherits="Player" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="" >
<head runat="server">
<title>Playlist Demo</title>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<div id="playerColumn" style="width: 400px; float: left;
margin-right: 20px; border-right: gainsboro 1px solid; border-top: gainsboro
1px solid; border-left: gainsboro 1px solid; border-bottom: gainsboro 1px
<div id="divPlayer" runat="server">
<div id="playlistColumn" style="width: 200px; float: left;
border-right: gainsboro 1px solid; border-top: gainsboro 1px solid;
border-left: gainsboro 1px solid; border-bottom: gainsboro 1px solid;">
Playlist:<br />
<asp:GridView ID="grdPlaylists" runat="server"
AutoGenerateColumns="False" DataKeyNames="PlaylistID"
EmptyDataText="No records found" ShowHeader="False"
OnSelectedIndexChanged="grdPlaylists_SelectedIndex Changed">
<asp:BoundField DataField="PlaylistName"
HeaderText="Playlist" ReadOnly="True" ShowHeader="False" />
<br />
Items:<br />
<asp:GridView ID="grdItems" runat="server"
AutoGenerateColumns="False" DataKeyNames="ItemUrl"
EmptyDataText="No records found" ShowHeader="False"
<asp:BoundField DataField="ItemName"
HeaderText="Name" ReadOnly="True" ShowHeader="False" />
<asp:Button ID="Button1" runat="server"
CommandName="Play" Text="Play" CommandArgument='<%# Eval("ItemUrl") %>' />

Code behind:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Player : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
if (!Page.IsPostBack)
grdPlaylists.DataSource = PlaylistController.GetPlaylists();

protected void grdPlaylists_SelectedIndexChanged(object sender,
EventArgs e)
grdItems.DataSource =
PlaylistController.GetPlaylistItems(Convert.ToInt3 2(grdPlaylists.SelectedValue));

protected void grdItems_RowCommand(Object sender,
GridViewCommandEventArgs e)
if (e.CommandName == "Play")


private void displayPlayer(string mediaUrl)
Web20.Players.FlowPlayer121.Clip media = new
media.Url = mediaUrl;

Web20.Players.FlowPlayer121 p = new Web20.Players.FlowPlayer121();
p.AutoPlay = true;
p.Loop = false;
p.InitialScale = ale;

divPlayer.InnerHtml = p.Html;

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off