Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HTML
<object width="100%" height="100%" id="gsp_player_api" data="Players/flowplayer-3.2.5.swf"
  type="application/x-shockwave-flash">
 <param name="allowfullscreen" value="true">
 <param name="allowscriptaccess" value="always">
 <param name="quality" value="high">
 <param name="cachebusting" value="false">
 <param name="bgcolor" value="#000000">
 <param name="wmode" value="opaque">
  <param name="flashvars" value='config={"clip":{"autoPlay":true,"scaling":"fit","url":"VideoHandler.ashx?imgID=2"},"playerId":"gsp_player","playlist":[{"autoPlay":true,"scaling":"fit","url":"VideoHandler.ashx?imgID=2"}]}'>
  </object>


C#
<%@ WebHandler Language="C#" Class="VideoHandler" %>

using System;
using System.Web;
using System.Data.SqlClient;
using System.Data;

public class VideoHandler : IHttpHandler {
    Class1 objcls = new Class1();
    public void ProcessRequest (HttpContext context) {
        string imageId = context.Request.QueryString["imgID"];
        SqlDataReader dr = objcls.SP_GET_VIDEO_BY_ID(imageId);
        if (dr.HasRows)
        {
            while (dr.Read())
            {

                context.Response.BinaryWrite((byte[])dr["VIDEO"]);
              
                context.Response.Flush();
            }
         context.Response.End();
        }
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}

Error

200, Stream not found, NetStream.Play.StreamNotFound, clip: "[Clip]"http://localhost:6259/VideoHandler.ashx?imgID=2"
Posted
Updated 22-Feb-13 18:14pm
v2

1 solution

The working code will be
XML
<object id="flowplayer" data="flowplayer-3.2.2.swf" type="application/x-shockwave-flash" width="320" height="240" >
    <param name="movie" value="flowplayer-3.2.2.swf">
    <param name="allowfullscreen" value="true">
    <param name="flashvars" value="config={'clip':{'url':'mymovie.mp4','autoPlay':false}}">
</object>


your url propery value is VideoHandler.ashx. If so then in your local host server http://localhost:6259" should have that ashx file and it should write video stream to Httpresponse object.
 
Share this answer
 
Comments
Member-515487 23-Feb-13 0:16am    
see i have uploaded my ashx file
n mymovie.mp4 it will work proper but when i am tring to use with ashx binary output write not working properly

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900