@@ -709,26 +709,20 @@ export class FFmpegKit {
709709 * into arguments. You can use single or double quote characters to specify arguments inside your command.
710710 *
711711 * @param command FFmpeg command
712- * @param completeCallback callback that will be called when the execution has completed
713- * @param logCallback callback that will receive logs
714- * @param statisticsCallback callback that will receive statistics
715712 * @return FFmpeg session created for this execution
716713 */
717- static async execute ( command , completeCallback , logCallback , statisticsCallback ) {
718- return FFmpegKit . executeWithArguments ( FFmpegKitConfig . parseArguments ( command ) , completeCallback , logCallback , statisticsCallback ) ;
714+ static async execute ( command ) {
715+ return FFmpegKit . executeWithArguments ( FFmpegKitConfig . parseArguments ( command ) ) ;
719716 }
720717
721718 /**
722719 * <p>Synchronously executes FFmpeg with arguments provided.
723720 *
724721 * @param commandArguments FFmpeg command options/arguments as string array
725- * @param completeCallback callback that will be called when the execution has completed
726- * @param logCallback callback that will receive logs
727- * @param statisticsCallback callback that will receive statistics
728722 * @return FFmpeg session created for this execution
729723 */
730- static async executeWithArguments ( commandArguments , completeCallback , logCallback , statisticsCallback ) {
731- let session = await FFmpegSession . create ( commandArguments , completeCallback , logCallback , statisticsCallback ) ;
724+ static async executeWithArguments ( commandArguments ) {
725+ let session = await FFmpegSession . create ( commandArguments , undefined , undefined , undefined ) ;
732726
733727 await FFmpegKitConfig . ffmpegExecute ( session ) ;
734728
@@ -1614,7 +1608,7 @@ class FFmpegKitFactory {
16141608 }
16151609
16161610 static getVersion ( ) {
1617- return "4.5" ;
1611+ return "4.5.1 " ;
16181612 }
16191613
16201614 static getLogRedirectionStrategy ( sessionId ) {
@@ -2055,24 +2049,20 @@ export class FFprobeKit {
20552049 * into arguments. You can use single or double quote characters to specify arguments inside your command.
20562050 *
20572051 * @param command FFprobe command
2058- * @param completeCallback callback that will be called when the execution has completed
2059- * @param logCallback callback that will receive logs
20602052 * @return FFprobe session created for this execution
20612053 */
2062- static async execute ( command , completeCallback , logCallback ) {
2063- return FFprobeKit . executeWithArguments ( FFmpegKitConfig . parseArguments ( command ) , completeCallback , logCallback ) ;
2054+ static async execute ( command ) {
2055+ return FFprobeKit . executeWithArguments ( FFmpegKitConfig . parseArguments ( command ) ) ;
20642056 }
20652057
20662058 /**
20672059 * <p>Synchronously executes FFprobe with arguments provided.
20682060 *
20692061 * @param commandArguments FFprobe command options/arguments as string array
2070- * @param completeCallback callback that will be called when the execution has completed
2071- * @param logCallback callback that will receive logs
20722062 * @return FFprobe session created for this execution
20732063 */
2074- static async executeWithArguments ( commandArguments , completeCallback , logCallback ) {
2075- let session = await FFprobeSession . create ( commandArguments , completeCallback , logCallback ) ;
2064+ static async executeWithArguments ( commandArguments ) {
2065+ let session = await FFprobeSession . create ( commandArguments , undefined , undefined ) ;
20762066
20772067 await FFmpegKitConfig . ffprobeExecute ( session ) ;
20782068
@@ -2118,28 +2108,24 @@ export class FFprobeKit {
21182108 * <p>Extracts media information for the file specified with path.
21192109 *
21202110 * @param path path or uri of a media file
2121- * @param completeCallback callback that will be notified when execution has completed
2122- * @param logCallback callback that will receive logs
21232111 * @param waitTimeout max time to wait until media information is transmitted
21242112 * @return media information session created for this execution
21252113 */
2126- static async getMediaInformation ( path , completeCallback , logCallback , waitTimeout ) {
2114+ static async getMediaInformation ( path , waitTimeout ) {
21272115 const commandArguments = [ "-v" , "error" , "-hide_banner" , "-print_format" , "json" , "-show_format" , "-show_streams" , "-show_chapters" , "-i" , path ] ;
2128- return FFprobeKit . getMediaInformationFromCommandArguments ( commandArguments , completeCallback , logCallback , waitTimeout ) ;
2116+ return FFprobeKit . getMediaInformationFromCommandArguments ( commandArguments , waitTimeout ) ;
21292117 }
21302118
21312119 /**
21322120 * <p>Extracts media information using the command provided. The command passed to
21332121 * this method must generate the output in JSON format in order to successfully extract media information from it.
21342122 *
21352123 * @param command FFprobe command that prints media information for a file in JSON format
2136- * @param completeCallback callback that will be notified when execution has completed
2137- * @param logCallback callback that will receive logs
21382124 * @param waitTimeout max time to wait until media information is transmitted
21392125 * @return media information session created for this execution
21402126 */
2141- static async getMediaInformationFromCommand ( command , completeCallback , logCallback , waitTimeout ) {
2142- return FFprobeKit . getMediaInformationFromCommandArguments ( FFmpegKitConfig . parseArguments ( command ) , completeCallback , logCallback , waitTimeout ) ;
2127+ static async getMediaInformationFromCommand ( command , waitTimeout ) {
2128+ return FFprobeKit . getMediaInformationFromCommandArguments ( FFmpegKitConfig . parseArguments ( command ) , waitTimeout ) ;
21432129 }
21442130
21452131 /**
@@ -2148,16 +2134,19 @@ export class FFprobeKit {
21482134 * from it.
21492135 *
21502136 * @param commandArguments FFprobe command arguments that prints media information for a file in JSON format
2151- * @param completeCallback callback that will be notified when execution has completed
2152- * @param logCallback callback that will receive logs
21532137 * @param waitTimeout max time to wait until media information is transmitted
21542138 * @return media information session created for this execution
21552139 */
2156- static async getMediaInformationFromCommandArguments ( commandArguments , completeCallback , logCallback , waitTimeout ) {
2157- let session = await MediaInformationSession . create ( commandArguments , completeCallback , logCallback ) ;
2140+ static async getMediaInformationFromCommandArguments ( commandArguments , waitTimeout ) {
2141+ let session = await MediaInformationSession . create ( commandArguments , undefined , undefined ) ;
21582142
21592143 await FFmpegKitConfig . getMediaInformationExecute ( session , waitTimeout ) ;
21602144
2145+ const mediaInformation = await FFmpegKitReactNativeModule . getMediaInformation ( session . getSessionId ( ) ) ;
2146+ if ( mediaInformation !== undefined && mediaInformation !== null ) {
2147+ session . setMediaInformation ( new MediaInformation ( mediaInformation ) ) ;
2148+ }
2149+
21612150 return session ;
21622151 }
21632152
@@ -2214,6 +2203,11 @@ export class FFprobeKit {
22142203
22152204 await FFmpegKitConfig . asyncGetMediaInformationExecute ( session , waitTimeout ) ;
22162205
2206+ const mediaInformation = await FFmpegKitReactNativeModule . getMediaInformation ( session . getSessionId ( ) ) ;
2207+ if ( mediaInformation !== undefined && mediaInformation !== null ) {
2208+ session . setMediaInformation ( new MediaInformation ( mediaInformation ) ) ;
2209+ }
2210+
22172211 return session ;
22182212 }
22192213
0 commit comments