spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column51


A Streaming Media JukeBox

Developer News
Microsoft Shows Some Ankle With Visual Studio
Gentoo Linux Cancels Distribution
It's Official: Windows 7 at PDC, WinHEC

Embedding the Windows Media Player

There are two ways to play a streaming media file. The first one is through an external Media Player. If you haven't install it yet on your computer, this link will connect you immediately to the download area:

Get Windows Media Player

To invoke the external Media Player, just place a link to an asf or ASX file in your Web page. To see a live demo of a streaming media, try this story about a turtle. The minimum modem baud rate should be 28.8K. The video stream will look more like still pictures with lower-rate communication link.

The second method to play a streaming media is to embed the Media Player in the Web page. The way to do it is by embedding an ActiveX control. As the subject of ActiveX controls needs much more attention than we can give it here, we won't dive into it in this column (we will dedicate a column to it in the near future). For now, it is sufficient to view ActiveX controls as objects that we embed in Web pages. Each object type supports a set of properties, methods, and events that is relevant to its role on the page. It is not a coincident that the HTML tag that embeds ActiveX controls is the <OBJECT> tag. Here is how the Media Player ActiveX control looks like:

<OBJECT
  ID="mediaPlayer"
  CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
  CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/
    nsmp2inf.cab#Version=5,1,52,701"
  // (The above two lines should be joined as one line.
  // They have been split for formatting purposes.)
  STANDBY="Loading Microsoft Windows Media Player components..."
  TYPE="application/x-oleobject">
  <PARAM NAME="fileName" VALUE="http://msdn.microsoft.com/
    downloads/samples/Internet/imedia/netshow/smedia/NS3/JavaScript/
    Buttons/control.asx">
  // (The above three lines should be joined as one line.
  // They have been split for formatting purposes.)
  <PARAM NAME="animationatStart" VALUE="true">
  <PARAM NAME="transparentatStart" VALUE="true">
  <PARAM NAME="autoStart" VALUE="true">
  <PARAM NAME="showControls" VALUE="true">
</OBJECT>

Let's examine the components of this tag:

AttributeDescription
IDObject ID. Can be assigned any string constant.
CLASSIDMedia Player ActiveX control registration number. Must be copied and pasted as is.
CODEBASEURL of the decompression application. Must be copied and pasted as is.
STANDBYA message to be displayed while loading the Media Player.
TYPEActiveX control type specification. Must be copied and pasted as is.

The <OBJECT> tag is accompanied with several parameter specifications:

NAMETypeDescription
fileNameStringURL of the ASF or ASX file. Can reside on an HTTP server (http://), MultiMedia Server (mms://), local hard drive (u:), or on a network drive (p://).
animationAtStartBooleanSpecifies whether to activate the Microsoft animation show while the ASF or ASX file buffers. Default is true; ignored if transparentAtStart is true.
autoStartBooleanSpecifies whether to start the ASF file when the page loads.
showControlsIntegerSpecifies whether to show the player's control buttons. A value of true shows the controls, while a value of false means no controls.
clickToPlayBooleanSpecifies whether to start the ASF when the user clicks on the player's display area.
transparentAtStartBooleanSpecifies whether to make the player transparent at the start of the play. Default is false. Takes precedence over animationAtStart.

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Controllers: Programming Application Logic - Part 2 · How to Use JavaScript to Validate Form Data · Controllers: Programming Application Logic
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Sprint Launches Mobile WiMAX Network · Albatron Downsizes with the KI780G Mini-ITX Motherboard · Can't Find a Wi-Fi Network? Make Your Own.


Created: October 25, 1999
Revised: November 20, 1999

URL: http://www.webreference.com/js/column51/install.html