private List <Chapter> fetchChapters(AVAsset asset)
        {
            List <Chapter> chapters = new List <Chapter>();

            string[]      preferred = NSLocale.PreferredLanguages;
            List <string> languages = new List <string>(preferred);

            languages.AddRange(asset.AvailableChapterLocales.Select(locale => locale.Identifier));

            AVTimedMetadataGroup[] groups = asset.GetChapterMetadataGroupsBestMatchingPreferredLanguages(languages.ToArray());
            foreach (AVTimedMetadataGroup group in groups)
            {
                AVMetadataItem[] item = AVMetadataItem.FilterWithKey(group.Items, NSObject.FromObject("title"), AVMetadata.KeySpaceCommon);
                if ((item != null) && (item.Length > 0))
                {
                    Chapter newChapter = new Chapter();
                    newChapter.StartTime = item[0].Time.Seconds;
                    if (item[0].StringValue == "Video")
                    {
                        newChapter.Type = ChapterType.Video;
                    }
                    else if (item[0].StringValue == "Advertisement")
                    {
                        newChapter.Type = ChapterType.Advertisement;
                    }
                    else
                    {
                        newChapter.Type = ChapterType.Unknown;
                    }

                    chapters.Add(newChapter);
                }
            }

            return(chapters);
        }