homepage Welcome to WebmasterWorld Guest from 54.234.59.94
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Streaming video through an ASP page
Has no one ever done this correctly?
mattglet




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

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




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

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?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved