How to get fastForward to work in the Windows Media Player Control?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi!

I'm starting to believe that the answer simply isn't out there... all
help is very much appreciated!



______________________________
Requirements:

A web page with an integrated Audio Player that
-1- can play (streamed) WAV files
-2- has Play / Stop / Pause / FastForward / Rewind buttons
-3- prevents the user from downloading the WAV file
-4- does not cache the audio file

My first choice was the Windows Media Player control in internet
explorer, simply because I don't need support for browsers other than
IE, and it seems quite easy at first sight to add my own UI to the
player, controlling the WMP control with some VBScript for instance. It
should become part of an ASP.NET solution anyhow...



______________________________
I tried this:

An audioPlayer.aspx file that generates a web page with a Windows Media
Player control. The URL parameter of the WMP control is a
streamAudio.aspx file. The streamAudio.aspx file streams the WAV file
to the browser (streamAudio.aspx will pick the file name from the
request eventually). I thought this already solves -3- and -4- because
the client has no direct access to the WAV file, only to a binary
stream. This is the code:


===== audioPlayer.aspx =====
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml"; >
<head runat="server"><title>audioPlayer</title></head>
<body>
<form id="form1" runat="server">
<div>
<object id="Player" height="45" width="220"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<param name="autoStart" value="False" />
<!--param name="uiMode" value="invisible" /> <!-- hide later, when it
works... -->
<param name="URL" value="audioStream.aspx" />
</object>
<input type="BUTTON" name="BtnPlay" value="Play" onclick="StartMeUp()"
/>
<input type="BUTTON" name="BtnStop" value="Stop" onclick="ShutMeDown()"
/>
<input type="BUTTON" name="BtnForward" value="fwd" onclick="ffw()" />
<script type="text/vbscript">
<!--
Sub StartMeUp ()
form1.Player.controls.play()
End Sub
Sub ShutMeDown ()
form1.Player.controls.stop()
End Sub
Sub ffw()
If form1.Player.controls.isAvailable("FastForward") Then
MsgBox "found fastforward"
form1.Player.controls.fastForward()
Else
MsgBox "didn't find fastforward"
End If
End Sub
-->
</script>
</div>
</form>
</body>
</html>


===== audioStream.aspx =====
<%@ Page Language="VB" Src="~/audioStream.aspx.vb"
Inherits="MyNS.audioStream"%>


===== Code-behind page audioStream.aspx.vb =====
Imports Microsoft.VisualBasic
Namespace MyNS
Partial Public Class audioStream
Inherits System.Web.UI.Page

Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
Response.ClearHeaders()
Response.ClearContent()
Response.ContentType = "audio/wav"
Response.WriteFile("C:\myfile.wav")
Response.End()
End Sub
End Class
End Namespace



______________________________
Result:

When I click the fwd button

on Windows XP SP2, WMP 10.00.00.3802:
all clicks: "didn't find fastforward"

on Windows 2000 advanced Server, WMP 9.00.00.2908:
first click: "found fastforward" and fast forwarding really works
all subsequent clicks: "didn't find fastforward"



______________________________
Questions:

[1] fastforward in WMP
Does anyone know why the fastforward is disabled? Is this problem
caused by my specific files (WAV files, but it also fails for mp3, and
I heard others complain even about WMV!), or is it caused by WMP? I
mean, are there some characteristics of audio files that make it
impossible for any audio player to fastforward them, or is this just a
shortcoming (bug!?) of Windows Media Player? I've seen that many others
also have experienced different behaviors of different versions of WMP,
for instance
* http://www.mcse.ms/archive220-2004-10-1124985.html and
*
http://www.streamzap.com/support/index.php?mode=view_entry&kbid=2&kbcat=5.

This scares me and makes me think WMP is completely unreliable and not
the way to go. How can I expect my customer to run WMP
10.00.00.2334.11.22.s.o.m.e.n.r.0.1.2.3 on Windows XP SP2 with this and
this and that, and nothing else because otherwise his player will not
be fully functional!? It seemed like quite a cool control initially but
it's driving me crazy now.

[2] Caching of streams
I'm not quite sure about the caching. If I stream the WAV file to the
client, is the stream cached somehow on the client? Simply put: If the
client closes all the browsers, and all sessions have expired, is there
any way that he can find and playback the audio on his machine (from
tmp internet files or whatever location)?

[3] What are the alternatives to realize the above in a reasonably
simple way: An audio player (preferably with customizable UI) that can
receive streamed WAV files (or possible a converted file format, if WAV
is not suitable), with play/pause/stop/fastforward/rewind
functionality. No Quicktime or Realplayer...

Many Thanks!

Guido

.


Quantcast