예제 #1
0
        public MainWindow()
        {
            InitializeComponent();
            var       zipRepertory  = new ZipRepertory();
            var       filename      = @"F:\Work\bak\9月-2无logo.zip";
            VlcStream CurrentStream = zipRepertory.GetVideoStream(filename, ZipHashCode.HashKey);

            VlcHelper.Initialize(VlcPlayer);
            VlcPlayer.SourceProvider.MediaPlayer.Play(CurrentStream.Stream.Entries.FirstOrDefault(CurrentStream.check).OpenEntryStream());
        }
예제 #2
0
        public VlcStream GetVideoStream(string path)
        {
            var stream = File.OpenRead(path);
            var option = new ReaderOptions
            {
                LeaveStreamOpen = true,
                ArchiveEncoding = new ArchiveEncoding()
                {
                    Default = Encoding.UTF8
                }
            };
            var       archive = ZipArchive.Open(stream, option);
            VlcStream temp    = new VlcStream();

            temp.Stream     = archive;
            temp.ZipPath    = path;
            temp.Option     = option;
            temp.check      = entity => IsImage(Path.GetExtension(entity.Key));
            temp.fileStream = stream;
            return(temp);
        }