Welcome to WebmasterWorld Guest from 54.234.63.187

Forum Moderators: ocean10000

Message Too Old, No Replies

Streaming video through an ASP page

Has no one ever done this correctly?

     

mattglet

2:13 pm on May 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've been fighting for 2 days trying to figure out a solution that works on Mac & Windows.

I've got an embedded object:

<object id="objMediaPlayer" width="320" height="282" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" standby="Loading Microsoft Windows Media Player components..." type = "application/x-mplayer2" VIEWASTEXT>
<param name="fileName" value="http://example.com/video.asp?file={5D550BAD-F77B-4442-BC0E-36B9AA6BEE73}&bitrate=384k&extension=WMV">
<param name="animationatStart" value="true">
<param name="transparentatStart" value="true">
<param name="autoStart" value="true">
<param name="showControls" value="true">
<param name="volume" value="0">
<embed src="http://example.com/video.asp?file={5D550BAD-F77B-4442-BC0E-36B9AA6BEE73}&bitrate=384k&extension=WMV" width="320" height="282" volume="0" type="video/x-ms-wmv">
</object>

video.asp consists of (some dynamic values have been hardcoded for the sake of simplicity in this example):

<%
Response.Clear
Response.ContentType = "video/x-ms-wmv"
Response.AddHeader "Content-disposition", "filename=video.wmv"
Response.AddHeader "Content-Length", intFileSize

Set objBinaryStream = Server.CreateObject("ADODB.Stream")
objBinaryStream.Type = 1
objBinaryStream.Open
objBinaryStream.LoadFromFile Server.MapPath("/videos/whatever.wmv")

Do While Not objBinaryStream.EOS
Response.BinaryWrite objBinaryStream.Read(512000)
Response.Flush
Loop

objBinaryStream.Close
Set objBinaryStream = Nothing
%>

This works fine and dandy in Windows, but I'm getting "Playlist format is not recognized" errors in Mac IE & Safari. I am able to run QuickTime files through the script perfectly on both Windows & Mac.

Can anyone provide any insight?

mattglet

2:37 pm on May 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So, here's a solution I made, but I don't want to use:

Instead of using video.asp, I created video.wmv and mapped it's execution to the ASP DLL for processing. Apparently Macs like the file extension to be true to it's content-type. Shouldn't the Content-type override the file extension?

 

Featured Threads

Hot Threads This Week

Hot Threads This Month