public void LoadVideoClip()
    {
        try
        {
            string         FileExt        = "";
            string         FileVideoSrc   = "";
            string         FileVideoImage = "";
            string         Lang           = Globals.GetLang();
            OtherFunctions obj            = new OtherFunctions();
            if (_isAgentCat)
            {
                _agentCatID = Globals.AgentCatID;
            }
            //DataSet ds = obj.GetFirstVideo("VideoProduct", _agentCatID, Lang);
            //DataRow dr = ds.Tables[0].Rows[0];
            DataRow dr = obj.GetRandomVideo("VideoProduct", Globals.AgentCatID, Lang);

            if (dr != null && dr.Table.Rows.Count > 0)
            {
                FileExt        = Convert.ToString(dr["FileExt"]);
                FileVideoSrc   = Convert.ToString(dr["VideoSrc"]);
                FileVideoImage = Convert.ToString(dr["VideoImage"]);
                //if (FileExt.ToLower() == "wmv") //vì wmv dùng control khác nên chỉ ra file video wmv để play
                //MyVideo.FilePath = Globals.GetUploadsUrl() + FileVideoSrc;
            }
            Response.Write("<div class=\"hot-video\">");
            Response.Write("<div class=\"video-player\">");
            if (FileExt == "flv")
            {
                Response.Write(VideoHelper.LoadFlvVideo(FileVideoSrc, FileVideoImage, _widthBox, _heightBox));
            }
            Response.Write("</div>");
            Response.Write("</div>");

            /*Response.Write("<div class=\"title_box\">" + _subject + "</div>");
             * Response.Write("<div class=\"border_box\">");
             * if (FileExt == "flv")
             *  Response.Write(VideoHelper.LoadFlvVideo(FileVideoSrc, FileVideoImage, _widthBox, _heightBox));
             * Response.Write("</div>");*/
        }
        catch { }
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string Lang = Globals.GetLang();

        try
        {
            if (!IsPostBack)
            {
                int            VideoID = Globals.GetIntFromQueryString("VideoID");
                OtherFunctions obj     = new OtherFunctions();
                DataRow        dr;
                if (VideoID != -1)
                {
                    dr = obj.GetVideoByVideoID("VideoProduct", VideoID).Tables[0].Rows[0];
                }
                else
                {
                    dr = obj.GetRandomVideo("VideoProduct", Globals.AgentCatID, Lang);
                }

                if (Convert.ToString(dr["VideoName"]) != "")
                {
                    lblTitle.InnerText = " - " + Convert.ToString(dr["VideoName"]);
                }
                FileExt        = Convert.ToString(dr["FileExt"]);
                FileVideoSrc   = Convert.ToString(dr["VideoSrc"]);
                FileVideoImage = Convert.ToString(dr["VideoImage"]);
                if (FileExt.ToLower() == "wmv") //vì wmv dùng control khác nên chỉ ra file video wmv để play
                {
                    MyVideo.FilePath = Globals.GetUploadsUrl() + "VideoFiles/" + FileVideoSrc;
                }
            }
        }
        catch
        {
            Response.Redirect("VideoClip.aspx?Lang=" + Lang);
        }
    }