Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi,
I am presently working on mobile site.That mobile site will play the videos and audio files on web site using .net.My task is play the files with out flash player.

If You know any solution for my question,Please share the answer for me.


Thanks in Advance.
Posted
Comments
Dholakiya Ankit 8-Jul-13 6:07am    
you should use dll for that one without flash player there is vimeo also try to find some inbuilt dlls on gooooooooooooogle.

 
Share this answer
 
Try this....:)

1)VideoPlay.aspx

C#
<html xmlns="http://www.w3.org/1999/xhtml">
<head  runat="server">
    <title></title>
</head>
<body>
    <form id="form1"  runat="server">
    <div>
    <table style="width: 400px;" border="0" cellpadding="2" cellspacing="3">
        <tr>
            <td style="width: 150px;" valign="top">
            </td>
            <td style="width: 200px;" valign="top" align="left">
                <asp:label id="lblMsg" cssclass="tdMessage" text="" runat="server" xmlns:asp="#unknown"></asp:label>
            </td>
        </tr>
        <tr>
            <td class="tdText" valign="top" align="left">
                <nobr> Select a file</nobr>
            </td>
            <td style="text-align: left;" valign="top">
                <asp:fileupload id="fUpload" runat="server" width="300px" xmlns:asp="#unknown"></asp:fileupload>
            </td>
        </tr>
        <tr>
            <td valign="top" align="left">
                <asp:button id="btnUpload" runat="server" text="Upload" onclick="btnUpload_Click" xmlns:asp="#unknown">
                </asp:button>
            </td>
            <td valign="top" align="left">
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0">
                    width="200" height="100">
                    <param name="movie" value="<% =swfFileName%>">
                    <param name="quality" value="high">
                    <embed src="<%=swfFileName%>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer">
                        type="application/x-shockwave-flash" width="200" height="100">
                </embed></param></param></object>
            </td>
        </tr>
    </table>
    </div>
    </form>
</body>
</html>


2)VideoPlay.aspx.cs

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
 
namespace VideoDemo
{
    public partial class VDemo : System.Web.UI.Page
    {
        public string swfFileName;
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
        protected void btnUpload_Click(object sender, EventArgs e)
     {
        if (fUpload.FileContent.Length >0 && IsVaildFile())
        {
            string Path = GetUplaodImagePhysicalPath();
            DirectoryInfo dirUploadImage = new DirectoryInfo(Path);
            if (dirUploadImage.Exists == false)
            {
                dirUploadImage.Create();
            }
            string fileUrl = Path + fUpload.PostedFile.FileName;
            fUpload.PostedFile.SaveAs(fileUrl);
            swfFileName = "images/" + fUpload.PostedFile.FileName;
        }
    }
    private bool IsVaildFile()
    {
        string swfExt = System.IO.Path.GetExtension(fUpload.PostedFile.FileName);
        switch (swfExt)
        {
            case ".swf":
                return true;
            default:
            {
                    lblMsg.Text = "Please select only swf file.";
                    return false;
            }
        }
    }
 

    
    string GetUplaodImagePhysicalPath()
    {
        return System.Web.HttpContext.Current.Request.PhysicalApplicationPath + "images\\";
    }
  
} 
    
}
 
Share this answer
 
Use Video tag if you using html5
ex:
HTML
<html>
<body>

<video width="300" height="250" controls="">
  <source src="mymovie.mp4" type="video/mp4">
  <source src="mymovie.ogg" type="video/ogg">
  Your browser does not support the video tag.
</source></source></video>

</body>
</html>
 
Share this answer
 
v2
Hi...
am used for audio and video playing with in literal using asp.net.
how to upload and play video into database..
Thank u.
 
Share this answer
 
v4

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