Пример #1
0
        // GET: ListaVideosYoutube
        public ActionResult ListaVideosYoutube()
        {
            videos = new HelperVideos();

            ViewBag.selectVideos = videos.GetVideos();
            return(View());
        }
Пример #2
0
        public ActionResult ListaVideosYoutube(String code)
        {
            videos = new HelperVideos();

            String html = "<iframe width = '560' height = '315'";

            html += " src='https://www.youtube.com/embed/" + code + "' frameborder = '0' allow = 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture' allowfullscreen ></ iframe >";

            ViewBag.selectVideos = videos.GetVideos();
            foreach (Videos item in ViewBag.selectVideos)
            {
                if (item.video == code)
                {
                    ViewBag.nombreVideo = item.texto;
                }
            }
            ViewBag.video = html;
            return(View());
        }