Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

  NetShow Services

Dynamic HTML Streamed by NetShow Services

Demo

Description

GOAL: Use a NetShow audio stream to control and synchronize DHTML events on the page.

To do this, we use Internet Explorer 4.x, and a NetShow ASF file with script events embedded into the stream that fire off DHTML events at specific times in the playback of the audio file. Note that in this case, we made the Windows Media Player control invisible and used audio only. You could certainly have the Windows Media Player control appear on the page and contain audio only, illustrated audio, or video.

CODE TO PUT IN YOUR HTML: These subroutines are used to receive and interpret the events and parameters being sent from the NetShow stream. NSPlay1 refers to the Windows Media Player control. This segment of code should come after the <TITLE> tag in your HTML.

<Script Language=javascript>

var bFadeWhite, bFadeBlack;
var bLogoIn, bLogoOut;
var bBannerIn, bBannerOut;
var bControlsIn, bControlsOut;

function InitializePage()
{
Cap1.style.left = 300;
Cap1.innerText = "Please Wait...";
Cap1.style.color = 0xFFFFFF;

} /* end InitializePage() */

window.onload = InitializePage;

//---------------------------------------
// Driver Timer Routines
//---------------------------------------
function Driver_Timer ()
{

if (bFadeWhite || bFadeBlack || bLogoIn || bLogoOut || bBannerIn || bBannerOut || bControlsIn || bControlsOut) {
} else {
}

} /* end driver_Timer() */

//---------------------------------------
// Script command director
//---------------------------------------

function BookMark (mark)
{
} /* end BookMark() */

//---------------------------------------
// Move routines
//---------------------------------------

function BannerIn ()
{
}

function BannerOut ()
{
}

function ControlsIn ()
{
}

function ControlsOut ()
{
}

function FadeWhite ()
{
}

function FadeBlack ()
{
}

function LogoIn ()
{
}

function LogoOut ()
{
}

</Script>

This says that if the Windows Media Player control sends an event (scType) called sc, to plug the parameter it sends with it (Mark) into the function called BookMark. This function triggers different DHTML actions based on the Mark number being sent at that time. For example, if the event is sc and the parameter is number 12, then the function called will execute the command Cap1.innerText = "_OnMouseOver", or the text in the middle of the document should change to read, "_OnMouseOver." Remember that this won't work unless your ASF stream contains these events and parameters.

Also, you will need to add the following to the body of the HTML page. The first <OBJECT> called Driver handles the fade in/fade out and movement tempo of events on the page. The NSPlay1 <OBJECT> tag is the Windows Media Player control that plays the ASF. Note that the width and height are set to zero so the player won't show on the page at all. The NSPlay1 JavaScript block simply allows the Windows Media Player control to send events that are interpreted by the JavaScript code above.

EVENTS AND PARAMETERS TO PUT IN YOUR NETSHOW STREAM: The preceding subroutine will wait for events and parameters from the NetShow stream to be sent to it before it will do anything. In this example, here are the events and parameters we used:

Time Event (scType) Parameter (Mark)
00:06.0 SC 1
00:19.0 SC 2
00:25.0 SC 3
00:29.0 SC 4
00:39.0 SC 5
00:47.0 SC 6
00:51.0 SC 7
00:57.0 SC 8
01:04.0 SC 9
01:08.0 SC 10
01:10.0 SC 11
01:14.0 SC 12
01:15.0 SC 13
01:18.6 SC 14
01:20.0 SC 15
01:22.3 SC 16
01:29.0 SC 17

Here, at specific times, the sc events and mark parameters are sent to the browser, where the BookMark function acts upon them.

For more information about using DHTML, see the Dynamic HTML area of the Site Builder Workshop.

© 1998 Microsoft Corporation. All rights reserved. Terms of use.

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site