Skip to content

Commit dcc117f

Browse files
authored
ios player provide duration on prepare (react-native-audio-toolkit#225)
1 parent ceaed43 commit dcc117f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ios/ReactNativeAudioToolkit/ReactNativeAudioToolkit/AudioPlayer.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ - (NSURL *)findUrlForPath:(NSString *)path {
232232
// Callback when ready / failed
233233
if (player.currentItem.status == AVPlayerStatusReadyToPlay) {
234234
player.automaticallyWaitsToMinimizeStalling = false;
235-
callback(@[[NSNull null]]);
235+
callback(@[[NSNull null],@{@"duration": @(CMTimeGetSeconds(player.currentItem.asset.duration) * 1000)}]);
236236
} else {
237237
NSDictionary* dict = [Helpers errObjWithCode:@"preparefail"
238238
withMessage:[NSString stringWithFormat:@"Preparing player failed"]];

0 commit comments

Comments
 (0)