提交 02f6cb44 编写于 作者: Y Yuvesy

硬解缓冲字节数

上级 5e808634
......@@ -59,6 +59,8 @@
@synthesize playableDuration;
@synthesize bufferingProgress = _bufferingProgress;
@synthesize numberOfBytesTransferred = _numberOfBytesTransferred;
@synthesize isPreparedToPlay = _isPreparedToPlay;
@synthesize playbackState = _playbackState;
@synthesize loadState = _loadState;
......
......@@ -47,6 +47,7 @@
@dynamic currentPlaybackRate;
@dynamic initialPlaybackTime;
@dynamic endPlaybackTime;
@synthesize numberOfBytesTransferred = _numberOfBytesTransferred;
- (id)initWithContentURL:(NSURL *)aUrl
{
......@@ -79,6 +80,7 @@
default:
return NO;
}
}
- (void)shutdown
......@@ -86,6 +88,16 @@
// do nothing
}
-(int64_t)numberOfBytesTransferred
{
NSArray *events = self.accessLog.events;
if (events.count>0) {
MPMovieAccessLogEvent *currentEvent = [events objectAtIndex:events.count -1];
return currentEvent.numberOfBytesTransferred;
}
return 0;
}
- (UIImage *)thumbnailImageAtCurrentTime
{
return [super thumbnailImageAtTime:self.currentPlaybackTime timeOption:MPMovieTimeOptionExact];
......
......@@ -51,6 +51,8 @@
@property(nonatomic, readonly) CGSize naturalSize;
@property(nonatomic, readonly) int64_t numberOfBytesTransferred;
// deprecated, for MPMoviePlayerController compatiable
// no effect for IJKFFMoviePlayerController
- (UIImage *)thumbnailImageAtTime:(NSTimeInterval)playbackTime timeOption:(MPMovieTimeOption)option;
......@@ -79,6 +81,8 @@ IJK_EXTERN NSString *const IJKMoviePlayerLoadStateDidChangeNotification;
IJK_EXTERN NSString *const IJKMoviePlayerPlaybackDidFinishNotification;
IJK_EXTERN NSString *const IJKMoviePlayerPlaybackStateDidChangeNotification;
IJK_EXTERN NSString *const IJKMoviePlayerNumberOfBytesTransferredNotification;
@end
#pragma mark IJKMediaResource
......
......@@ -27,3 +27,5 @@ NSString *const IJKMediaPlaybackIsPreparedToPlayDidChangeNotification = @"IJKMed
NSString *const IJKMoviePlayerLoadStateDidChangeNotification = @"IJKMoviePlayerLoadStateDidChangeNotification";
NSString *const IJKMoviePlayerPlaybackDidFinishNotification = @"IJKMoviePlayerPlaybackDidFinishNotification";
NSString *const IJKMoviePlayerPlaybackStateDidChangeNotification = @"IJKMoviePlayerPlaybackStateDidChangeNotification";
NSString *const IJKMoviePlayerNumberOfBytesTransferredNotification = @"IJKMoviePlayerNumberOfBytesTransferredNotification";
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册