/// <summary>
        /// Reads the header boxes for the video, which includes 
        /// ftyp, pdin, bloc, moov, and the optional mdat.
        /// </summary>
        /// <param name="callback"></param>
        private async Task ReadMovieHeaderBoxes()
        {
            var moov = await this.GetBox(BoxType.Moov);
            this.Boxes.Add(moov);

            // See if we have an mdat next and grab it if we do
            var stream = await WebRequestor.GetStreamRangeAsync(this.fileUri, this.fileOffset, this.fileOffset + 8);
            using (var reader = new BoxBinaryReader(stream))
            {
                if (reader.PeekNextBoxType() == BoxType.Mdat)
                {
                    var mdat = await this.GetNextBox();
                    this.Boxes.Add(mdat);
                }
            }
        }
        /// <summary>
        /// Opens a local (offline) file and initializes the CFF data that can be used for 
        /// manifest generation.
        /// </summary>
        /// <param name="path">The file URI of the resource to be opened. i.e. ms-appx:////Big_Buck_Bunny.uvu </param>
        public override async Task Parse(Uri path)
        {
            if (StorageFile == null)
            {
                StorageFile = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(path);
            }

            using (var fileStream = await StorageFile.OpenStreamForReadAsync())
            {
                var reader = new BoxBinaryReader(fileStream);
                Box box = null;

                do
                {
                    box = reader.ReadNextBox();

                    if (box != null)
                    {
                        this.Boxes.Add(box);

                        if (box.Type == BoxType.Moov)
                        {
                            // There may be an mdat after the moov, if so parse it
                            if (reader.PeekNextBoxType() == BoxType.Mdat)
                            {
                                box = reader.ReadNextBox();
                                this.Boxes.Add(box);
                            }

                            // After parsing the moov and optional mdat after it, skip to the mfra
                            // this will jump past the moof and mdats which we don't need to process
                            reader.GotoMovieFragmentRandomAccess();
                        }
                    }
                } while (box != null);
            }

            this.InitializeTrackRegistry();
        }