Esempio n. 1
0
        /// <summary>
        /// Open all files associated with the ISM.
        /// </summary>
        /// <param name="inPath">path name to ISM file without extension</param>
        public override void Open(string inPath, bool withCaching)
        {
            _mainFolderPath = Path.GetDirectoryName(inPath);
            _ismFile        = new ISMFile(_mainFolderPath, Path.GetFileNameWithoutExtension(inPath));
            foreach (ISMElement element in _ismFile.ISMElements)
            {
                GenericMediaTrack ismTrack = null;
                if (element.FragmentType == FragmentType.Video)
                {
                    ismTrack = new ISMVideoTrack(new ISMVTrackFormat(_mainFolderPath, element.Source, element), this);
                }
                else if (element.FragmentType == FragmentType.Audio)
                {
                    ismTrack = new ISMAudioTrack(new ISMVTrackFormat(_mainFolderPath, element.Source, element), this);
                }
                MediaTracks.Add(ismTrack);

                // choose longest track duration to be stream duration
                if (DurationIn100NanoSecs < ismTrack.TrackDurationIn100NanoSecs)
                {
                    DurationIn100NanoSecs = ismTrack.TrackDurationIn100NanoSecs;
                }
            }

            CachingEnabled = withCaching;
        }
Esempio n. 2
0
        /// <summary>
        /// Open all files associated with the ISM.
        /// </summary>
        /// <param name="inPath">path name to ISM file without extension</param>
        public override void Open(string inPath, bool withCaching)
        {
            _mainFolderPath = Path.GetDirectoryName(inPath);
              _ismFile = new ISMFile(_mainFolderPath, Path.GetFileNameWithoutExtension(inPath));
              foreach (ISMElement element in _ismFile.ISMElements)
              {
            GenericMediaTrack ismTrack = null;
            if (element.FragmentType == FragmentType.Video)
            {
              ismTrack = new ISMVideoTrack(new ISMVTrackFormat(_mainFolderPath, element.Source, element), this);
            }
            else if (element.FragmentType == FragmentType.Audio)
            {
              ismTrack = new ISMAudioTrack(new ISMVTrackFormat(_mainFolderPath, element.Source, element), this);
            }
            MediaTracks.Add(ismTrack);

            // choose longest track duration to be stream duration
            if (DurationIn100NanoSecs < ismTrack.TrackDurationIn100NanoSecs)
              DurationIn100NanoSecs = ismTrack.TrackDurationIn100NanoSecs;
              }

              CachingEnabled = withCaching;
        }