Merge pull request #339 from superandrew213/development-react-native
Handle sessionId not defined case in cancel method of AbstractSession
This commit is contained in:
commit
fd351b78c2
7
react-native/src/index.js
vendored
7
react-native/src/index.js
vendored
|
@ -669,11 +669,12 @@ export class AbstractSession extends Session {
|
|||
}
|
||||
|
||||
/**
|
||||
* Cancels running the session.
|
||||
* Cancels running the session. Only starts cancellation. Does not guarantee that session is cancelled when promise resolves.
|
||||
*/
|
||||
cancel() {
|
||||
async cancel() {
|
||||
const sessionId = this.getSessionId();
|
||||
if (sessionId === undefined) {
|
||||
return FFmpegKitReactNativeModule.cancel();
|
||||
return Promise.reject(new Error('sessionId is not defined'));
|
||||
} else {
|
||||
return FFmpegKitReactNativeModule.cancelSession(sessionId);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user