Exemplo n.º 1
0
        public ILectureResouce CreateLectureResouce(string type, string name, string url)
        {
            // Use this instead of DateTime.Now if you want any points in BGCoder!!
            var             currentDate = DateTimeProvider.Now;
            ILectureResouce Resource;

            switch (type)
            {
            case "video":
                Resource = new VideoResource(name, url, currentDate);
                break;

            case "presentation":
                Resource = new PresentationResource(name, url);
                break;

            case "demo":
                Resource = new DemoResource(name, url);
                break;

            case "homework":
                Resource = new HomeworkResource(name, url, currentDate);
                break;

            default: throw new ArgumentException("Invalid lecture resource type");
            }
            return(Resource);
        }
Exemplo n.º 2
0
        public StreamioAPI(string username, string password)
        {
            RestClient client = new RestClient(BaseUrl);

            client.Authenticator = new HttpBasicAuthenticator(username, password);

            Videos           = new VideoResource(client);
            Images           = new ImageResource(client);
            Playlists        = new PlaylistResource(client);
            Players          = new PlayerResource(client);
            Audios           = new AudioResource(client);
            EncodingProfiles = new EncodingProfileResource(client);
            PublicUploads    = new PublicUploadResource(client);
        }
Exemplo n.º 3
0
        public IActionResult Post([FromBody] VideoResource videoResource)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var video = mapper.Map <VideoResource, Video>(videoResource);

            if (video == null)
            {
                return(NotFound());
            }

            var dbMessage = context.Videos.Add(video).Entity;

            context.SaveChanges();

            var result = mapper.Map <Video, VideoResource>(dbMessage);

            return(Ok(result));
        }
Exemplo n.º 4
0
        public ActionResult CreateVideo(VideoResource resource)
        {
            var           resources = GetUploadResource();
            VideoResource video     = resources.Select(item => new VideoResource(item)).ToList().FirstOrDefault();

            if (video == null)
            {
                return(View());
            }
            var createList = new List <FileEntry>();

            video.Title       = resource.Title;
            video.Description = resource.Description;
            video.Name        = GetHashName(video.OriginName);
            video.Path        = MakePath(video);
            createList.Add(new FileEntry()
            {
                Content = video.Content,
                Path    = System.IO.Path.Combine(video.Path, video.Name),
            });
            videoService.Create(createList.ToArray());
            Service.Create(video);
            return(RedirectToAction("Video"));
        }
Exemplo n.º 5
0
 /// <summary> 
 /// Method to send Video Tribute Headers details
 /// </summary>
 /// <param name="userId"></param>
 /// <returns></returns>
 public UserBusiness GetHeaderDetailsOnUserId(int userId)
 {
     VideoResource objVideoResource = new VideoResource();
     return objVideoResource.GetHeaderDetailsOnUserId(userId);
 }
Exemplo n.º 6
0
 public Tributes GetEditTributeFieldDetails(int tributeId)
 {
     VideoResource objVideoResource = new VideoResource();
     return objVideoResource.GetEditTributeFieldDetails(tributeId);
 }
Exemplo n.º 7
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="tributeId"></param>
 /// <returns></returns>
 public bool GetCustomHeaderDetail(int tributeId)
 {
     VideoResource objVideoResource = new VideoResource();
     return objVideoResource.GetCustomHeaderDetail(tributeId);
 }
Exemplo n.º 8
0
 public Users GetUserNameOnUserId(int _userId)
 {
     VideoResource objVideoResource = new VideoResource();
     return objVideoResource.GetUserNameOnUserId(_userId);
 }
    /// <summary>
    /// This function will get the User Detail and Search Parameter from the session
    /// </summary>
    private void GetValuesFromSession()
    {
        try
        {
            Response.Cache.SetExpires(DateTime.Now);

            // Create State manager instance
            StateManager objStateManager = StateManager.Instance;

            // To get user id from session as user is logged in user
            _SessionValue = (SessionValue)objStateManager.Get(PortalEnums.SessionValueEnum.objSessionvalue.ToString(), StateManager.State.Session);
            if (_SessionValue != null)
            {
                _UserId = _SessionValue.UserId;
                _UserName = _SessionValue.UserName;
                BlankTopDiv.Visible = false;

                ////myprofile.Visible = true;
                //// To display login and logout option based on the Session value for the user.
                //spanLogout.InnerHtml = "<a href='Logout.aspx'>Log out</a>";
            }
            else
            {
                //myprofile.Visible = false;
                //spanLogout.InnerHtml = "<a href='javascript: void(0);' onclick='doModalLogin();'>Log in</a>";
                if (Request.QueryString["username"] != null)
                {
                    string _BusinessUserName = Request.QueryString["username"].ToString();
                    VideoResource objVideoResource = new VideoResource();
                    BusinessUserId = objVideoResource.GetUserIdByUserName(_BusinessUserName, WebConfig.ApplicationType.ToString());
                }
                if (BusinessUserId > 0)
                {
                    VideoResource objVideoResource = new VideoResource();
                    UserBusiness objUserBusiness = objVideoResource.GetHeaderDetailsOnUserId(BusinessUserId);
                    if (objUserBusiness != null)
                    {
                        IsCustomHeaderOn = Convert.ToBoolean(objUserBusiness.DisplayCustomHeader);
                    }
                }
                if (IsCustomHeaderOn == true)
                    BlankTopDiv.Visible = false;
                else
                    BlankTopDiv.Visible = true;
                spanLogout.InnerHtml = "<a href='javascript: void(0);' onclick='UserLoginModalpopupFromSubDomain(location.href,document.title);' >Log in</a>";
            }

            // To get current page number, if user clicks on page number in paging it gets the page number from query string
            // else page number is 1
            if (Request.QueryString["PageNo"] != null)
            {
                _CurrentPage = int.Parse(Request.QueryString["PageNo"].ToString());
            }
            else
            {
                _CurrentPage = 1;
            }

            if (Request.QueryString["username"] != null)
            {
                _BusinessUserName = Request.QueryString["username"].ToString();
                objStateManager.Add("BusinessUserName", _BusinessUserName, StateManager.State.Session);
                maindiv.Visible = true;
                Div1.Visible = false;
                //  SpanTribute.Visible = true;
                //this.Page.Title = "Your Tribute - {" + _BusinessUserName + "}'s Tributes";

            }
            else if (Session["BusinessUserName"] != null)
            {
                _BusinessUserName = Session["BusinessUserName"].ToString();
                maindiv.Visible = true;
                Div1.Visible = false;
            }
            else
            {
                SetUserControlsVisibility();
            }

            // To get page size from config file
            _PageSize = (int.Parse(WebConfig.Pagesize_Gift));
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Exemplo n.º 10
0
        public async Task <IEnumerable <VideoResource> > GetVideos(VideoResource saveVideoResource)
        {
            var videos = await _repository.GetVideos(saveVideoResource);

            return(_mapper.Map <IEnumerable <Video>, IEnumerable <VideoResource> >(videos));
        }
Exemplo n.º 11
0
        public bool SaveVideoTributeAndSendEmail(Videos objVid, string type)
        {
            object objIdentity = null;
            bool videocaptionexist = false;
            try
            {
                VideoResource objVideo = new VideoResource();
                object[] param = { objVid };
                //objVideo.InsertRecord(param);
                object objVideoId = objVideo.InsertDataAndReturnId(param);
                if (objVideoId != null)
                {
                    objVid.VideoId = int.Parse(objVideoId.ToString());
                    //to send mail
                    TributeResource objTribute = new TributeResource();
                    Tributes objTrib = new Tributes();
                    objTrib.TributeId = int.Parse(objVid.UserTributeId.ToString());
                    objTrib.TypeDescription = objVid.ModuleTypeName;
                    object[] paramTrib = { objTrib };
                    List<UserInfo> objUser = objTribute.GetTributeAdministrators(paramTrib);
                    if (objUser.Count > 0)
                    {
                        SendEmailForNewVideoTribute(objUser, objVid, type);
                    }

                    //Function to send the mail to the list of users who have added the Tribute in their list of favourites
                    List<UserInfo> objUserFav = objTribute.GetFavouriteTributeUsers(paramTrib);
                    if (objUserFav.Count > 0)
                    {
                        //As per discussion with Rupendra: will send the mail in "To" field.
                        //ie a comma separated list of users in the "to" field
                        SendEmail(objUserFav, objVid, type);
                    }

                }
                else
                    videocaptionexist = true;

            }
            catch (Exception ex)
            {
                throw ex;
            }
            return videocaptionexist;
        }
Exemplo n.º 12
0
 /// <summary>
 /// Method to delete video tribute based on TributeId
 /// </summary>
 /// <param name="objVid"></param>
 public void DeleteVideoTribute(Videos objVid)
 {
     VideoResource objVideo = new VideoResource();
     object[] param = { objVid };
     objVideo.DeleteVideoTribute(param);
 }
Exemplo n.º 13
0
 /// <summary>
 /// Method to get the details of video tribute.
 /// </summary>
 /// <param name="objVideoGallery">Video Gallery entity containing User Tribute id</param>
 /// <returns>Filled Video entity</returns>
 public VideoGallery GetVideoTributeDetails(Videos objTributeId)
 {
     VideoResource objVideo = new VideoResource();
     object[] param = { objTributeId };
     return objVideo.GetVideoTributeDetails(param);
 }
Exemplo n.º 14
0
 public Videos GetVideoTributeDetails(int videoId)
 {
     Videos objVideos;
     VideoResource objVideoResource = new VideoResource();
     objVideos = objVideoResource.GetTributeDetails(videoId);
     return objVideos;
 }
Exemplo n.º 15
0
 /// <summary>
 /// Method to send the request to Video Resource to get the list of videos for Video Tribute
 /// </summary>
 /// <param name="objVideoGallery">Video Gallery entity conatining UserTributeId, Page size and Page number</param>
 /// <returns>List of Videos</returns>
 public List<VideoGallery> GetVideoGalleryRecords(VideoGallery objVideoGallery)
 {
     VideoResource objVideo = new VideoResource();
     object[] param = { objVideoGallery };
     return objVideo.GetVideoGalleryRecords(param);
 }
Exemplo n.º 16
0
 /// <summary>
 /// LHK:to get the vt video details
 /// </summary>
 /// <param name="_tributeId"></param>
 /// <returns>object of videos type</returns>
 public Videos GetVideoDetailsOnUserTributeId(int _tributeId)
 {
     VideoResource objVideoResource = new VideoResource();
     return objVideoResource.GetVideoDetailsOnUserTributeId(_tributeId);
 }
Exemplo n.º 17
0
 /// <summary>
 /// Method to get the details of video.
 /// </summary>
 /// <param name="objVideoGallery">Video Gallery entity containing User Tribute id, Page size and Page number</param>
 /// <returns>Filled VideoGallery entity</returns>
 public VideoGallery GetVideoDetails(VideoGallery objVideoGallery)
 {
     VideoResource objVideo = new VideoResource();
     object[] param = { objVideoGallery };
     return objVideo.GetVideoDetails(param);
 }
Exemplo n.º 18
0
 public int? GetLinkVideoMemorialTribute(int? UserId, int UserTributeId)
 {
     VideoResource objVideoResource = new VideoResource();
     return objVideoResource.GetLinkVideoMemorialTribute(UserId, UserTributeId);
 }
Exemplo n.º 19
0
        public void UpdateVideoTributeDetail(Tributes objStory)
        {
            try
            {
                VideoResource objStoryRes = new VideoResource();
                objStoryRes.UpdateVideoTributeDetail(objStory);

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 20
0
 /// <summary>
 /// Method to get the list of tributes to add video tributes
 /// </summary>
 /// <param name="objUserId">Tribute entity containing user id</param>
 /// <returns>List of tributes</returns>
 public List<Tributes> GetListOfTributesForVideoTribute(Tributes objUserId)
 {
     VideoResource objVideoResource = new VideoResource();
     object[] param = { objUserId };
     return objVideoResource.GetListOfTributesForVideoTribute(param);
 }
Exemplo n.º 21
0
        public async Task <IEnumerable <Video> > GetVideos(VideoResource saveVideoResource)
        {
            var videos = _dbContext.Videos.Include(x => x.Genre).AsQueryable();

            return(await videos.ToListAsync());
        }
Exemplo n.º 22
0
 public void WhenIExamineChild1AsAVideoFile(int childNo)
 {
     _video = (VideoResource) _payload.Items[childNo - 1];
 }
Exemplo n.º 23
0
 /// <summary>
 /// Method to get the Token Details.
 /// </summary>
 /// <param name="objTokenId">Video Token entity containing Token Id</param>
 /// <returns>Filled VideoToken entity.</returns>
 public VideoToken GetTokenDetails(VideoToken objTokenId)
 {
     VideoResource objVideo = new VideoResource();
     object[] param = { objTokenId };
     return objVideo.GetTokenDetails(param);
 }
Exemplo n.º 24
0
 public ActionResult EditVideo(VideoResource video)
 {
     Service.Update(video);
     return(View(video));
 }
Exemplo n.º 25
0
 /// <summary>
 /// Added to get old trburl to copy directory
 /// </summary>
 /// <param name="_tributeId"></param>
 /// <returns></returns>
 public string GetOldTributeUrlOnTributeId(int _tributeId)
 {
     VideoResource objVideoResource = new VideoResource();
     return objVideoResource.GetOldTributeUrlOnTributeId(_tributeId);
 }
Exemplo n.º 26
0
 /// <summary>
 /// Method to update the video tribute details
 /// </summary>
 /// <param name="objVid">Filled Video entity</param>
 public object UpdateVideoTributeDetails(Videos objVid)
 {
     VideoResource objVideo = new VideoResource();
     object[] param = { objVid };
     return objVideo.UpdateVideoTributeDetails(param);
 }
Exemplo n.º 27
0
 /// <summary>
 /// LHK:to get end date of the tribute.
 /// </summary>
 /// <param name="tributeId"></param>
 /// <returns>Date in string format</returns>
 public string GetTributeEndDate(int tributeId)
 {
     VideoResource objVideoResource = new VideoResource();
     return objVideoResource.GetTributeEndDate(tributeId);
 }
Exemplo n.º 28
0
        private void LoadDynamicFolder(VirtualFolder vf)
        {
            this.Log("LoadDynamicFolder: "+vf.SourceUrl);

              vf.Reset(); // Remove existing items

              try {
            foreach (ProgrammeItem prog in progDB.ProgrammesFromFeed(vf.SourceUrl)) {
              try {
            string guid = vf.FindGuid(prog.Vpid);
            if (guid == null) guid = CreateGuid();

            VideoResource info =
              new VideoResource(guid, vf.Id, prog.Title, prog.Vpid, prog.Description,
                                prog.Thumbnail, prog.Date, prog.Vpid, null,
                                prog.Duration * 1000 /* PlayOn wants ms */, 0, null, null);

            this.titleLookup[info.Id] = info;
            vf.AddMedia(info);
              } catch (Exception ex) {
            vf.AddMedia(InfoResource(vf, "Error retrieving programme details. Please restart PlayOn."));
            this.Log("Error: " + ex);
              }
            }
              } catch (Exception ex) {
            vf.AddMedia(InfoResource(vf, "Error retrieving feed. Please restart PlayOn."));
            this.Log("Error: " + ex);
              }
        }
Exemplo n.º 29
0
 public void UpdateVideoTributeImage(int _tributeId, string _videoTributeImage)
 {
     VideoResource objVideoResource = new VideoResource();
     objVideoResource.UpdateVideoTributeImage(_tributeId, _videoTributeImage);
 }
 private void GetCustomHeaderVisible(string _tributeUrl, string ApplicationType)
 {
     IsCustomHeaderOn = false;
     VideoResource objVideoResource = new VideoResource();
     IsCstmHeaderOn = objVideoResource.GetCustomHeaderVisible(_tributeUrl, ApplicationType);
 }
Exemplo n.º 31
0
 public int GetCurrentVideos(int _tributeId)
 {
     VideoResource objVideoResource = new VideoResource();
     return objVideoResource.GetCurrentVideos(_tributeId);
 }