---
title: "initWithXPCRepresentation:error:"
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: "browserenginekit/bemediaenvironment-n91a/initwithxpcrepresentation:error:"
---

# initWithXPCRepresentation:error:

Creates a media session from an XPC object.

## Declaration

```occ
- (instancetype) initWithXPCRepresentation:(xpc_object_t) xpcRepresentation error:(NSError **) error;
```

## Parameters

- `xpcRepresentation`: A representation of a media environment the app receives through XPC.
- `error`: A pointer to an error object that describes why the method failed, or nil if no error occurred. Pass nil to ignore the error.

## See Also

### Managing media life cycle

- [initWithWebPageURL:](browserenginekit/bemediaenvironment-n91a/initwithwebpageurl:.md)
- [activateWithError:](browserenginekit/bemediaenvironment-n91a/activatewitherror:.md)
- [suspendWithError:](browserenginekit/bemediaenvironment-n91a/suspendwitherror:.md)
