PDA

Click to See Complete Forum and Search --> : The ASX QuickTipz Guide



Cemrin
02-11-2007, 03:41 PM
Color Legend:

Purple tags (<tag>) indicate ASX attributes and tags.

Navy tags (<tag>) indicate XHTML attributes and tags.
----------------------------------------------------------------------------------------------------------


ASX: ASF Streaming Redirector File

Introduction

An ASX file is one of several types of content-streaming files called Metafiles (http://www.webopedia.com/TERM/M/metafile.html). These types of files are generally used with streaming (or brodcasting) media on the internet, such as music, tv, and radio content. The metafile can play a set array of media items arranged in a playlist. This is useful for saving server space, as well as optimizing download speeds for older systems.

The ASX metafile is the most widely used format for writing media streaming content, and is very simple to write; it is written in the general HTML syntax, but uses an XML-type schema for attributes and parameters.

The Syntax

ASX files are written in the same way you would write an HTML tag. However, the start and end tags are different -- no HTML start or end tags are required to create this file -- it is an independent browser object.

Syntax Example:

{ The syntax is the same as HTML/XHTML }



<asx version="2.0">

----------------------------------------------------------------------------------------------------------

<asx>

This tag begins the entire programming for ASX metafiles. The browser then interprets each attribute accordingly in the specified media player used. This is to be inserted in the very first line of the code. End your ASX file with the </asx> tag.

version="3.0" (Attribute)

This attribute is mandatory for creating metafiles in formats such as ASX. Although it can be left out, some problems may occur when trying to play the file or displaying information correctly. In the header above and the example below, we are using the most recent version:



<asx version="3.0">

----------------------------------------------------------------------------------------------------------

Examples

PART I: The Basic Elements

Just like HTML, there is a set of basic elements that make up the core of an ASX metafile. Each element is explained below:

<title>

This tag sets the name of the ASX playlist. An example of a name for this would be something such as "My Music Playlist" or, "My Favorite Music".

<entry>

This tag starts the coding for a new media item. The <entry> tag is the "parent" of every required parameter for the entry, holding all information elements to be displayed and loaded when the file plays. After each entry is finished, it must be closed with an </entry> tag.

<title> (Child element of <entry>)

The <title> tag refers to the name of the current media file being played. This element is a parameter set by the entry tag, and is independent from the first title tag seen at the beginning. Each entry only requires one title parameter.

<author>

As another parameter for each entry, the <author> tag displays the name of the person who created the media item being played. You would put your own name as the author if it is your original work.

<ref href="source file url" />

This tag tells the browser where the media item is located and where to "stream" it from. This information is, by default, not shown while the media is playing. You may also notice that it is written with an XML style syntax.
---------------------------------------------------------------------------------------------------------

PART II: The Structure

Now that we have clarified what each element does, it is time to put it all into proper formatting in a file. All procedures from here on will be explained through the use of Windows Notepad. An example ASX file is written like so:



<asx version="3.0">
<title>"Microsoft Music Collection - Part One"</title>
<entry>
<title>Welcome Music</title>
<author>Microsoft Corporation</author>
<ref href="http://www.mywebsite.com/title01.wma" />
</entry>
<entry>
<title>Windows XP Tour - Intro Music</title>
<author>Microsoft Corporation</author>
<ref href="http://www.mywebsite.com/winxp_tour1.wma" />
</entry>
</asx>

The information used in this example is for instructing purposes only, the source and URL information is not by any means valid and does not point to any media items relating to Microsoft Coporation or it's subsidaries.
----------------------------------------------------------------------------------------------------------

PART III: Saving an ASX / Metastream File

Now that you have completed coding the entire markup of your playlist, you have to save it -- and not just by typing in a file name and clicking the save button. There is a special process for saving metafile objects. Again, this will be done with Windows Notepad.
To save a Metafile:

1: Click File >> Save As...
2: Type in the filename, making sure it ends with .asx
3: In the "Save As Type" dropdown menu, select "All Files"
4: In the "Encoding" dorpdown menu, select "UTF-8"
5: Double-check your settings, then click the Save button, and your done! Test it out in your default media player.
----------------------------------------------------------------------------------------------------------

Chapter Notes


Limit your ASX playlist to one type of file, such as videos. Also limit the playlist to one file format
ASX metafiles are supported by both Windows and Mac machines.

----------------------------------------------------------------------------------------------------------

Links

Windows Metafile Reference (MSDN) (http://windowssdk.msdn.microsoft.com/en-us/library/aa393397(VS.80).aspx)
----------------------------------------------------------------------------------------------------------

The ASX QuickTipz Guide
Written by Cemrin
Copyright: 2006-2007 ~ Some Rights Reserved

Cemrin
02-11-2007, 03:52 PM
ASX: ASF Streaming Redirector File
Chapter II

Introduction

The basic ASX playlist we created on page on would suffice for most of the general web developers around, but for some, there's just a little more they need. They need more interactivity and display features, and a more professional setup. This chapter will outline some of the most commonly used elements in creating advanced ASX playlists, as well as show you how to stream a playlist on your own website.
----------------------------------------------------------------------------------------------------------

Examples

PART IV: Setting up a Playlist for your Website

After testing your playlist offline, now is the time to upload it and see if it will shine in its full glory.
First, upload the file to your website's server as you normally would with any other file, either through FTP or direct upload.

Once that is finished, you must now add a Media Player object to the page which will link to the file. This is done through the use of the <object> or <embed> tag. Please note that certain Media Players and certain versions will not display some paramenters you have originally set up in the ASX source code.

Add the following HTML to the page to create a Windows Media Player object:



<object width="320" height="290"
classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
id="mediaplayer1">
<param name="Filename" value="playlist77.asx">
<param name="AutoStart" value="True">
<param name="ShowControls" value="True">
<param name="ShowStatusBar" value="False">
<param name="ShowDisplay" value="False">
<param name="AutoRewind" value="True">
<embed
type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"
width="320" height="290" src="http://www.mysite.com/media/playlist77.asx"
filename="kids.mpg" autostart="True"
showcontrols="True" showstatusbar="False"
showdisplay="False" autorewind="True">
</embed>
</object>

HTML code courtesy of Adobe* TechNotes (http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_15777)

** Make sure to use a full pathname for both filename parameters for best performance.
----------------------------------------------------------------------------------------------------------

PART V: Using additional Playlist Parameters

There may be a situation where just the basic elements of an ASX playlist aren't enough. This is especially true for large, corporate media and brodcasting companies, which require a lot more information and dynamic content. I will go over the most commonly used "extra" elements. Each one in the demonstration is explained below:

<abstract>

An element that truly describes itself with great accuracy. The <abstract> tag allows for a brief description of the entire playlist and also for each individual track.

Example:


<asx version="3.0">
<title>Title of the Playlist<title>
<abstract>
Brief description of the playlist
</abstract>
...
...
</asx>


You can also use the <abstract> element to describe individual tracks:



<entry>
<title>Track 01</title>
<abstract>A short description of the Track</abstract>
<ref href="http://www.mysite.com/vidsound1.wma" />
</entry>


<copyright>

This is an element which simply adds a string of text to the Windows Media display bar underneath the console. It rotates with the file information like Artist and Title, and is commonly used in corporate displays, especially radio brodcasting.
The <copyright> tag is placed as a child element of the <entry> tag, and can be placed anywhere within the entry parameters.

Example:


<entry>
<title>Track 03: Out of Control</title>
<author>Ville Vintaren</author>
<copyright>(C) 2001-2003 Ville Vintaren; JS16</copyright>
<ref href="url of file" />
</entry>


<moreinfo>

Another little addon to most advanced ASX playlists is the ability of hyperlinking to websites via the metastream content. <moreinfo> allows for the developer to add a hyperlink to a website either by a string of text or by using the <banner> element, described later.

Example:


<entry>
<title>Track 16</title>
<moreinfo href="http://www.mysite.com/info/track16.shtml" />
<ref href="http://www.mysite.com/media/track_16.wma" />
</entry>


<banner>

Probably the one thing that both big brodcasting companies and independent media artists both like in their streaming content is a banner in which to provide some "visual" effect to their content.
The <banner> element can be implemented as a child element of <asx>, <entry>, or both.

Example:


<asx version="3.0">
<title>Media Tutorials Daily Tips: Week One</title>
<banner href="http://www.mysite.com/media/images/asxbanner.jpg" />
<abstract>Click here to go to the MTDT Website</abstract>
<moreinfo href="http://www.mysite.com/index2.html" />

** Here, <abstract> is acting as the ToolTip, or the little box of text that fades in beside your cursor after a couple seconds of hovering over a link.

<logurl>

The <logurl> tag obtains information from the currently playing item/playlist and sends it to the specified URL of a server. It also logs data to the origin server from which the playlist was opened.
In order to save and log the data extracted from the media, the destination server must be able to process submitted information, whether through means of CGI, ASP, ISAPI, or a regular HTML link to a server script directly.
The <logurl> element can be implemented as a child element of <asx>, <entry>, or both.

Example:


<asx version="3.0">
<title>CTMC Brodcasts: February 2006</title>
<logurl href="http://mytechsite.com/server/info/MetaLog.asp?Newinfo" />
<entry>
<title>CTMC: Windows Vista</title>
<author>CTMC</author>
<copyright>(C) 2004-2005 CTMC Corp. | All Rights Reserved</copyright>
<logurl href="http://mytechsite.com/server/infologs/winmediaLog.dll" />
</entry>
</asx>

For more information, you can study the LOGURL Element (http://windowssdk.msdn.microsoft.com/en-us/library/aa391897.aspx) at MSDN.com .
----------------------------------------------------------------------------------------------------------


The ASX QuickTipz Guide
Written by Cemrin
Copyright: 2006-2007 ~ Some Rights Reserved