Ejemplo n.º 1
0
        private void ProcessVideoTags(DataToParse PageDocument)
        {   //process any video tags
            var videotag_list = PageDocument.Doc
                                .DocumentNode
                                .SelectNodes("//video");

            if (videotag_list == null)
            {
                return;
            }
            foreach (var videotag in videotag_list)
            {
                string src, videoId;
                if (videotag.Attributes["src"] == null)
                {
                    lock (Data)
                    {
                        Data.Add(new PageA11yData(PageDocument.Location, "Inline Media Video", videotag.OuterHtml, "Something may be wrong with this video...", "Check video", 3, videotag.XPath));
                    }
                    src     = "";
                    videoId = "Unable to find ... ";
                }
                else
                {
                    src     = videotag.Attributes["src"].Value;
                    videoId = src.Split('=')
                              .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                              .ElementAt(1)
                              .Split('&')
                              .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                              .FirstOrDefault();
                }

                if (!VideoParser.CheckTranscript(videotag))
                {
                    lock (Data)
                    {
                        Data.Add(new PageA11yData(PageDocument.Location, "Inline Media Video", videoId, "Inline Media Video\n", "No transcript found", 5, videotag.XPath));
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void ProcessAudioElements(DataToParse PageDocument)
        {   //// Audio Recordings should have transcripts for deaf people
            var audio_elements = PageDocument.Doc
                                 .DocumentNode
                                 .SelectNodes("//a[contains(@class, 'instructure_audio_link')]");

            if (audio_elements == null)
            {
                return;
            }
            foreach (var el in audio_elements)
            {
                if (!VideoParser.CheckTranscript(el))
                {
                    lock (Data)
                    {
                        Data.Add(new PageA11yData(PageDocument.Location, "Inline Audio Recording", "", el.InnerText, "No transcript found", 5, el.XPath));
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void ProcessVideoTags(DataToParse PageDocument)
        {
            var video_tag_list = PageDocument.Doc
                                 .DocumentNode
                                 .SelectNodes("//video");

            if (video_tag_list == null)
            {
                return;
            }

            foreach (var video in video_tag_list)
            {
                if (video.Attributes["src"] == null)
                {
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "Inline Media Video",
                                                   "",
                                                   $"Something may be wrong with this video...\n{video.OuterHtml}",
                                                   "",
                                                   new TimeSpan(0),
                                                   VideoParser.CheckTranscript(video)));
                    }
                    continue;
                }
                string video_id = video.Attributes["src"].Value.CleanSplit("=")[1].CleanSplit("&")[0];
                lock (Data)
                {
                    Data.Add(new PageMediaData(PageDocument.Location,
                                               "Inline Media Video",
                                               video_id,
                                               "Inline Media:\nUnable to find title or video length for this type of video",
                                               video.Attributes["src"].Value,
                                               new TimeSpan(0),
                                               VideoParser.CheckTranscript(video)));
                }
            }
        }
Ejemplo n.º 4
0
        private void ProcessBrightcoveVideoHTML(DataToParse PageDocument)
        {   //A lot of our HTML templates use a div + javascript to insert the brightcove video.
            var brightcove_list = PageDocument.Doc
                                  .DocumentNode
                                  ?.SelectNodes(@"//div[@id]")
                                  ?.Where(e => new Regex("\\d{13}").IsMatch(e.Id));

            if (brightcove_list == null)
            {
                return;
            }
            foreach (var video in brightcove_list)
            {
                if (!VideoParser.CheckTranscript(video))
                {
                    lock (Data)
                    {
                        Data.Add(new PageA11yData(PageDocument.Location, "Transcript", video.Attributes["id"].Value, $"No transcript found for BrightCove video with id:\n{video.Attributes["id"].Value}", "No transcript found", 5, video.XPath));
                    }
                }
            }
        }
Ejemplo n.º 5
0
        private void ProcessBrightcoveVideoHTML(DataToParse PageDocument)
        {
            var brightcove_list = PageDocument.Doc
                                  .DocumentNode
                                  ?.SelectNodes(@"//div[@id]")
                                  ?.Where(e => new Regex("\\d{13}").IsMatch(e.Id));

            if (brightcove_list == null)
            {
                return;
            }
            string BrightCoveVideoName = "";

            foreach (var video in brightcove_list)
            {
                string   video_id = new Regex("\\d{13}").Match(video.Id).Value;
                TimeSpan video_length;
                bool     cc;
                lock (Chrome)
                {
                    lock (Wait)
                    {
                        video_length = VideoParser.GetBrightcoveVideoLength(video_id, Chrome, Wait, out cc, out BrightCoveVideoName);
                    }
                }
                lock (Data)
                {
                    Data.Add(new PageMediaData(PageDocument.Location,
                                               "Brightcove Video",
                                               video_id,
                                               BrightCoveVideoName,
                                               $"https://studio.brightcove.com/products/videocloud/media/videos/search/{video_id}",
                                               video_length,
                                               VideoParser.CheckTranscript(video),
                                               cc));
                }
            }
        }
Ejemplo n.º 6
0
        private void ProcessIframes(DataToParse PageDocument)
        {
            //Get list of iframes
            var iframe_list = PageDocument.Doc
                              .DocumentNode
                              .SelectNodes("//iframe");

            //Make sure its not null
            if (iframe_list == null)
            {
                return;
            }
            //Keep track of what iframe we are on
            var iframe_number = 1;

            foreach (var iframe in iframe_list)
            {
                //Get the source attribute, every iframe should have one
                var src = "";
                if (iframe.Attributes["src"] == null)
                {
                    if (iframe.Attributes["data-src"] != null)
                    {   //found that sometimes a data-src is used istead of the normal src
                        src = iframe.Attributes["data-src"].Value;
                    }
                    else
                    {
                        lock (Data)
                        {
                            Data.Add(new PageA11yData(PageDocument.Location,
                                                      "Iframe",
                                                      "Can't find source",
                                                      "Unable to find iframe source",
                                                      "Iframes should all have a soruce",
                                                      3,
                                                      iframe.XPath));
                        }
                        continue;
                    }
                }
                else
                {
                    src = iframe.Attributes["src"].Value;
                }
                if (iframe.Attributes["title"] == null)
                {
                    //Only real accessiblity issue we can check is if it has a title or not
                    if (new Regex("youtube", RegexOptions.IgnoreCase).IsMatch(src))
                    {
                        //Get the youtube information
                        var uri     = new Uri(src);
                        var query   = System.Web.HttpUtility.ParseQueryString(uri.Query);
                        var videoId = string.Empty;
                        if (query.AllKeys.Contains("v"))
                        {
                            videoId = query["v"];
                        }
                        else
                        {
                            videoId = uri.Segments.LastOrDefault();
                        }
                        lock (Data)
                        {
                            Data.Add(new PageA11yData(PageDocument.Location, "Youtube Video", videoId, "", "Needs a title", 1, iframe.XPath));
                        }
                    }
                    else if (new Regex("brightcove", RegexOptions.IgnoreCase).IsMatch(src))
                    {
                        //Get brightcove info
                        var videoId = src.CleanSplit("=").LastOrDefault().CleanSplit("&").FirstOrDefault();
                        if (!src.Contains("https:"))
                        {   //Make sure it has the https on it
                            src = $"https:{src}";
                        }
                        lock (Data)
                        {
                            Data.Add(new PageA11yData(PageDocument.Location, "Brightcove Video", videoId, "", "Needs a title", 1, iframe.XPath));
                        }
                    }
                    else if (new Regex("H5P", RegexOptions.IgnoreCase).IsMatch(src))
                    {   //H5P can just be added
                        lock (Data)
                        {
                            Data.Add(new PageA11yData(PageDocument.Location, "H5P", "", "", "Needs a title", 1, iframe.XPath));
                        }
                    }
                    else if (new Regex("byu\\.mediasite", RegexOptions.IgnoreCase).IsMatch(src))
                    {   //Get id
                        var videoId = src.CleanSplit("/").LastOrDefault();
                        lock (Data)
                        {
                            Data.Add(new PageA11yData(PageDocument.Location, "BYU Mediasite Video", videoId, "", "Needs a title", 1, iframe.XPath));
                        }
                    }
                    else if (new Regex("panopto", RegexOptions.IgnoreCase).IsMatch(src))
                    {
                        var videoId = src.CleanSplit("id=").LastOrDefault().CleanSplit('&').FirstOrDefault();

                        lock (Data)
                        {
                            Data.Add(new PageA11yData(PageDocument.Location, "Panopto Video", videoId, "", "Needs a title", 1, iframe.XPath));
                        }
                    }
                    else if (new Regex("alexanderstreet", RegexOptions.IgnoreCase).IsMatch(src))
                    {
                        var videoId = src.Split(new string[] { "token/" }, StringSplitOptions.RemoveEmptyEntries)
                                      .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                      .LastOrDefault();
                        lock (Data)
                        {
                            Data.Add(new PageA11yData(PageDocument.Location, "AlexanderStreen Video", videoId, "", "Needs a title", 1, iframe.XPath));
                        }
                    }
                    else if (new Regex("kanopy", RegexOptions.IgnoreCase).IsMatch(src))
                    {
                        var videoId = src.Split(new string[] { "embed/" }, StringSplitOptions.RemoveEmptyEntries)
                                      .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                      .LastOrDefault();
                        lock (Data)
                        {
                            Data.Add(new PageA11yData(PageDocument.Location, "Kanopy Video", videoId, "", "Needs a title", 1, iframe.XPath));
                        }
                    }
                    else if (new Regex("ambrosevideo", RegexOptions.IgnoreCase).IsMatch(src))
                    {
                        var videoId = src.Split('?')
                                      .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                      .LastOrDefault()
                                      .Split('&')
                                      .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                      .FirstOrDefault();
                        lock (Data)
                        {
                            Data.Add(new PageA11yData(PageDocument.Location, "Ambrose Video", videoId, "", "NEeds a title", 1, iframe.XPath));
                        }
                    }
                    else if (new Regex("facebook", RegexOptions.IgnoreCase).IsMatch(src))
                    {
                        var videoId = new Regex("\\d{17}").Match(src).Value;
                        lock (Data)
                        {
                            Data.Add(new PageA11yData(PageDocument.Location, "Facebook Video", videoId, "", "Needs a title", 1, iframe.XPath));
                        }
                    }
                    else if (new Regex("dailymotion", RegexOptions.IgnoreCase).IsMatch(src))
                    {
                        var videoId = src.Split('/')
                                      .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                      .LastOrDefault();
                        lock (Data)
                        {
                            Data.Add(new PageA11yData(PageDocument.Location, "Facebook Video", videoId, "", "Needs a title", 1, iframe.XPath));
                        }
                    }
                    else if (new Regex("vimeo", RegexOptions.IgnoreCase).IsMatch(src))
                    {
                        var videoId = src.Split('/')
                                      .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                      .LastOrDefault()
                                      .Split('?')
                                      .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                      .FirstOrDefault();
                        lock (Data)
                        {
                            Data.Add(new PageA11yData(PageDocument.Location, "Vimeo Video", videoId, "", "Needs a title", 1, iframe.XPath));
                        }
                    }
                    else
                    {
                        lock (Data)
                        {
                            Data.Add(new PageA11yData(PageDocument.Location, "Iframe", "", "", "Needs a title", 1, iframe.XPath));
                        }
                    }
                }
                if (new Regex("brightcove|byu\\.mediasite|panopto|vimeo|dailymotion|facebook|ambrosevideo|kanopy|alexanderstreet", RegexOptions.IgnoreCase).IsMatch(src))
                {   //If it is a video then need to check if there is a transcript
                    if (!VideoParser.CheckTranscript(iframe))
                    {
                        lock (Data)
                        {
                            Data.Add(new PageA11yData(PageDocument.Location, "Transcript", "", $"Video number {iframe_number} on page", "No transcript found", 5, iframe.XPath));
                        }
                    }
                }
                iframe_number++;
            }
        }
Ejemplo n.º 7
0
        private void ProcessLinks(DataToParse PageDocument)
        {
            var link_list = PageDocument.Doc
                            .DocumentNode
                            .SelectNodes("//a");

            if (link_list == null)
            {
                return;
            }
            var BrightCoveVideoName = "";

            foreach (var link in link_list)
            {   //Make sure there is an href
                if (link.Attributes["href"] == null)
                {
                    continue;
                }
                if (link.GetClasses().Contains("video_link"))
                {   //See if it is an embded canvas video link
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "Canvas Video Link",
                                                   "",
                                                   "Inline Media:\nUnable to find title, CC, or video length for this type of video",
                                                   link.Attributes["href"].Value,
                                                   new TimeSpan(0),
                                                   VideoParser.CheckTranscript(link),
                                                   false));
                    }
                }
                else if (link.GetClasses().Contains("instructure_audio_link"))
                {
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "Canvas Audio Link",
                                                   "",
                                                   link.InnerText,
                                                   link.Attributes["href"].Value,
                                                   new TimeSpan(0),
                                                   VideoParser.CheckTranscript(link),
                                                   false));
                    }
                }
                else if (new Regex("youtu\\.?be", RegexOptions.IgnoreCase).IsMatch(link.Attributes["href"].Value))
                {   //See if it is a youtube video
                    var uri = new Uri((link.Attributes["href"].Value));

                    var query    = System.Web.HttpUtility.ParseQueryString(uri.Query);
                    var video_id = string.Empty;
                    if (query.AllKeys.Contains("v"))
                    {
                        video_id = query["v"];
                    }
                    else
                    {
                        video_id = uri.Segments.LastOrDefault();
                    }
                    //Get time from video
                    TimeSpan video_length;
                    bool     channel = false;
                    string   title   = "";
                    try
                    {
                        video_id = video_id.Split('?')
                                   .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                   .FirstOrDefault();
                        video_id = video_id.Split('/')
                                   .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                   .LastOrDefault();
                        video_id = video_id.Split('#')
                                   .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                   .FirstOrDefault();
                        if (uri.Segments.Contains("channel/"))
                        {
                            title        = VideoParser.GetYTChannelName(video_id);
                            video_length = new TimeSpan(0);
                            channel      = true;
                        }
                        else
                        {
                            video_length = VideoParser.GetYoutubeVideoLength(video_id);
                        }
                    }
                    catch
                    {
                        //Time is 0 if it failed
                        Console.WriteLine("Video not found");
                        video_length = new TimeSpan(0);
                    }
                    string video_found = string.Empty;
                    if (video_length == new TimeSpan(0) && !channel)
                    {   //make sure we apend video not found for the excel doc
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                        if (channel)
                        {
                            video_found = $"\nLinks to a channel named: {title}";
                        }
                    }

                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "YouTube Link",
                                                   video_id,
                                                   link.InnerText + video_found,
                                                   link.Attributes["href"].Value,
                                                   video_length,
                                                   true,
                                                   true));
                    }
                }
                else if (link.Attributes["href"].Value.Contains("alexanderstreet"))
                {
                    string video_id = link.Attributes["href"].Value.Split('/')
                                      .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                      .LastOrDefault();
                    TimeSpan video_length;
                    bool     cc;
                    lock (Chrome)
                    {
                        lock (Wait)
                        {
                            video_length = VideoParser.GetAlexanderStreenLinkLength(video_id, Chrome, Wait, out cc);
                        }
                    }

                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "AlexanderStreet Link",
                                                   video_id,
                                                   link.InnerText + video_found,
                                                   link.Attributes["href"].Value,
                                                   video_length,
                                                   cc,
                                                   cc));
                    }
                }
                else if (link.Attributes["href"].Value.Contains("kanopy"))
                {
                    string video_id = link.Attributes["href"].Value.Split('/')
                                      .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                      .LastOrDefault();
                    TimeSpan video_length;
                    bool     cc;
                    lock (Chrome)
                    {
                        lock (Wait)
                        {
                            video_length = VideoParser.GetKanopyLinkLength(video_id, Chrome, Wait, out cc);
                        }
                    }
                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "Kanopy Link",
                                                   video_id,
                                                   link.InnerText + video_found,
                                                   link.Attributes["href"].Value,
                                                   video_length,
                                                   cc,
                                                   cc));
                    }
                }
                else if (link.Attributes["href"].Value.Contains("byu.mediasite"))
                {
                    string video_id = link.Attributes["href"].Value.Split('/')
                                      .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                      .LastOrDefault();
                    TimeSpan video_length;
                    bool     cc;
                    lock (Chrome)
                    {
                        lock (Wait)
                        {
                            video_length = VideoParser.GetBYUMediaSiteVideoLength(video_id, Chrome, Wait, out cc);
                        }
                    }
                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "ByuMediasite Link",
                                                   video_id,
                                                   link.InnerText + video_found,
                                                   link.Attributes["href"].Value,
                                                   video_length,
                                                   VideoParser.CheckTranscript(link),
                                                   cc));
                    }
                }
                else if (link.Attributes["href"].Value.Contains("panopto"))
                {
                    string video_id = link.Attributes["href"].Value.Split('/')
                                      .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                      .LastOrDefault();
                    video_id = video_id.CleanSplit("id=").LastOrDefault().CleanSplit("&").FirstOrDefault();

                    TimeSpan video_length;
                    bool     cc;
                    lock (Chrome)
                    {
                        lock (Wait)
                        {
                            if (link.Attributes["href"].Value.Contains("Viewer.aspx"))
                            {
                                video_length = VideoParser.GetPanoptoVideoViewerLength(video_id, Chrome, Wait, out cc);
                            }
                            else
                            {
                                video_length = VideoParser.GetPanoptoVideoLength(video_id, Chrome, Wait, out cc);
                            }
                        }
                    }
                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "Panopto Link",
                                                   video_id,
                                                   link.InnerText + video_found,
                                                   link.Attributes["href"].Value,
                                                   video_length,
                                                   VideoParser.CheckTranscript(link),
                                                   cc));
                    }
                }
                else if (link.Attributes["href"].Value.Contains("bcove"))
                {
                    string   video_id;
                    TimeSpan video_length;
                    bool     cc;
                    lock (Chrome)
                    {
                        lock (Wait)
                        {
                            Chrome.Url = link.Attributes["href"].Value;
                            try
                            {
                                Wait.UntilElementIsVisible(By.CssSelector("iframe"));
                            }catch
                            {
                            }


                            video_id = Chrome.Url.Split('=')
                                       .Where(s => !string.IsNullOrEmpty(s) && !string.IsNullOrWhiteSpace(s))
                                       .LastOrDefault();
                            video_length = VideoParser.GetBrightcoveVideoLength(video_id, Chrome, Wait, out cc, out BrightCoveVideoName);
                        }
                    }
                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "Bcove Link",
                                                   video_id,
                                                   link.InnerText + video_found + BrightCoveVideoName,
                                                   link.Attributes["href"].Value,
                                                   video_length,
                                                   VideoParser.CheckTranscript(link),
                                                   cc));
                    }
                }
            }
        }
Ejemplo n.º 8
0
        private void ProcessIframes(DataToParse PageDocument)
        {   //Process all the iframes for media elements
            var iframe_list = PageDocument.Doc
                              .DocumentNode
                              .SelectNodes("//iframe");

            if (iframe_list == null)
            {
                return;
            }
            var BrightCoveVideoName = "";

            foreach (var iframe in iframe_list)
            {
                string title = "";

                if (iframe.Attributes["title"] == null)
                {
                    title = "No title attribute found";
                }
                else
                {
                    title = iframe.Attributes["title"].Value;
                }

                if (iframe.Attributes["src"] == null)
                {
                    continue;
                }

                if (iframe.Attributes["src"].Value.Contains("youtube"))
                {
                    var uri      = new Uri((iframe.Attributes["src"].Value));
                    var query    = System.Web.HttpUtility.ParseQueryString(uri.Query);
                    var video_id = string.Empty;
                    if (query.AllKeys.Contains("v"))
                    {
                        video_id = query["v"];
                    }
                    else
                    {
                        video_id = uri.Segments.LastOrDefault();
                    }

                    TimeSpan video_length;
                    try
                    {
                        video_id     = video_id.CleanSplit("?").FirstOrDefault();
                        video_id     = video_id.CleanSplit("%").FirstOrDefault();
                        video_length = VideoParser.GetYoutubeVideoLength(video_id);
                    }
                    catch
                    {
                        Console.WriteLine("Video not found");
                        video_length = new TimeSpan(0);
                    }
                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "YouTube Video",
                                                   video_id,
                                                   title + video_found,
                                                   iframe.Attributes["src"].Value,
                                                   video_length,
                                                   true,
                                                   true));
                    }
                }
                else if (iframe.Attributes["src"].Value.Contains("brightcove"))
                {
                    string   video_id = iframe.Attributes["src"].Value.CleanSplit("=").LastOrDefault().CleanSplit("&")[0];
                    TimeSpan video_length;
                    bool     cc;
                    lock (Chrome)
                    {
                        lock (Wait)
                        {
                            video_length = VideoParser.GetBrightcoveVideoLength(video_id, Chrome, Wait, out cc, out BrightCoveVideoName);
                        }
                    }
                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = iframe.Attributes["src"].Value.Contains("playlistId") ? "\nVideo playlist. Manual check for transcripts needed." : "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "Brightcove Video",
                                                   video_id,
                                                   title + video_found + BrightCoveVideoName,
                                                   iframe.Attributes["src"].Value,
                                                   video_length,
                                                   VideoParser.CheckTranscript(iframe),
                                                   cc));
                    }
                }
                else if (iframe.Attributes["src"].Value.Contains("H5P"))
                {
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "H5P",
                                                   "",
                                                   title,
                                                   iframe.Attributes["src"].Value,
                                                   new TimeSpan(0),
                                                   true,
                                                   true));
                    }
                }
                else if (iframe.Attributes["src"].Value.Contains("byu.mediasite"))
                {
                    string video_id = iframe.Attributes["src"].Value.CleanSplit("/").LastOrDefault();
                    if (String.IsNullOrEmpty(video_id))
                    {
                        video_id = iframe.Attributes["src"].Value.CleanSplit("/").Reverse().Skip(1).FirstOrDefault();
                    }
                    TimeSpan video_length;
                    bool     cc;
                    lock (Chrome)
                    {
                        lock (Wait)
                        {
                            video_length = VideoParser.GetBYUMediaSiteVideoLength(video_id, Chrome, Wait, out cc);
                        }
                    }
                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "BYU Mediasite Video",
                                                   video_id,
                                                   title + video_found,
                                                   iframe.Attributes["src"].Value,
                                                   video_length,
                                                   VideoParser.CheckTranscript(iframe),
                                                   cc));
                    }
                }
                else if (iframe.Attributes["src"].Value.Contains("panopto"))
                {
                    string   video_id = iframe.Attributes["src"].Value.CleanSplit("id=").LastOrDefault().CleanSplit("&").FirstOrDefault();
                    TimeSpan video_length;
                    bool     cc;
                    lock (Chrome)
                    {
                        lock (Wait)
                        {
                            video_length = VideoParser.GetPanoptoVideoLength(video_id, Chrome, Wait, out cc);
                        }
                    }
                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "Panopto Video",
                                                   video_id,
                                                   title + video_found,
                                                   iframe.Attributes["src"].Value,
                                                   video_length,
                                                   VideoParser.CheckTranscript(iframe),
                                                   cc));
                    }
                }
                else if (iframe.Attributes["src"].Value.Contains("alexanderstreet"))
                {
                    string   video_id = iframe.Attributes["src"].Value.CleanSplit("token/").LastOrDefault();
                    TimeSpan video_length;
                    bool     cc;
                    lock (Chrome)
                    {
                        lock (Wait)
                        {
                            video_length = VideoParser.GetAlexanderStreetVideoLength(video_id, Chrome, Wait, out cc);
                        }
                    }
                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "AlexanderStreet Video",
                                                   video_id,
                                                   title + video_found,
                                                   iframe.Attributes["src"].Value,
                                                   video_length,
                                                   VideoParser.CheckTranscript(iframe),
                                                   cc));
                    }
                }
                else if (iframe.Attributes["src"].Value.Contains("kanopy"))
                {
                    string   video_id = iframe.Attributes["src"].Value.CleanSplit("embed/").LastOrDefault();
                    TimeSpan video_length;
                    bool     cc;
                    lock (Chrome)
                    {
                        lock (Wait)
                        {
                            video_length = VideoParser.GetKanopyVideoLength(video_id, Chrome, Wait, out cc);
                        }
                    }
                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "Kanopy Video",
                                                   video_id,
                                                   title + video_found,
                                                   iframe.Attributes["src"].Value,
                                                   video_length,
                                                   VideoParser.CheckTranscript(iframe),
                                                   cc));
                    }
                }
                else if (iframe.Attributes["src"].Value.Contains("ambrosevideo"))
                {
                    string   video_id = iframe.Attributes["src"].Value.CleanSplit("?").LastOrDefault().CleanSplit("&")[0];
                    TimeSpan video_length;
                    lock (Chrome)
                    {
                        lock (Wait)
                        {
                            video_length = VideoParser.GetAmbroseVideoLength(video_id, Chrome, Wait);
                        }
                    }
                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "Ambrose Video",
                                                   video_id,
                                                   title + video_found,
                                                   iframe.Attributes["src"].Value,
                                                   video_length,
                                                   VideoParser.CheckTranscript(iframe)));
                    }
                }
                else if (iframe.Attributes["src"].Value.Contains("facebook"))
                {
                    string   video_id = new Regex("\\d{17}").Match(iframe.Attributes["src"].Value).Value;
                    TimeSpan video_length;
                    lock (Chrome)
                    {
                        lock (Wait)
                        {
                            video_length = VideoParser.GetFacebookVideoLength(video_id, Chrome, Wait);
                        }
                    }
                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "Facebook Video",
                                                   video_id,
                                                   title + video_found,
                                                   iframe.Attributes["src"].Value,
                                                   video_length,
                                                   VideoParser.CheckTranscript(iframe)));
                    }
                }
                else if (iframe.Attributes["src"].Value.Contains("dailymotion"))
                {
                    string   video_id = iframe.Attributes["src"].Value.CleanSplit("/").LastOrDefault();
                    TimeSpan video_length;
                    lock (Chrome)
                    {
                        lock (Wait)
                        {
                            video_length = VideoParser.GetDailyMotionVideoLength(video_id, Chrome, Wait);
                        }
                    }
                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "DailyMotion Video",
                                                   video_id,
                                                   title + video_found,
                                                   iframe.Attributes["src"].Value,
                                                   video_length,
                                                   VideoParser.CheckTranscript(iframe)));
                    }
                }
                else if (iframe.Attributes["src"].Value.Contains("vimeo"))
                {
                    string   video_id = iframe.Attributes["src"].Value.CleanSplit("/").LastOrDefault().CleanSplit("?")[0];
                    TimeSpan video_length;
                    lock (Chrome)
                    {
                        lock (Wait)
                        {
                            video_length = VideoParser.GetVimeoVideoLength(video_id, Chrome, Wait);
                        }
                    }
                    string video_found;
                    if (video_length == new TimeSpan(0))
                    {
                        video_found = "\nVideo not found";
                    }
                    else
                    {
                        video_found = "";
                    }
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "Vimeo Video",
                                                   video_id,
                                                   title + video_found,
                                                   iframe.Attributes["src"].Value,
                                                   video_length,
                                                   VideoParser.CheckTranscript(iframe)));
                    }
                }
                else
                {
                    lock (Data)
                    {
                        Data.Add(new PageMediaData(PageDocument.Location,
                                                   "Iframe",
                                                   "",
                                                   title,
                                                   iframe.Attributes["src"].Value,
                                                   new TimeSpan(0),
                                                   true,
                                                   true));
                    }
                }
            }
        }