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()); }
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); }