protected function renderPlayerOrStatus()
    {
        if (!$this->encoding) {
            return $this->renderError('No encoding instance found.');
        }

        switch ($this->encoding->status) {
            case 'complete':
                return $this->renderPlayer();

            case 'error':
                return $this->renderError($this->encoding->message);

            case 'cancelled':
                return $this->renderError('The encoding job was manually cancelled');

            case 'pending':
                return $this->renderProgress('');

            case 'queued':
                return $this->renderProgress($this->encoding->status);

            case 'processing':
                return $this->renderProgress($this->encoding->status);

        }
    }