Skip to content

Commit

Permalink
ijkplayer-ios: report filesize
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondzheng committed Jan 24, 2018
1 parent 689eb69 commit fcaa4a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions ios/IJKMediaPlayer/IJKMediaPlayer/IJKFFMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
@property(nonatomic) int httpSeekCount;
@property(nonatomic) int64_t lastHttpOpenDuration;
@property(nonatomic) int64_t lastHttpSeekDuration;
@property(nonatomic) int64_t filesize;

@property(nonatomic) int64_t prepareStartTick;
@property(nonatomic) int64_t prepareDuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1481,6 +1481,7 @@ static int onInjectOnHttpEvent(IJKFFMoviePlayerController *mpc, int type, void *
elapsed = calculateElapsed(monitor.httpOpenTick, SDL_GetTickHR());
monitor.httpError = realData->error;
monitor.httpCode = realData->http_code;
monitor.filesize = realData->filesize;
monitor.httpOpenCount++;
monitor.httpOpenTick = 0;
monitor.lastHttpOpenDuration = elapsed;
Expand All @@ -1492,6 +1493,7 @@ static int onInjectOnHttpEvent(IJKFFMoviePlayerController *mpc, int type, void *
dict[IJKMediaEventAttrKey_host] = [NSString ijk_stringBeEmptyIfNil:host];
dict[IJKMediaEventAttrKey_error] = @(realData->error).stringValue;
dict[IJKMediaEventAttrKey_http_code] = @(realData->http_code).stringValue;
dict[IJKMediaEventAttrKey_file_size] = @(realData->filesize).stringValue;
[delegate invoke:type attributes:dict];
}
break;
Expand Down
1 change: 1 addition & 0 deletions ios/IJKMediaPlayer/IJKMediaPlayer/IJKMediaPlayback.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ typedef NS_ENUM(NSInteger, IJKMediaEvent) {
#define IJKMediaEventAttrKey_time_of_event @"time_of_event"
#define IJKMediaEventAttrKey_http_code @"http_code"
#define IJKMediaEventAttrKey_offset @"offset"
#define IJKMediaEventAttrKey_file_size @"file_size"

// event of IJKMediaUrlOpenEvent_xxx
@interface IJKMediaUrlOpenData: NSObject
Expand Down

0 comments on commit fcaa4a5

Please sign in to comment.