Esempio n. 1
0
        protected string LoadSelectedBackgroundMusic()
        {
            DataTable  dt        = new DataTable();
            MediaFiles media_obj = new MediaFiles();

            dt = media_obj.GetSelectedItem(1);
            string result = string.Empty;

            if (dt.Rows.Count > 0)
            {
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.AppendLine("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0\"  width=\"15\" height=\"15\">");
                sb.AppendLine("<param name=\"movie\" value=\"../../scripts/plugins/audioplay_0.9.9/audioplay.swf?file=../../user_files/media/audio/background_audio/" + dt.Rows[0]["FileName"].ToString() + "&buttondir=../../scripts/plugins/audioplay_0.9.9/buttons/negative_small&mode=playpause&auto=no&listenstop=yes&sendstop=yes&repeat=0&mastervol=5&bgcolor=0xffffff\">");
                sb.AppendLine("<param name=\"quality\" value=\"high\">");
                sb.AppendLine("<param name=\"wmode\" value=\"transparent\">");
                sb.AppendLine("<param name=\"allowscriptaccess\" value=\"always\">");
                sb.AppendLine("<embed src=\"../../scripts/plugins/audioplay_0.9.9/audioplay.swf?file=../../user_files/media/audio/background_audio/" + dt.Rows[0]["FileName"].ToString() + "&buttondir=../../scripts/plugins/audioplay_0.9.9/buttons/negative_small&mode=playpause&auto=no&listenstop=yes&sendstop=yes&repeat=0&mastervol=5&bgcolor=0xffffff\" quality=\"high\" wmode=\"transparent\" width=\"15\" height=\"15\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>");
                sb.AppendLine("</object>");

                result = sb.ToString();
            }
            else
            {
                result = "";
            }
            return(result);
        }
        protected void LoadSelectedBackgroundMusic()
        {
            MediaFiles media_obj = new MediaFiles();
            DataTable dt = new DataTable();
            dt = media_obj.GetSelectedItem(1);
            string result = string.Empty;
            if (dt.Rows.Count > 0)
            {
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append("<object type=\"application/x-shockwave-flash\" data=\"../../../scripts/plugins/dewplayer/dewplayer-vol.swf?mp3=../../../user_files/multimedia/audio/background_audio/" + dt.Rows[0]["FileName"].ToString() + "\" width=\"240\" height=\"20\" id=\"dewplayer-vol\"><param name=\"wmode\" value=\"transparent\" /><param name=\"movie\" value=\"../../../scripts/plugins/dewplayer/dewplayer-vol.swf?mp3=../../../user_files/multimedia/audio/background_audio/" + dt.Rows[0]["FileName"].ToString() + "\" /></object>");
                result = sb.ToString();
            }
            else
            {
                result = "Không có ";
            }

            Ltr_SeletedItem.Text = result;
        }
Esempio n. 3
0
        public string[] GetSelectedVideo()
        {
            Uri    requestUri = Context.Request.Url;
            string baseUrl    = requestUri.Scheme + Uri.SchemeDelimiter + requestUri.Host + (requestUri.IsDefaultPort ? "" : ":" + requestUri.Port);
            int    typeid     = 2;
            //====MediaType=================================================================
            MediaTypes  media_type_obj = new MediaTypes();
            Media_Types type_obj       = media_type_obj.GetDetails(typeid);
            string      TypePath       = type_obj.TypePath;
            //==============================================================================
            int    FileId    = 0;
            string Title     = string.Empty;
            string FileName  = string.Empty;
            string FileUrl   = string.Empty;
            string Photo     = string.Empty;
            string Thumbnail = string.Empty;
            string file_path = string.Empty;

            string _path          = baseUrl + "/" + TypePath + "/";
            string dir_image_path = System.Configuration.ConfigurationManager.AppSettings["upload_media_image_dir"];
            string image          = "";

            string[] array_list = new string[3];

            MediaFiles media_obj = new MediaFiles();
            DataTable  dtMedia   = media_obj.GetSelectedItem(typeid);

            for (int i = 0; i < dtMedia.Rows.Count; i++)
            {
                FileId    = Convert.ToInt32(dtMedia.Rows[i]["FileId"].ToString());
                Title     = dtMedia.Rows[i]["Title"].ToString();
                FileName  = dtMedia.Rows[i]["FileName"].ToString();
                FileUrl   = dtMedia.Rows[i]["FileUrl"].ToString();
                Photo     = dtMedia.Rows[i]["Photo"].ToString();
                Thumbnail = dtMedia.Rows[i]["Photo"].ToString();

                file_path = _path + FileName;

                if (Photo != string.Empty)
                {
                    image = baseUrl + "/" + dir_image_path + "/photo/" + Photo;
                }
                if (Photo == string.Empty)
                {
                    image = baseUrl + "/" + dir_image_path + "/thumbnails/" + Thumbnail;
                }
                if (Photo == string.Empty && Thumbnail == string.Empty)
                {
                    image = baseUrl + "/images/no_image.jpg";
                }

                array_list[0] = array_list[0] + "," + Title;
                if (FileName != string.Empty && FileUrl == string.Empty)
                {
                    array_list[1] = array_list[1] + "," + file_path;
                }
                else
                {
                    array_list[1] = array_list[1] + "," + FileUrl;
                }
                array_list[2] = array_list[2] + "," + image;
            }
            return(array_list);
        }