Skip to content

Commit 44dd409

Browse files
author
raymondzheng
committed
ijkplayer-ios: distinction between normal buffering and seek buffering
1 parent bc18a6e commit 44dd409

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

ios/IJKMediaPlayer/IJKMediaPlayer/IJKFFMoviePlayerController.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ @implementation IJKFFMoviePlayerController {
9999

100100
@synthesize monitor = _monitor;
101101
@synthesize shouldShowHudView = _shouldShowHudView;
102+
@synthesize isSeekBuffering = _isSeekBuffering;
102103

103104
#define FFP_IO_STAT_STEP (50 * 1024)
104105

@@ -1180,10 +1181,12 @@ - (void)postEvent: (IJKFFMoviePlayerMessage *)msg
11801181
_monitor.lastPrerollStartTick = (int64_t)SDL_GetTickHR();
11811182

11821183
_loadState = IJKMPMovieLoadStateStalled;
1184+
_isSeekBuffering = avmsg->arg1;
11831185

11841186
[[NSNotificationCenter defaultCenter]
11851187
postNotificationName:IJKMPMoviePlayerLoadStateDidChangeNotification
11861188
object:self];
1189+
_isSeekBuffering = 0;
11871190
break;
11881191
}
11891192
case FFP_MSG_BUFFERING_END: {
@@ -1192,13 +1195,15 @@ - (void)postEvent: (IJKFFMoviePlayerMessage *)msg
11921195
_monitor.lastPrerollDuration = (int64_t)SDL_GetTickHR() - _monitor.lastPrerollStartTick;
11931196

11941197
_loadState = IJKMPMovieLoadStatePlayable | IJKMPMovieLoadStatePlaythroughOK;
1198+
_isSeekBuffering = avmsg->arg1;
11951199

11961200
[[NSNotificationCenter defaultCenter]
11971201
postNotificationName:IJKMPMoviePlayerLoadStateDidChangeNotification
11981202
object:self];
11991203
[[NSNotificationCenter defaultCenter]
12001204
postNotificationName:IJKMPMoviePlayerPlaybackStateDidChangeNotification
12011205
object:self];
1206+
_isSeekBuffering = 0;
12021207
break;
12031208
}
12041209
case FFP_MSG_BUFFERING_UPDATE:

ios/IJKMediaPlayer/IJKMediaPlayer/IJKMediaPlayback.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ typedef NS_ENUM(NSInteger, IJKMPMovieTimeOption) {
8484
@property(nonatomic, readonly) BOOL isPreparedToPlay;
8585
@property(nonatomic, readonly) IJKMPMoviePlaybackState playbackState;
8686
@property(nonatomic, readonly) IJKMPMovieLoadState loadState;
87+
@property(nonatomic, readonly) int isSeekBuffering;
8788

8889
@property(nonatomic, readonly) int64_t numberOfBytesTransferred;
8990

0 commit comments

Comments
 (0)