コード例 #1
0
        public ActionResult AddVideoPlaylist(string id, string name, string thu, string url)
        {
            DeclareP();
            int count          = 0;
            List <PlaylistR> p = (List <PlaylistR>)Session["PlaylistRL"];

            if (p.Count == 0)
            {
                count = 1;
            }
            else
            {
                count = p.Last().IdVideoCount + 1;
            }

            Videos video = new Videos
            {
                Id        = id,
                Nombre    = name,
                Thumbnail = thu,
                Url       = url
            };
            PlaylistR play = new PlaylistR
            {
                IdVideoCount = count,
                video        = video
            };

            p.Add(play);
            Session["PlayListRL"] = p;

            return(PartialView("Playlist", p));
        }
コード例 #2
0
        public ActionResult PlayVideo(int cont)
        {
            Videos           vidtoPlay = new Videos();
            List <PlaylistR> a         = (List <PlaylistR>)Session["PlayListRL"];

            foreach (var i in a)
            {
                if (i.IdVideoCount == cont)
                {
                    vidtoPlay = i.video;
                }
            }
            PlaylistR p = new PlaylistR {
                IdVideoCount = cont, video = vidtoPlay
            };

            return(PartialView("Reproductor", p));
        }