473,756 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot jump to new part of Silverlight video when using handler

This is a follow-up to my post "Silverligh t video doesn't work when file is
streamed from handler in ASP.net" at
http://www.microsoft.com/communities...0-5ee60d2a18a5.

I have a web site under .NET 2.0 that renders videos using the Silverlight
media player. When I stream the video file (.wmv) to the browser via a
hard-coded link to the file, all is well. And when I use an HTTP handler to
stream the video to the browser, it also plays. BUT... when I use the handler
the Silverlight player has a problem - I cannot jump to different portions of
the video by dragging the position indicator or clicking a new possition.
When I try, the center of the player turns into rotating circles and inside
it says "0". In other words, it is telling me to wait as it moves to the new
position, but it never does.

Furthermore, once I attempt to go to a new position, the Play button no
longer works and there is nothing I can do to get the video to play short of
reloading the page.

I set up two demonstration pages:
http://www.galleryserverpro.com/dev/webapp2/video2.aspx - This uses the
handler and demonstrates the issue. Notice that - for example - you cannot
move the cursor to the middle of the video and click Play.

http://www.galleryserverpro.com/dev/...nohandler.aspx - This is
identical to the first page, except instead of using the handler it
hard-codes a direct link to the .wmv file. You can jump around to different
sections without any trouble.

Using the first link above, I see the issue in these setups:

Win 2008 Server / FF3
Vista / FF3
Win XP / FF2
Win XP / IE6

Interestingly, the handler *does* work in IE7 (Win 2008 Server and Vista).

Below is the HTTP handler:

using System.IO;
using System.Web;

namespace WebApplication2 .handler
{
[System.Web.Serv ices.WebService (Namespace = "http://tempuri.org/")]
[System.Web.Serv ices.WebService Binding(Conform sTo =
System.Web.Serv ices.WsiProfile s.BasicProfile1 _1)]
public class getmediaobject : IHttpHandler
{
#region IHttpHandler Members

public bool IsReusable
{
get { return true; }
}

public void ProcessRequest( HttpContext context)
{
ProcessMediaObj ect(context,
context.Server. MapPath("~/video/3StrikesChipmun k_56.wmv"));
}

#endregion

private void ProcessMediaObj ect(HttpContext context, string filePath)
{
FileStream fileStream = null;
try
{
context.Respons e.Clear();
context.Respons e.ContentType = "video/x-ms-wmv";
context.Respons e.Buffer = false;

HttpCachePolicy cachePolicy = context.Respons e.Cache;
cachePolicy.Set Expires(System. DateTime.Now.Ad dSeconds(259200 0)); // 30
days
cachePolicy.Set Cacheability(Ht tpCacheability. Public);
cachePolicy.Set ValidUntilExpir es(true);

const int bufferSize = 32768;
byte[] buffer = new byte[bufferSize];
long byteCount;
fileStream = File.OpenRead(f ilePath);
context.Respons e.AddHeader("Co ntent-Length",
fileStream.Leng th.ToString());
while ((byteCount = fileStream.Read (buffer, 0, buffer.Length)) 0)
{
if (context.Respon se.IsClientConn ected)
{
context.Respons e.OutputStream. Write(buffer, 0, buffer.Length);
context.Respons e.Flush();
}
else
{
return;
}
}
}
finally
{
if (fileStream != null)
fileStream.Clos e();

context.Respons e.End();
}
}
}
}

Thanks for your help!
Roger Martin
Gallery Server Pro
Nov 14 '08 #1
13 4014
my guess (if you would use a network sniffer as I suggested earlier
you'd know) is that silverlight use gets with a range when streaming
video (flash does). this is supported by iis, but your handler does not
support it. read the w3c http 1.1 spec to learn how to implement it.

-- bruce (sqlwork.com)

Roger Martin wrote:
This is a follow-up to my post "Silverligh t video doesn't work when file is
streamed from handler in ASP.net" at
http://www.microsoft.com/communities...0-5ee60d2a18a5.

I have a web site under .NET 2.0 that renders videos using the Silverlight
media player. When I stream the video file (.wmv) to the browser via a
hard-coded link to the file, all is well. And when I use an HTTP handler to
stream the video to the browser, it also plays. BUT... when I use the handler
the Silverlight player has a problem - I cannot jump to different portions of
the video by dragging the position indicator or clicking a new possition.
When I try, the center of the player turns into rotating circles and inside
it says "0". In other words, it is telling me to wait as it moves to the new
position, but it never does.

Furthermore, once I attempt to go to a new position, the Play button no
longer works and there is nothing I can do to get the video to play short of
reloading the page.

I set up two demonstration pages:
http://www.galleryserverpro.com/dev/webapp2/video2.aspx - This uses the
handler and demonstrates the issue. Notice that - for example - you cannot
move the cursor to the middle of the video and click Play.

http://www.galleryserverpro.com/dev/...nohandler.aspx - This is
identical to the first page, except instead of using the handler it
hard-codes a direct link to the .wmv file. You can jump around to different
sections without any trouble.

Using the first link above, I see the issue in these setups:

Win 2008 Server / FF3
Vista / FF3
Win XP / FF2
Win XP / IE6

Interestingly, the handler *does* work in IE7 (Win 2008 Server and Vista).

Below is the HTTP handler:

using System.IO;
using System.Web;

namespace WebApplication2 .handler
{
[System.Web.Serv ices.WebService (Namespace = "http://tempuri.org/")]
[System.Web.Serv ices.WebService Binding(Conform sTo =
System.Web.Serv ices.WsiProfile s.BasicProfile1 _1)]
public class getmediaobject : IHttpHandler
{
#region IHttpHandler Members

public bool IsReusable
{
get { return true; }
}

public void ProcessRequest( HttpContext context)
{
ProcessMediaObj ect(context,
context.Server. MapPath("~/video/3StrikesChipmun k_56.wmv"));
}

#endregion

private void ProcessMediaObj ect(HttpContext context, string filePath)
{
FileStream fileStream = null;
try
{
context.Respons e.Clear();
context.Respons e.ContentType = "video/x-ms-wmv";
context.Respons e.Buffer = false;

HttpCachePolicy cachePolicy = context.Respons e.Cache;
cachePolicy.Set Expires(System. DateTime.Now.Ad dSeconds(259200 0)); // 30
days
cachePolicy.Set Cacheability(Ht tpCacheability. Public);
cachePolicy.Set ValidUntilExpir es(true);

const int bufferSize = 32768;
byte[] buffer = new byte[bufferSize];
long byteCount;
fileStream = File.OpenRead(f ilePath);
context.Respons e.AddHeader("Co ntent-Length",
fileStream.Leng th.ToString());
while ((byteCount = fileStream.Read (buffer, 0, buffer.Length)) 0)
{
if (context.Respon se.IsClientConn ected)
{
context.Respons e.OutputStream. Write(buffer, 0, buffer.Length);
context.Respons e.Flush();
}
else
{
return;
}
}
}
finally
{
if (fileStream != null)
fileStream.Clos e();

context.Respons e.End();
}
}
}
}

Thanks for your help!
Roger Martin
Gallery Server Pro
Nov 14 '08 #2
Hi Roger,

I still cannot reproduce this problem on my side. As Bruce suggested, first
try to add following HTTP header in the response to see if it works:

context.Respons e.AddHeader("Ac cept-Ranges", "bytes");

Refer to Header Field Definitions:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

Please let me know if you made progress on this issue. I'll try to find a
mchine that can reproduce this issue.

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Thread-Topic: Cannot jump to new part of Silverlight video when using
handler
| thread-index: AclGCAbQg8ZDlea rR8yLrR5iezrDyg ==
| X-WBNR-Posting-Host: 207.46.193.207
| From: =?Utf-8?B?Um9nZXIgTWF ydGlu?= <rd******@commu nity.nospam>
| Subject: Cannot jump to new part of Silverlight video when using handler
| Date: Thu, 13 Nov 2008 19:21:04 -0800
| Lines: 112
| Message-ID: <8F************ *************** *******@microso ft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3168
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| Path: TK2MSFTNGHUB02. phx.gbl
| Xref: TK2MSFTNGHUB02. phx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:7985 7
| NNTP-Posting-Host: tk2msftibfm01.p hx.gbl 10.40.244.149
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| This is a follow-up to my post "Silverligh t video doesn't work when file
is
| streamed from handler in ASP.net" at
|
http://www.microsoft.com/communities...aspx?dg=micros
oft.public.dotn et.framework.as pnet&mid=e9a38d 03-83a8-41fc-8950-5ee60d2a18a5.
|
| I have a web site under .NET 2.0 that renders videos using the Silverlight
| media player. When I stream the video file (.wmv) to the browser via a
| hard-coded link to the file, all is well. And when I use an HTTP handler
to
| stream the video to the browser, it also plays. BUT... when I use the
handler
| the Silverlight player has a problem - I cannot jump to different
portions of
| the video by dragging the position indicator or clicking a new possition.
| When I try, the center of the player turns into rotating circles and
inside
| it says "0". In other words, it is telling me to wait as it moves to the
new
| position, but it never does.
|
| Furthermore, once I attempt to go to a new position, the Play button no
| longer works and there is nothing I can do to get the video to play short
of
| reloading the page.
|
| I set up two demonstration pages:
| http://www.galleryserverpro.com/dev/webapp2/video2.aspx - This uses the
| handler and demonstrates the issue. Notice that - for example - you
cannot
| move the cursor to the middle of the video and click Play.
|
| http://www.galleryserverpro.com/dev/...nohandler.aspx - This
is
| identical to the first page, except instead of using the handler it
| hard-codes a direct link to the .wmv file. You can jump around to
different
| sections without any trouble.
|
| Using the first link above, I see the issue in these setups:
|
| Win 2008 Server / FF3
| Vista / FF3
| Win XP / FF2
| Win XP / IE6
|
| Interestingly, the handler *does* work in IE7 (Win 2008 Server and Vista).
|
| Below is the HTTP handler:
|
| using System.IO;
| using System.Web;
|
| namespace WebApplication2 .handler
| {
| [System.Web.Serv ices.WebService (Namespace = "http://tempuri.org/")]
| [System.Web.Serv ices.WebService Binding(Conform sTo =
| System.Web.Serv ices.WsiProfile s.BasicProfile1 _1)]
| public class getmediaobject : IHttpHandler
| {
| #region IHttpHandler Members
|
| public bool IsReusable
| {
| get { return true; }
| }
|
| public void ProcessRequest( HttpContext context)
| {
| ProcessMediaObj ect(context,
| context.Server. MapPath("~/video/3StrikesChipmun k_56.wmv"));
| }
|
| #endregion
|
| private void ProcessMediaObj ect(HttpContext context, string filePath)
| {
| FileStream fileStream = null;
| try
| {
| context.Respons e.Clear();
| context.Respons e.ContentType = "video/x-ms-wmv";
| context.Respons e.Buffer = false;
|
| HttpCachePolicy cachePolicy = context.Respons e.Cache;
| cachePolicy.Set Expires(System. DateTime.Now.Ad dSeconds(259200 0)); //
30
| days
| cachePolicy.Set Cacheability(Ht tpCacheability. Public);
| cachePolicy.Set ValidUntilExpir es(true);
|
| const int bufferSize = 32768;
| byte[] buffer = new byte[bufferSize];
| long byteCount;
| fileStream = File.OpenRead(f ilePath);
| context.Respons e.AddHeader("Co ntent-Length",
| fileStream.Leng th.ToString());
| while ((byteCount = fileStream.Read (buffer, 0, buffer.Length)) 0)
| {
| if (context.Respon se.IsClientConn ected)
| {
| context.Respons e.OutputStream. Write(buffer, 0, buffer.Length);
| context.Respons e.Flush();
| }
| else
| {
| return;
| }
| }
| }
| finally
| {
| if (fileStream != null)
| fileStream.Clos e();
|
| context.Respons e.End();
| }
| }
| }
| }
|
| Thanks for your help!
| Roger Martin
| Gallery Server Pro
|

Nov 14 '08 #3
Unfortunately, adding "Accept-Ranges" did not help; in fact, in made it
worse. When present, the video refuses to play at all, and no position
indicator appears to allow dragging or repositioning.

Here are the response headers after I added it:
Frame: Number = 434, Captured Frame Length = 1514, MediaType = ETHERNET
+ Ethernet: Etype = Internet IP
(IPv4),Destinat ionAddress:[00-16-E6-8F-5E-9E],SourceAddress:[00-06-25-7F-45-9D]
+ Ipv4: Src = 209.67.188.9, Dest = 192.168.1.102, Next Protocol = TCP,
Packet ID = 29397, Total IP Length = 1500
+ Tcp: Flags=...A...., SrcPort=HTTP(80 ), DstPort=63247, PayloadLen=1460 ,
Seq=3634901546 - 3634903006, Ack=233418134, Win=64240 (scale factor 0x0) =
64240
- Http: Response, HTTP/1.1, Status Code = 200, URL:
/dev/webapp2/handler/getmediaobject. ashx
ProtocolVersion : HTTP/1.1
StatusCode: 200, Ok
Reason: OK
Cache-Control: public
ContentLength: 449378
ContentType: video/x-ms-wmv
Expires: Sun, 14 Dec 2008 13:59:01 GMT
Accept-Ranges: bytes
Server: Microsoft-IIS/7.0
XAspNetVersion: 2.0.50727
XPoweredBy: ASP.NET
Date: Fri, 14 Nov 2008 13:59:00 GMT
Connection: close
HeaderEnd: CRLF
+ payload: HttpContentType = video/x-ms-wmv

It is odd you have such a hard time reproducing the issue. I have several
computers here with a total of 4 browsers (FF2, FF3, IE6, IE7) and the only
place it works is with IE7.

Roger
Nov 14 '08 #4
you actually have to add Range support to your handler, not just say you
have it and ignore the range requests. look at the request to see if
it has a range specified. a range specifies a offset and a length of
bytes to return. that is you don't stream the whole file per request,
just the bytes requested.

ie7 is probably precaching the video (maybe a bug).

-- bruce (sqlwork.com)

Roger Martin wrote:
Unfortunately, adding "Accept-Ranges" did not help; in fact, in made it
worse. When present, the video refuses to play at all, and no position
indicator appears to allow dragging or repositioning.

Here are the response headers after I added it:
Frame: Number = 434, Captured Frame Length = 1514, MediaType = ETHERNET
+ Ethernet: Etype = Internet IP
(IPv4),Destinat ionAddress:[00-16-E6-8F-5E-9E],SourceAddress:[00-06-25-7F-45-9D]
+ Ipv4: Src = 209.67.188.9, Dest = 192.168.1.102, Next Protocol = TCP,
Packet ID = 29397, Total IP Length = 1500
+ Tcp: Flags=...A...., SrcPort=HTTP(80 ), DstPort=63247, PayloadLen=1460 ,
Seq=3634901546 - 3634903006, Ack=233418134, Win=64240 (scale factor 0x0) =
64240
- Http: Response, HTTP/1.1, Status Code = 200, URL:
/dev/webapp2/handler/getmediaobject. ashx
ProtocolVersion : HTTP/1.1
StatusCode: 200, Ok
Reason: OK
Cache-Control: public
ContentLength: 449378
ContentType: video/x-ms-wmv
Expires: Sun, 14 Dec 2008 13:59:01 GMT
Accept-Ranges: bytes
Server: Microsoft-IIS/7.0
XAspNetVersion: 2.0.50727
XPoweredBy: ASP.NET
Date: Fri, 14 Nov 2008 13:59:00 GMT
Connection: close
HeaderEnd: CRLF
+ payload: HttpContentType = video/x-ms-wmv

It is odd you have such a hard time reproducing the issue. I have several
computers here with a total of 4 browsers (FF2, FF3, IE6, IE7) and the only
place it works is with IE7.

Roger
Nov 14 '08 #5
Thanks Bruce. I just discovered that if I modify my handler to use WriteFile,
it works:

FileInfo fi = new FileInfo(filePa th);
context.Respons e.WriteFile(fil ePath, false);

However, this is not a long term solution because WriteFile has issues with
large files (http://support.microsoft.com/kb/812406). I need a reliable way
to send files to the user that won't overwhelm the server's memory; that's
why I was using a chunked approach.

There is nothing about a range in the request header:
Frame: Number = 433, Captured Frame Length = 1027, MediaType = ETHERNET
+ Ethernet: Etype = Internet IP
(IPv4),Destinat ionAddress:[00-06-25-7F-45-9D],SourceAddress:[00-16-E6-8F-5E-9E]
+ Ipv4: Src = 192.168.1.102, Dest = 209.67.188.9, Next Protocol = TCP,
Packet ID = 31490, Total IP Length = 1013
+ Tcp: [ReTransmit #430]Flags=...AP..., SrcPort=63247, DstPort=HTTP(80 ),
PayloadLen=973, Seq=233417161 - 233418134, Ack=3634901546, Win=65535 (scale
factor 0x0) = 65535
- Http: Request, GET /dev/webapp2/handler/getmediaobject. ashx
Command: GET
- URI: /dev/webapp2/handler/getmediaobject. ashx
Location: /dev/webapp2/handler/getmediaobject. ashx
ProtocolVersion : HTTP/1.1
Host: www.galleryserverpro.com
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.4)
Gecko/2008102920 Firefox/3.0.4 (.NET CLR 3.5.30729)
Accept: text/html,applicatio n/xhtml+xml,appli cation/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,nl;q=0.8,en; q=0.5,de-ch;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie:
__utma=5214629. 416852696800040 3000.1223864238 .1226617001.122 6628470.137;
__utmz=5214629. 1226167175.107. 5.utmcsr=linked in.com|utmccn=( referral)|utmcm d=referral|utmc ct=/myprofile;
..ASPXANONYMOUS =ZqP1ljp8yQEkAA AAYTU1MmI2ODktM GI1Yy00Zjg3LTkz YTItMDlhMjdkN
HeaderEnd: CRLF

Given that it works using WriteFile and that there is no range in the
request, do you think I still need to add range support? I am doubtful but I
admit I am at the limits of my knowledge. Perhaps there is just a problem
with my chunking algorithm (see earlier for the code). I did a quick search
on adding range support in a handler but couldn't find anything - I don't
have a clue how I might do this.

Roger

"bruce barker" wrote:
you actually have to add Range support to your handler, not just say you
have it and ignore the range requests. look at the request to see if
it has a range specified. a range specifies a offset and a length of
bytes to return. that is you don't stream the whole file per request,
just the bytes requested.

ie7 is probably precaching the video (maybe a bug).
Nov 14 '08 #6
Roger, just now 9:35ish am CST I was able to begin playback by clicking into
the viewport...
http://www.galleryserverpro.com/dev/webapp2/video2.aspx

"Roger Martin" <rd******@commu nity.nospamwrot e in message
news:E5******** *************** ***********@mic rosoft.com...
Thanks Bruce. I just discovered that if I modify my handler to use
WriteFile,
it works:

FileInfo fi = new FileInfo(filePa th);
context.Respons e.WriteFile(fil ePath, false);

However, this is not a long term solution because WriteFile has issues
with
large files (http://support.microsoft.com/kb/812406). I need a reliable
way
to send files to the user that won't overwhelm the server's memory; that's
why I was using a chunked approach.

There is nothing about a range in the request header:
Frame: Number = 433, Captured Frame Length = 1027, MediaType = ETHERNET
+ Ethernet: Etype = Internet IP
(IPv4),Destinat ionAddress:[00-06-25-7F-45-9D],SourceAddress:[00-16-E6-8F-5E-9E]
+ Ipv4: Src = 192.168.1.102, Dest = 209.67.188.9, Next Protocol = TCP,
Packet ID = 31490, Total IP Length = 1013
+ Tcp: [ReTransmit #430]Flags=...AP..., SrcPort=63247, DstPort=HTTP(80 ),
PayloadLen=973, Seq=233417161 - 233418134, Ack=3634901546, Win=65535
(scale
factor 0x0) = 65535
- Http: Request, GET /dev/webapp2/handler/getmediaobject. ashx
Command: GET
- URI: /dev/webapp2/handler/getmediaobject. ashx
Location: /dev/webapp2/handler/getmediaobject. ashx
ProtocolVersion : HTTP/1.1
Host: www.galleryserverpro.com
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.4)
Gecko/2008102920 Firefox/3.0.4 (.NET CLR 3.5.30729)
Accept:
text/html,applicatio n/xhtml+xml,appli cation/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,nl;q=0.8,en; q=0.5,de-ch;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie:
__utma=5214629. 416852696800040 3000.1223864238 .1226617001.122 6628470.137;
__utmz=5214629. 1226167175.107. 5.utmcsr=linked in.com|utmccn=( referral)|utmcm d=referral|utmc ct=/myprofile;
.ASPXANONYMOUS= ZqP1ljp8yQEkAAA AYTU1MmI2ODktMG I1Yy00Zjg3LTkzY TItMDlhMjdkN
HeaderEnd: CRLF

Given that it works using WriteFile and that there is no range in the
request, do you think I still need to add range support? I am doubtful but
I
admit I am at the limits of my knowledge. Perhaps there is just a problem
with my chunking algorithm (see earlier for the code). I did a quick
search
on adding range support in a handler but couldn't find anything - I don't
have a clue how I might do this.

Roger

"bruce barker" wrote:
>you actually have to add Range support to your handler, not just say you
have it and ignore the range requests. look at the request to see if
it has a range specified. a range specifies a offset and a length of
bytes to return. that is you don't stream the whole file per request,
just the bytes requested.

ie7 is probably precaching the video (maybe a bug).
Nov 14 '08 #7
Yes, that works for me, too. The problem is when you try to reposition the
slider either before playing or anytime after. Doing so causes the video to
be unplayable.

"Hillbilly" wrote:
Roger, just now 9:35ish am CST I was able to begin playback by clicking into
the viewport...
http://www.galleryserverpro.com/dev/webapp2/video2.aspx
Nov 14 '08 #8
adding range support is easy. see the w3c http 1.1 spec for particulars. I
don't see how any streaming service could work reliably without range
support.

also be sure to turn buffering off.

-- bruce (sqlwork.com)
"Roger Martin" wrote:
Thanks Bruce. I just discovered that if I modify my handler to use WriteFile,
it works:

FileInfo fi = new FileInfo(filePa th);
context.Respons e.WriteFile(fil ePath, false);

However, this is not a long term solution because WriteFile has issues with
large files (http://support.microsoft.com/kb/812406). I need a reliable way
to send files to the user that won't overwhelm the server's memory; that's
why I was using a chunked approach.

There is nothing about a range in the request header:
Frame: Number = 433, Captured Frame Length = 1027, MediaType = ETHERNET
+ Ethernet: Etype = Internet IP
(IPv4),Destinat ionAddress:[00-06-25-7F-45-9D],SourceAddress:[00-16-E6-8F-5E-9E]
+ Ipv4: Src = 192.168.1.102, Dest = 209.67.188.9, Next Protocol = TCP,
Packet ID = 31490, Total IP Length = 1013
+ Tcp: [ReTransmit #430]Flags=...AP..., SrcPort=63247, DstPort=HTTP(80 ),
PayloadLen=973, Seq=233417161 - 233418134, Ack=3634901546, Win=65535 (scale
factor 0x0) = 65535
- Http: Request, GET /dev/webapp2/handler/getmediaobject. ashx
Command: GET
- URI: /dev/webapp2/handler/getmediaobject. ashx
Location: /dev/webapp2/handler/getmediaobject. ashx
ProtocolVersion : HTTP/1.1
Host: www.galleryserverpro.com
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.4)
Gecko/2008102920 Firefox/3.0.4 (.NET CLR 3.5.30729)
Accept: text/html,applicatio n/xhtml+xml,appli cation/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,nl;q=0.8,en; q=0.5,de-ch;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie:
__utma=5214629. 416852696800040 3000.1223864238 .1226617001.122 6628470.137;
__utmz=5214629. 1226167175.107. 5.utmcsr=linked in.com|utmccn=( referral)|utmcm d=referral|utmc ct=/myprofile;
.ASPXANONYMOUS= ZqP1ljp8yQEkAAA AYTU1MmI2ODktMG I1Yy00Zjg3LTkzY TItMDlhMjdkN
HeaderEnd: CRLF

Given that it works using WriteFile and that there is no range in the
request, do you think I still need to add range support? I am doubtful but I
admit I am at the limits of my knowledge. Perhaps there is just a problem
with my chunking algorithm (see earlier for the code). I did a quick search
on adding range support in a handler but couldn't find anything - I don't
have a clue how I might do this.

Roger

"bruce barker" wrote:
you actually have to add Range support to your handler, not just say you
have it and ignore the range requests. look at the request to see if
it has a range specified. a range specifies a offset and a length of
bytes to return. that is you don't stream the whole file per request,
just the bytes requested.

ie7 is probably precaching the video (maybe a bug).
Nov 14 '08 #9
Buffering is already turned off, as you can see in the code I posted.

I am pretty sure that adding range functionality won't solve the issue. Note
that I am not actually streaming the video, in the strict definition of
streaming. I am simply transmitting a file, and Silverlight has the
capability to begin playing the video when it has buffered enough of the
downloaded video. Ranges are not used anywhere in the request or response,
even in the examples that work.

As I said before, you can see for yourself by looking at my examples.

If knew how to easily add range functionality, I would do it just to see.
But it is not at all clear (at least to me) how to do it based on the spec
(http://www.w3.org/Protocols/rfc2616/rfc2616.html).

Roger

"bruce barker" wrote:
adding range support is easy. see the w3c http 1.1 spec for particulars. I
don't see how any streaming service could work reliably without range
support.

also be sure to turn buffering off.
Nov 14 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
5478
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
0
944
by: kcamhi | last post by:
Is there a way in either windows media player object or directshow (or other) to play a very specific subset of a video file? I have a single video file that I'll load that has a bunch of segments that I want to be able to jump to in reaction to different events and play from a specific frame to another specific frame. Is there any way to do that in WMP? Or if not does Directshow or another method support this?
2
7892
by: hzgt9b | last post by:
Using VS2003, VB.NET, BACKGROUND I have a window forms based application that will be distributed and executed directly from CD media. The app contains a TreeView control and a WebBroswer (AxSHDocVw.AxWebBrowse) control. The TreeView is populated with nodes that when clicked play an audio clip that is stored on the CD and navigate the browser control to a specified web URL (also stored on the CD). All the web URLs are html documents...
4
1876
by: Ronald S. Cook | last post by:
I'm a Visual Studio developer confused by seeing these new products coming out... Expression and Silverlight. Is Expression maybe a successor to FrontPage and is Silverlight maybe something to compete with Flash? Are Visual Studio, Expression, and Silverlight expected to exists together (and in some sort of harmony) in a development shop, or is something else going on.
1
2859
by: Faisal Shafiq | last post by:
I want to upload a file direct to the Silverlight Streaming Service from a Web Client such as silverlight application. As per our product requirement we want to upload a .WMV file directly from silverlight client to Silverlight streaming service. I tried to user WebClient and HttpWebRequest for that purpose but, unfortunately I can found the way to do so. There are some problems with both classes. 1. There is no property of get...
3
3546
by: AliR \(VC++ MVP\) | last post by:
Hi Everyone, I have written a silverlight application, which talks to a WCF service, which was created within the website after watching this video: http://silverlight.net/learn/learnvideo.aspx?video=47177 The service gathers some data using a class library. This all works fine within Visual Studio, but when published to a web server it throws an excpetion, in the first xxxxServiceComplete call back, which
3
8650
by: pavanip | last post by:
Hi, I am new to Silverlight application.I want to display video using Mediaelement tag and I used the below code to play video. <Canvas> <MediaElement x:Name="mPlayer" Width="640" Height="480" Source="a_video.avi"/> <Button x:Name="bPlay" Background="Green" Width="100" Height="45" Canvas.Left="8" Canvas.Top="497" Content="Play" /> <Button x:Name="bPause" Background="Yellow" Width="100" Height="45"...
0
1645
by: pavanip | last post by:
Hi, I am new to Silverlight Applications. I created one media player control to play video in asp.net website.I want to drag and drop that media player control to desired place when we run the application but there are no events to drag and drop the video. I tried media element control its working fine for drag and drop functionality but i want that feature in media player control. Is there any other alternatives to drag and drop videos to...
0
9844
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9819
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8688
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7226
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6514
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5119
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5289
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3780
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2647
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.