---
title: loadKey
framework: tvmljs
role: symbol
role_heading: Instance Property
path: tvmljs/mediaitem/1627379-loadkey
---

# loadKey

A callback function used to load the security key for an item.

## Declaration

```data
readonly attribute Object loadKey;
```

## Discussion

Discussion This attribute must be set if FairPlay Streaming is supported. The callback function must return either the asset identifier that was retrieved or null. This attribute must be assigned to a function that takes three parameters, url, requestData, and callback. For example, item.loadKey = function getKey(url, requestData, callback) {}.  The callback function must be called with the following three parameters: The key value. A renewal date, if any. If you don’t specify a renewal date, the key will not expire until the playback ends. An error parameter.

## See Also

### Supporting FairPlay Streaming

- [loadAssetID](tvmljs/mediaitem/1627392-loadassetid.md)
- [loadCertificate](tvmljs/mediaitem/1627435-loadcertificate.md)
