Cannot jump to new part of Silverlight video when using handler

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Um9nZXIgTWFydGlu?=

    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
  • bruce barker

    #2
    Re: Cannot jump to new part of Silverlight video when using handler

    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

    Comment

    • Allen Chen [MSFT]

      #3
      RE: Cannot jump to new part of Silverlight video when using handler

      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:


      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:
      msdnmg@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

      =============== =============== =============== =====
      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?= <rdmartin@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: <8F24EAA1-3E75-4BE0-952A-30E5402F2862@mi crosoft.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
      |

      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
      |

      Comment

      • =?Utf-8?B?Um9nZXIgTWFydGlu?=

        #4
        RE: Cannot jump to new part of Silverlight video when using handle

        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

        Comment

        • bruce barker

          #5
          Re: Cannot jump to new part of Silverlight video when using handle

          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

          Comment

          • =?Utf-8?B?Um9nZXIgTWFydGlu?=

            #6
            Re: Cannot jump to new part of Silverlight video when using handle

            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).

            Comment

            • Hillbilly

              #7
              Re: Cannot jump to new part of Silverlight video when using handle

              Roger, just now 9:35ish am CST I was able to begin playback by clicking into
              the viewport...
              Gallery Server is a Digital Asset Management and Media Gallery application for sharing and managing photos, videos, audio, and other files over the web.




              "Roger Martin" <rdmartin@commu nity.nospamwrot e in message
              news:E556377A-B380-4287-AAD5-2F4096B38882@mi crosoft.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).
              >

              Comment

              • =?Utf-8?B?Um9nZXIgTWFydGlu?=

                #8
                Re: Cannot jump to new part of Silverlight video when using handle

                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

                Comment

                • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

                  #9
                  Re: Cannot jump to new part of Silverlight video when using handle

                  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).
                  >

                  Comment

                  • =?Utf-8?B?Um9nZXIgTWFydGlu?=

                    #10
                    Re: Cannot jump to new part of Silverlight video when using handle

                    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.

                    Comment

                    • Allen Chen [MSFT]

                      #11
                      Re: Cannot jump to new part of Silverlight video when using handle

                      Hi Roger,

                      Today I tested this page
                      Gallery Server is a Digital Asset Management and Media Gallery application for sharing and managing photos, videos, audio, and other files over the web.


                      on the following machines:

                      Windows Server 2008 Enterprise SP1 64 bit + FireFox 3.0.3
                      Windows XP SP2 + FireFox 2.0.0.18
                      Winodws Server 2003 Enterprise SP2 32 bit + FireFox 3.0.4
                      Windows Server 2008 Standard SP1 64 bit + FireFox 3.0.4
                      Windows XP SP3 + IE 6.0.2900.5512

                      However, I cannot reproduce this issue. Bruce, can you reproduce this issue
                      on your side?
                      I'll update here if I find a machine that can repro it.

                      Regards,
                      Allen Chen
                      Microsoft Online Support

                      --------------------
                      | Thread-Topic: Cannot jump to new part of Silverlight video when using
                      handle
                      | thread-index: AclGfp9QM5BIKWG VRvyn/OKGRjmjaw==
                      | From: =?Utf-8?B?Um9nZXIgTWF ydGlu?= <rdmartin@commu nity.nospam>
                      | References: <8F24EAA1-3E75-4BE0-952A-30E5402F2862@mi crosoft.com>
                      <lquYDhiRJHA.48 04@TK2MSFTNGHUB 02.phx.gbl>
                      <75EAAFF5-8456-486E-81C3-3872575FBFFF@mi crosoft.com>
                      <O$qN5amRJHA.11 44@TK2MSFTNGP05 .phx.gbl>
                      <E556377A-B380-4287-AAD5-2F4096B38882@mi crosoft.com>
                      <7283E5F0-E24B-4D0A-911C-68016E7A31EB@mi crosoft.com>
                      | Subject: Re: Cannot jump to new part of Silverlight video when using
                      handle
                      | Date: Fri, 14 Nov 2008 09:30:01 -0800
                      | Lines: 24
                      | Message-ID: <0EFE3CA7-E701-44F3-98B6-ED32B13E3B09@mi crosoft.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:7989 9
                      | NNTP-Posting-Host: tk2msftibfm01.p hx.gbl 10.40.244.149
                      | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
                      |
                      | 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.
                      |

                      Comment

                      • =?Utf-8?B?Um9nZXIgTWFydGlu?=

                        #12
                        Re: Cannot jump to new part of Silverlight video when using handle

                        I appreciate your effort in trying to repro it. Just to be clear, here are
                        the steps:

                        1. Load the page http://www.galleryserverpro.com/dev/webapp2/video2.aspx.
                        2. Wait for the video to download (the progress bar goes all the way to the
                        right).
                        3. Using the mouse, click the position indicator and drag to a new position.
                        Release the mouse button.
                        4. A set of circles will rotate around the number zero in the center of the
                        video.

                        At this point the video will not run when you click play. (In my tests, the
                        only browser where it *does* work is IE7.)

                        Thanks for your persistence, Allen.

                        Roger

                        "Allen Chen [MSFT]" wrote:
                        Hi Roger,
                        >
                        Today I tested this page
                        Gallery Server is a Digital Asset Management and Media Gallery application for sharing and managing photos, videos, audio, and other files over the web.

                        >
                        on the following machines:
                        >
                        Windows Server 2008 Enterprise SP1 64 bit + FireFox 3.0.3
                        Windows XP SP2 + FireFox 2.0.0.18
                        Winodws Server 2003 Enterprise SP2 32 bit + FireFox 3.0.4
                        Windows Server 2008 Standard SP1 64 bit + FireFox 3.0.4
                        Windows XP SP3 + IE 6.0.2900.5512
                        >
                        However, I cannot reproduce this issue. Bruce, can you reproduce this issue
                        on your side?
                        I'll update here if I find a machine that can repro it.
                        >
                        Regards,
                        Allen Chen
                        Microsoft Online Support

                        Comment

                        • Allen Chen [MSFT]

                          #13
                          Re: Cannot jump to new part of Silverlight video when using handle

                          Hi Roger,

                          I followed exactly the same steps as you mentioned but still cannot
                          reproduce this issue. It's really strange. Could you outline all the
                          machines and browsers that you have tested? Maybe we can find some clues
                          from it. (Please provide the detailed information, such as Windows Server
                          2008 Enterprise SP1 64 bit + FireFox 3.0.3)

                          In addition, please run Network Monitor on the working machine and the
                          non-working machine. Then track the frame of the response of the ashx. Can
                          you find any differences?

                          Regards,
                          Allen Chen
                          Microsoft Online Community Support

                          Comment

                          • Allen Chen [MSFT]

                            #14
                            Re: Cannot jump to new part of Silverlight video when using handle

                            Hi Roger,

                            Do you have any progress on this issue? Can you get any clues with the help
                            of Network Monitor?

                            Regards,
                            Allen Chen
                            Microsoft Online Community Support

                            Comment

                            Working...