Esempio n. 1
0
        public Flv(FileInfo file, bool generateMetadata)
        {
            _file = file;
            _generateMetadata = generateMetadata;
            int count = 0;

            if (!_generateMetadata)
            {
                try
                {
                    FlvReader reader = new FlvReader(_file);
                    ITag tag = null;
                    while (reader.HasMoreTags() && (++count < 5))
                    {
                        tag = reader.ReadTag();
                        if (tag.DataType == IOConstants.TYPE_METADATA)
                        {
                            if (_metaService == null) _metaService = new MetaService(_file);
                            _metaData = _metaService.ReadMetaData(tag.Body);
                        }
                    }
                    reader.Close();
                }
                catch (Exception ex)
                {
#if !SILVERLIGHT
                    log.Error("An error occured looking for metadata:", ex);
#endif
                }
            }
        }
Esempio n. 2
0
        public Flv(FileInfo file, bool generateMetadata)
        {
            _file             = file;
            _generateMetadata = generateMetadata;
            int count = 0;

            if (!_generateMetadata)
            {
                try
                {
                    FlvReader reader = new FlvReader(_file);
                    ITag      tag    = null;
                    while (reader.HasMoreTags() && (++count < 5))
                    {
                        tag = reader.ReadTag();
                        if (tag.DataType == IOConstants.TYPE_METADATA)
                        {
                            if (_metaService == null)
                            {
                                _metaService = new MetaService(_file);
                            }
                            _metaData = _metaService.ReadMetaData(tag.Body);
                        }
                    }
                    reader.Close();
                }
                catch (Exception ex)
                {
#if !SILVERLIGHT
                    log.Error("An error occured looking for metadata:", ex);
#endif
                }
            }
        }