melon.yin 2 жил өмнө
parent
commit
c101ecdd11

+ 0 - 1
lib/async_vid/vid_data.dart

@@ -105,7 +105,6 @@ abstract class AsyncVidImageDataBase {
     _reader.close();
     _reader.close();
   }
   }
 
 
-  @protected
   T getReader<T extends AsyncVidDataReaderBase>() => _reader as T;
   T getReader<T extends AsyncVidDataReaderBase>() => _reader as T;
 
 
   ///Read header from http data.
   ///Read header from http data.

+ 15 - 0
lib/data_channel/channel.dart

@@ -84,6 +84,21 @@ abstract class VidDataChannel {
     }
     }
   }
   }
 
 
+  ///获取缓冲量
+  int getBufferSize() {
+    return source!.getReader().downloadedSize;
+  }
+
+  /// 获取文件尺寸
+  int getFileSize() {
+    return source!.getReader().totalSize;
+  }
+
+  /// 是否缓冲完成
+  bool get isBufferedDone {
+    return getBufferSize() >= getFileSize();
+  }
+
   VidUsProbe get probe => source!.probe;
   VidUsProbe get probe => source!.probe;
   int get imageCount => source!.imageCount;
   int get imageCount => source!.imageCount;
   VidUsImageFormat get imageFormat => source!.imageFormat;
   VidUsImageFormat get imageFormat => source!.imageFormat;