Example #1
0
        public Flv(FileInfo file, bool generateMetadata)
        {
            this._file             = file;
            this._generateMetadata = generateMetadata;
            int num = 0;

            if (!this._generateMetadata)
            {
                try
                {
                    FlvReader reader = new FlvReader(this._file);
                    ITag      tag    = null;
                    while (reader.HasMoreTags() && (++num < 5))
                    {
                        tag = reader.ReadTag();
                        if (tag.DataType == IOConstants.TYPE_METADATA)
                        {
                            if (this._metaService == null)
                            {
                                this._metaService = new FluorineFx.IO.FLV.MetaService(this._file);
                            }
                            this._metaData = this._metaService.ReadMetaData(tag.Body);
                        }
                    }
                    reader.Close();
                }
                catch (Exception exception)
                {
                    log.Error("An error occured looking for metadata:", exception);
                }
            }
        }
Example #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
                }
            }
        }
Example #3
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 LOGGING && !SILVERLIGHT
                    log.Error("An error occured looking for metadata:", ex);
#endif
                }
            }
        }