fix toSessionDictionary method on ios
This commit is contained in:
parent
a3e235ca70
commit
f4817dad4d
|
@ -1144,16 +1144,18 @@ public class FFmpegKitReactNativeModule extends ReactContextBaseJavaModule imple
|
|||
}
|
||||
|
||||
protected static WritableMap toMap(final MediaInformation mediaInformation) {
|
||||
WritableMap map = Arguments.createMap();
|
||||
|
||||
if (mediaInformation != null) {
|
||||
WritableMap map = Arguments.createMap();
|
||||
|
||||
JSONObject allProperties = mediaInformation.getAllProperties();
|
||||
if (allProperties != null) {
|
||||
map = toMap(allProperties);
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
return map;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected static WritableMap toMap(final JSONObject jsonObject) {
|
||||
|
|
|
@ -724,16 +724,14 @@ RCT_EXPORT_METHOD(getExternalLibraries:(RCTPromiseResolveBlock)resolve rejecter:
|
|||
dictionary[KEY_SESSION_START_TIME] = [NSNumber numberWithDouble:[[session getStartTime] timeIntervalSince1970]*1000];
|
||||
dictionary[KEY_SESSION_COMMAND] = [session getCommand];
|
||||
|
||||
if ([session isFFprobe]) {
|
||||
if ([session isMediaInformation]) {
|
||||
MediaInformationSession *mediaInformationSession = (MediaInformationSession*)session;
|
||||
dictionary[KEY_SESSION_MEDIA_INFORMATION] = [FFmpegKitReactNativeModule toMediaInformationDictionary:[mediaInformationSession getMediaInformation]];
|
||||
dictionary[KEY_SESSION_TYPE] = [NSNumber numberWithInt:SESSION_TYPE_MEDIA_INFORMATION];
|
||||
} else {
|
||||
dictionary[KEY_SESSION_TYPE] = [NSNumber numberWithInt:SESSION_TYPE_FFPROBE];
|
||||
}
|
||||
} else {
|
||||
if ([session isFFmpeg]) {
|
||||
dictionary[KEY_SESSION_TYPE] = [NSNumber numberWithInt:SESSION_TYPE_FFMPEG];
|
||||
} else if ([session isFFprobe]) {
|
||||
dictionary[KEY_SESSION_TYPE] = [NSNumber numberWithInt:SESSION_TYPE_FFPROBE];
|
||||
} else if ([session isMediaInformation]) {
|
||||
MediaInformationSession *mediaInformationSession = (MediaInformationSession*)session;
|
||||
dictionary[KEY_SESSION_MEDIA_INFORMATION] = [FFmpegKitReactNativeModule toMediaInformationDictionary:[mediaInformationSession getMediaInformation]];
|
||||
dictionary[KEY_SESSION_TYPE] = [NSNumber numberWithInt:SESSION_TYPE_MEDIA_INFORMATION];
|
||||
}
|
||||
|
||||
return dictionary;
|
||||
|
|
Loading…
Reference in New Issue
Block a user