---
title: "cancel(forPause:)"
framework: Professional Video Applications
role: symbol
role_heading: Instance Method
platforms: [provideo encoder extensions 1.0+]
path: "professional_video_applications/compressorextensionencoder/cancel(forpause:)"
---

# cancel(forPause:)

Pauses or cancels an encoding job.

## Declaration

```swift
func cancel(forPause: Bool) -> [AnyHashable : Any]!
```

## Parameters

- `forPause`: When set to true, pauses an encoding job. When set to false, cancels the job.

## Return Value

Return Value nil if the extension does not support resuming a job where it left off. Otherwise, it returns a dictionary with attributes defining the extension’s paused state.

## Discussion

Discussion Implement this method to pause or cancel an encoding job when the Compressor app requests to do so. If the extension supports resuming from a paused state, return the extension’s current state to the Compressor app. If the extension returns nil, an encoding job starts from the beginning when it resumes at a later point.

## See Also

### Canceling or Pausing the Encoding Process

- [setStateFromPause(_:)](professional_video_applications/compressorextensionencoder/setstatefrompause(_:).md)
- [percentLostOnPause()](professional_video_applications/compressorextensionencoder/percentlostonpause().md)
