Example #1
0
        public void CanGetUserSessionVideoData()
        {
            if (!Debugger.IsAttached)
            {
                return;
            }

            var response = WebApiService.GetUserSessionVideoData("57020", 11);

            Assert.IsNotNull(response);
        }
        public ActionResult Index()
        {
            //string videoCampaignMemberId = "DefaultVideoCampaignMemberId".GetConfigurationValue();
            //int employerId = "DefaultEmployerId".GetConfigurationNumericValue();
            UserSessionVideoModel userSessionVideo = UserSessionVideoModel.Current;

            if (null != Request.QueryString["vid"])
            {
                string   qparam  = Request.QueryString["vid"];
                string[] qparams = qparam.Split('|');

                if (qparams.Length == 2)
                {
                    string videoCampaignMemberId = qparams[0];
                    int    employerId            = int.Parse(qparams[1]);

                    userSessionVideo = WebApiService.GetUserSessionVideoData(
                        videoCampaignMemberId, employerId);

                    UserSessionVideoModel.Current = userSessionVideo;
                }
                else
                {
                    HelperService.LogAnEvent(LogEvents.InvalidQueryParameters, qparam);
                }
            }
            else
            {
                if (userSessionVideo.VideoCampaignMemberId.Equals("DefaultVideoCampaignMemberId".GetConfigurationValue()))
                {
                    HelperService.LogAnEvent(LogEvents.NoQueryParameters);
                }
            }
            ViewBag.Poster = userSessionVideo.PublicPosterUrl;
            ViewBag.Vid    = userSessionVideo.PublicIntroVideoUrl;

            if (!string.IsNullOrEmpty(userSessionVideo.VideoCampaignFileId))
            {
                HelperService.LogAnEvent(LogEvents.StartIntro);
            }

            return(View());
        }