473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

swf playlist from c#

1
Hi
I was trying to implement playlist in c#.I have 2 types of files ".flv" ".swf" in the folder.

The problem is when I create xml from code behind..I dont know how to read it ...

Here is the code that I am working on:
Playlist.aspx.cs

public partial class PlayList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{



//'Add the logical path where your music is contained here
string URLPrefix = "~//Media";


//'Specify your music's file extension here (usually should be ".mp3")
string FileExt = ".flv";// 'CHANGE FILE EXTENSION

//'Get the physical directory
string strRootDir = Server.MapPath(URLPrefix);

//'List the files contained in said directory
ListFiles(URLPrefix, strRootDir, FileExt);

}

protected void ListFiles(string urlPrefix, string strCurrentDir, string FileExt)
{
DirectoryInfo dir = new DirectoryInfo(strCurrentDir);
Array arrFiles = dir.GetFiles("*.flv");
// FileInfo strFile;
Response.Write("<?xml version=1.0 encoding= UTF-8?>");
Response.Write("<playlist>");
Response.Write("<trackList>");
foreach (FileInfo strFile in arrFiles)
{
Response.Write("<track>");
Response.Write("<title>" + strFile.Name + "</title> ");
Response.Write("<creator></creator> ");
Response.Write("<location>Media/" + strFile.Name + "</location> ");
Response.Write("</track>");

}
Response.Write("</trackList>");
Response.Write("</playlist>");
}


}

I can see xml on the page when I go to page source :

Now this is what i am doing in Playlist.aspx


<object id="presentation" width="891" height="666" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
align="middle">

<param name="flashvars" value="file=PlayList.aspx&autostart=true&repeat=li st&linktarget=_blank" />
<embed src="Media/mediaplayer.swf" quality="high" width="891" height="666" bgcolor="#000000" name="index" align="middle" allowScriptAccess="sameDomain"
name="presentation" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer\"
border="0" allowfullscreen="true"/ >
</object>

I dont know how to read xml that i made on page :
This code shows player on the page but doesnt play anything ... i think
param name="flashvars" is messed up...
I will really appreciate any help!!!
Jul 23 '08 #1
0 1404

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Emil | last post by:
This is my problem: I'm writing a script that... 1. creates a customized pls/m3u playlist 2. sends the pls or a m3u playlist to the webbrowser. The browser should open Winamp/Windows Media...
1
by: BadOmen | last post by:
This works fine, but I want to be able to make WinAmp3 to play a playlist at startup, how do i do that? This is my playlist... MyPlaylist.b4s //Initsierar activeX Objekt var oShell = new...
1
by: manoj | last post by:
hi, I am developing a Player like windows media player. I added some components from WMP. I want to load a playlist directly when .wpl file is loaded , can some one tell me how to do it. for...
2
by: siddiq | last post by:
1)I want to play a file when someone dials my phone no 2) also to detect the digit pressed by the caller can i get any idea how to do this in VB.net using TAPI 3 MSDN provides code snippet of...
19
by: Tony | last post by:
I'm working on project that plays movies using Windows Media Player and I'm controlling everything with JavaScript. Per the client I only need to support IE 6 or greater which happens to make...
1
by: thomasc | last post by:
Hello, This question is about VB.NET2003. I have a WindowsMediaPlayer Control on a windows form. Now I want to create a playlist for the control so it plays all the media files specified in...
0
by: jiwas78 | last post by:
Hey there. I am learning XML and Actionscript. I have a problem with getting my XML data to load when my SWF is in an HTML page in a browser. When I open the SWF on it's own whether in Flash Player...
0
by: jiwas78 | last post by:
Hey there. I am learning XML and Actionscript. I have a problem with getting my XML data to load when my SWF is in an HTML page in a browser. When I open the SWF on it's own whether in Flash Player...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.