# isPrepared

> Returns whether the VideoPlayer has successfully prepared the content to be played.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine.Video](/engine/6000.3/script-reference/unityengine/video.md)
* **Assembly:** UnityEngine.VideoModule

```csharp
public bool isPrepared { get; }
```

### Remarks

A prepared VideoPlayer can play back the content instantly because preliminary parsing and buffering has been done.

A VideoPlayer starts out as not prepared (`false`). To prepare the VideoPlayer, you need to use [VideoPlayer.Prepare](/engine/6000.3/script-reference/unityengine/video/videoplayer/prepare.md). When preparation is done, the VideoPlayer emits the [VideoPlayer.prepareCompleted](/engine/6000.3/script-reference/unityengine/video/videoplayer/preparecompleted.md) event, which sets isPrepared to true.

The property goes back to false when you or the VideoPlayer calls [VideoPlayer.Stop](/engine/6000.3/script-reference/unityengine/video/videoplayer/stop.md).

If there are preparation failures, this property might never be set to true. In this case, Unity sends an error description through the [VideoPlayer.errorReceived](/engine/6000.3/script-reference/unityengine/video/videoplayer/errorreceived.md) event.

Additional Resources: [VideoPlayer.Prepare](/engine/6000.3/script-reference/unityengine/video/videoplayer/prepare.md).

### Examples

```csharp
using UnityEngine;
using UnityEngine.Video;
using System.Collections;

// In the Inspector of your GameObject, attach this script and a VideoPlayer component. 
// Also, assign a VideoClip to your VideoPlayer component.  
// Use this script to prepare a video.  

public class IsPreparedExample : MonoBehaviour
{
    public IEnumerator Start()
    {
        VideoPlayer videoPlayer = GetComponent<VideoPlayer>();
        videoPlayer.Prepare();
        // Loops until the video is ready.
        // Then outputs the message to the console when the preparation is done. 
        while (!videoPlayer.isPrepared)
        {
            yield return null;
        }
        Debug.Log("Preparation completed!");
    }
}
```
