private void GetVideobyId(int Id) { VideoBSO videoBSO = new VideoBSO(); ETO.Video video = videoBSO.GetVideoById(Id); ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.language); if (video == null) Response.Redirect("~/Default.aspx"); //if (video.VideoType == true) // ltlVideo.Text = @"<object type='application/x-shockwave-flash' data='" + ResolveUrl("~/") // + "images/player_flv_multi.swf' width='480' height='320'><param name='movie' value='" // + ResolveUrl("~/") + "images/player_flv_multi.swf' /> <param name='allowFullScreen' value='true' /><param name='FlashVars' value='flv=" // + video.VideoUrl + "&title=" + video.VideoName + "&startimage=" + ResolveUrl("~/") + "Admin/Upload/Video/" // + video.Image + "&width=480&height=320&autoplay=0&autoload=0&margin=0&showstop=1&showvolume=1&showtime=2&showopen=2&showfullscreen=1&buffer=10&buffermessage=" // + video.ShortDescribe + "&shortcut=1&showtitleandstartimage=0' /></object>"; //else // ltlVideo.Text = @"<object type='application/x-shockwave-flash' data='" + ResolveUrl("~/") // + "images/player_flv_multi.swf' width='480' height='320'><param name='movie' value='" // + ResolveUrl("~/") + "images/player_flv_multi.swf' /> <param name='allowFullScreen' value='true' /><param name='FlashVars' value='flv=" // + ResolveUrl("~/") + "Admin/Upload/Video/Files/" + video.FileName + "&title=" + video.VideoName + "&startimage=" // + ResolveUrl("~/") + "Admin/Upload/Video/" + video.Image + "&width=480&height=320&autoplay=0&autoload=0&margin=0&showstop=1&showvolume=1&showtime=2&showopen=2&showfullscreen=1&buffer=10&buffermessage=" // + video.ShortDescribe + "&shortcut=1&showtitleandstartimage=0' /></object>"; if (video.VideoType == true) ltlVideo.Text = @"<object width='480' height='320' data='" + (new commonBSO()).EmbedYoutubeLink(video.VideoUrl) + "'></object>"; else ltlVideo.Text = @"<object type='application/x-shockwave-flash' data='http://flv-player.net/medias/player_flv_multi.swf' width='480' height='320'><param name='movie' value='http://flv-player.net/medias/player_flv_multi.swf' /> <param name='allowFullScreen' value='true' /><param name='FlashVars' value='flv=" + ResolveUrl("~/") + "Admin/Upload/Video/Files/" + video.FileName + "&title=" + video.VideoName + "&startimage=" + ResolveUrl("~/") + "Admin/Upload/Video/" + video.Image + "&width=480&height=320&autoplay=0&autoload=0&margin=0&showstop=1&showvolume=1&showtime=2&showopen=2&showfullscreen=1&buffer=10&buffermessage=" + video.ShortDescribe + "&shortcut=1&showtitleandstartimage=0' /></object>"; }
private void initControl(int Id) { if (Id > 0) { btn_add.Visible = false; btn_edit.Visible = true; try { VideoBSO videoBSO = new VideoBSO(); Video video = videoBSO.GetVideoById(Id); hddVideoID.Value = Convert.ToString(video.VideoID); hddIcon.Value = video.Image; uploadPreview.Src = ResolveUrl("~/Upload/Video/") + video.Image; txtVideoName.Text = video.VideoName; txtVideoUrl.Text = video.VideoEmbed; txtShortDescribe.Text = video.ShortDescribe; txtRadDate.SelectedDate = video.PostDate; rdbIsHome.SelectedValue = Convert.ToString(video.IsHome); NgonNgu.SelectedValue = video.Language; hddFileName.Value = video.FileName; rdbType.SelectedValue = Convert.ToString(video.VideoType); rdbType.Enabled = false; if (video.VideoType == true) { txtFileName.Visible = false; txtVideoUrl.Visible = true; } else { txtFileName.Visible = true; txtVideoUrl.Visible = false; } } catch (Exception ex) { clientview.Text = ex.Message.ToString(); } } else { txtRadDate.SelectedDate = DateTime.Now; btn_add.Visible = true; btn_edit.Visible = false; rdbType.Enabled = true; } }