Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3393200
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:01:21+00:00 2026-05-18T04:01:21+00:00

Is there a good way to stream video through asp.net to a normal webpage

  • 0

Is there a good way to stream video through asp.net to a normal webpage and mobile? I’ve tried the following but it doesn’t work in my Sony Ericsson K810i. When I try it in my browser, I can see the clip (don’t know if it’s streaming though).

html:

<object type="video/3gpp" 
        data="handlers/FileHandler.ashx" 
        id="player" 
        width="176" 
        height="148" 
        autoplay="true"></object>

FileHandler.ashx (Best way to stream files in ASP.NET):

public void ProcessRequest (HttpContext context) {

    string path = "~/files/do.3gp";

    string localPath = context.Server.MapPath(path);

    if (!File.Exists(localPath))
    {
        return;
    }

    // get info about contenttype etc 
    FileInfo fileInfo = new FileInfo(localPath);
    int len = (int)fileInfo.Length;
    context.Response.AppendHeader("content-length", len.ToString());
    context.Response.ContentType = FileHelper.GetMimeType(fileInfo.Name); // returns video/3gpp

    // stream file
    byte[] buffer = new byte[1 << 16]; // 64kb
    int bytesRead = 0;
    using(var file = File.Open(localPath, FileMode.Open))
    {
       while((bytesRead = file.Read(buffer, 0, buffer.Length)) != 0)
       {
            context.Response.OutputStream.Write(buffer, 0, bytesRead);
       }
    }

    // finish
    context.Response.Flush();
    context.Response.Close();
    context.Response.End();

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:01:21+00:00Added an answer on May 18, 2026 at 4:01 am

    What you’ve got isn’t “technically” streaming. It’s a file download. Your client (browser/phone) sent an HTTP request and your FileHandler.ashx opened the file and wrote the bytes into the response stream. This is exactly the same interaction for a web page request except the data is html text rather than binary data representing a video.

    If the phone isn’t supporting the video it might be incompatible encoding. If you’re sure the video is playable by the phone, see if the phone wants progressive download support (like the iPhone / iPad / iPod Touch require for the media player to “stream” videos.) If this is so, you’ll need to look at any of a number of solutions that are available for handling requests for byte-range data and responding to the request with the bytes from the file in the range specified.

    I wrote a library for ASP.NET MVC to handle this and my work was mostly done based on this guidance and source code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any good way to deal with the class renaming refactor from Resharper
Is there a good way for displaying unicode text in opengl under Windows? For
Is there a good way to create a form in VB6 that can easily
Is there a good way to see what format an image is, without having
Is there a good way to find out which exceptions a procedure/function can raise
Is there a good way to time SQL queries when using Linq to SQL?
Is there a good way to read RAW image files (especially Canon CR2 and
Is there a good way to add a .swf programatically to a panel on
Is there a good way to determine if a person has a popup blocker
Is there any good way to convert strings like xlSum, xlAverage, and xlCount into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.