Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
This is my code but not working:
XML
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="~/FlowPlayer/flowplayer-3.2.12.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        flowplayer("a.player", "/FlowPlayer/flowplayer-3.2.16.swf", {
            plugins: {
                pseudo: { url: "/FlowPlayer/flowplayer.pseudostreaming-3.2.12.swf" }
            },
            clip: { provider: 'pseudo', autoPlay: false }
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <hr />
    <asp:DataList ID="DataList1" Visible="true" runat="server" AutoGenerateColumns="false"
        RepeatColumns="2" CellSpacing="2" Height="225px" Width="590px" CellPadding="1">
        <ItemTemplate>
            <u>
                <%# Eval("Name") %></u>
            <hr />
            <a class="player" style="height: 200px; width: 300px; display: block" href='<%# Eval("id", "FileCS.ashx?Id={0}") %>'>
            </a>
        </ItemTemplate>
    </asp:DataList>
</asp:Content>

i am linked all the flowplayer files but not working it only download the video
not playing please help me .........
Posted
Comments
F-ES Sitecore 27-Mar-15 8:13am    
Possible problems are

a) you're just not using it correctly, try and get the sample code from their site up and running and then adapt it to what you need

b) your ashx handler isn't returning a video file - you haven't posted the handler so it's hard to know

c) the flowplayer is coded to only process known extensions such as mp4 etc and as yours is ashx it is ignoring it. If that is the case you might need to implement a custom handler to push your video out that is mapped to /myfile.mp4 so that your handler code is executed when the myfile.mp4 is requested.
Sinisa Hajnal 27-Mar-15 8:13am    
Something in your FileCS.ashx doesn't work properly? Try using constact hardcoded path and see if it works and work from there. If it doesn't work from path, check access rights. Track requests with Developer tools, see if there is some problem with paths etc...you know. Debug
thamil arasan 27-Mar-15 8:41am    
This is my Filecs.ashx
<%@ WebHandler Language="C#" Class="FileCS" %>

using System;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;
public class FileCS : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
int id = int.Parse(context.Request.QueryString["id"]);
byte[] bytes;
string contentType;
string strConnString = ConfigurationManager.ConnectionStrings["VCRConnectionString"].ConnectionString;
string name;
using (SqlConnection con = new SqlConnection(strConnString))
{
using (SqlCommand cmd = new SqlCommand())
{
cmd.CommandText = "select Name, Data, ContentType from Videos1 where id=@Id";
cmd.Parameters.AddWithValue("@Id", id);
cmd.Connection = con;
con.Open();
SqlDataReader sdr = cmd.ExecuteReader();
sdr.Read();
bytes = (byte[])sdr["Data"];
contentType = sdr["ContentType"].ToString();
name = sdr["Name"].ToString();
con.Close();
}
}
context.Response.Clear();
context.Response.Buffer = true;
context.Response.AppendHeader("Content-Disposition", "attachment; filename=" + name);
context.Response.ContentType = contentType;
context.Response.BinaryWrite(bytes);
context.Response.End();
}

public bool IsReusable
{
get
{
return false;
}
}
}
Sinisa Hajnal 27-Mar-15 9:31am    
Please use Improve question and move this code into the question. Thank you.

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