/** * Performs the initial request to load the video details * @param {string} $url Vidyard Video URL * @param {File} $file File Object */ public function __construct($url, $file = null) { HtmlEditorField_File::__construct($url, $file); $this->oembed = Vidyard::get_video_from_url($this->url); if (!$this->oembed) { $controller = Controller::curr(); $controller->response->addHeader('X-Status', rawurlencode(_t('HtmlEditorField.URLNOTANOEMBEDRESOURCE', "The URL '{url}' could not be turned into a media resource.", "The given URL is not a valid Vidyard video; the embed element couldn't be created.", array('url' => $url)))); $controller->response->setStatusCode(404); throw new SS_HTTPResponse_Exception($controller->response); } }