---
title: makeCaptureSession()
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: browserenginekit/mediaenvironment/makecapturesession()
---

# makeCaptureSession()

Creates a new capture session in this media environment  or throws an error if it can not be created.

## Declaration

```swift
func makeCaptureSession() throws -> AVCaptureSession
```

## Discussion

Discussion The media environment must be activated before the capture session can be started.

## See Also

### Capturing media streams

- [activate()](browserenginekit/mediaenvironment/activate().md)
- [suspend()](browserenginekit/mediaenvironment/suspend().md)
