Loading core/modules/media/src/OEmbed/Resource.php +6 −6 Original line number Diff line number Diff line Loading @@ -236,7 +236,7 @@ public static function link($url = NULL, Provider $provider = NULL, $title = NUL * @param int $width * The width of the photo, in pixels. * @param int $height * The height of the photo, in pixels. * (optional) The height of the photo, in pixels. * @param \Drupal\media\OEmbed\Provider $provider * (optional) The resource provider. * @param string $title Loading @@ -260,7 +260,7 @@ public static function link($url = NULL, Provider $provider = NULL, $title = NUL * * @return static */ public static function photo($url, $width, $height, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { public static function photo($url, $width, $height = NULL, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { if (empty($url)) { throw new \InvalidArgumentException('Photo resources must provide a URL.'); } Loading @@ -280,7 +280,7 @@ public static function photo($url, $width, $height, Provider $provider = NULL, $ * @param int $width * The width of the resource, in pixels. * @param int $height * The height of the resource, in pixels. * (optional) The height of the resource, in pixels. * @param \Drupal\media\OEmbed\Provider $provider * (optional) The resource provider. * @param string $title Loading @@ -304,7 +304,7 @@ public static function photo($url, $width, $height, Provider $provider = NULL, $ * * @return static */ public static function rich($html, $width, $height, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { public static function rich($html, $width, $height = NULL, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { if (empty($html)) { throw new \InvalidArgumentException('The resource must provide an HTML representation.'); } Loading @@ -325,7 +325,7 @@ public static function rich($html, $width, $height, Provider $provider = NULL, $ * @param int $width * The width of the video, in pixels. * @param int $height * The height of the video, in pixels. * (optional) The height of the video, in pixels. * @param \Drupal\media\OEmbed\Provider $provider * (optional) The resource provider. * @param string $title Loading @@ -349,7 +349,7 @@ public static function rich($html, $width, $height, Provider $provider = NULL, $ * * @return static */ public static function video($html, $width, $height, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { public static function video($html, $width, $height = NULL, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { $resource = static::rich($html, $width, $height, $provider, $title, $author_name, $author_url, $cache_age, $thumbnail_url, $thumbnail_width, $thumbnail_height); $resource->type = self::TYPE_VIDEO; Loading core/modules/media/tests/fixtures/oembed/rich_twitter.json +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ "author_url": "https:\/\/twitter.com\/drupaldevdays", "html": "<h1>By the power of Grayskull, Twitter works!</h1>", "width": 550, "height": 360, "height": null, "type": "rich", "cache_age": "3153600000", "provider_name": "Twitter", Loading core/modules/media/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php +5 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,11 @@ public function providerRender() { 'tweet' => [ 'https://twitter.com/drupaldevdays/status/935643039741202432', 'rich_twitter.json', [], [ // The tweet resource does not specify a height, so the formatter // should default to the configured maximum height. 'max_height' => 360, ], [ 'iframe' => [ 'src' => '/media/oembed?url=https%3A//twitter.com/drupaldevdays/status/935643039741202432', Loading Loading
core/modules/media/src/OEmbed/Resource.php +6 −6 Original line number Diff line number Diff line Loading @@ -236,7 +236,7 @@ public static function link($url = NULL, Provider $provider = NULL, $title = NUL * @param int $width * The width of the photo, in pixels. * @param int $height * The height of the photo, in pixels. * (optional) The height of the photo, in pixels. * @param \Drupal\media\OEmbed\Provider $provider * (optional) The resource provider. * @param string $title Loading @@ -260,7 +260,7 @@ public static function link($url = NULL, Provider $provider = NULL, $title = NUL * * @return static */ public static function photo($url, $width, $height, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { public static function photo($url, $width, $height = NULL, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { if (empty($url)) { throw new \InvalidArgumentException('Photo resources must provide a URL.'); } Loading @@ -280,7 +280,7 @@ public static function photo($url, $width, $height, Provider $provider = NULL, $ * @param int $width * The width of the resource, in pixels. * @param int $height * The height of the resource, in pixels. * (optional) The height of the resource, in pixels. * @param \Drupal\media\OEmbed\Provider $provider * (optional) The resource provider. * @param string $title Loading @@ -304,7 +304,7 @@ public static function photo($url, $width, $height, Provider $provider = NULL, $ * * @return static */ public static function rich($html, $width, $height, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { public static function rich($html, $width, $height = NULL, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { if (empty($html)) { throw new \InvalidArgumentException('The resource must provide an HTML representation.'); } Loading @@ -325,7 +325,7 @@ public static function rich($html, $width, $height, Provider $provider = NULL, $ * @param int $width * The width of the video, in pixels. * @param int $height * The height of the video, in pixels. * (optional) The height of the video, in pixels. * @param \Drupal\media\OEmbed\Provider $provider * (optional) The resource provider. * @param string $title Loading @@ -349,7 +349,7 @@ public static function rich($html, $width, $height, Provider $provider = NULL, $ * * @return static */ public static function video($html, $width, $height, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { public static function video($html, $width, $height = NULL, Provider $provider = NULL, $title = NULL, $author_name = NULL, $author_url = NULL, $cache_age = NULL, $thumbnail_url = NULL, $thumbnail_width = NULL, $thumbnail_height = NULL) { $resource = static::rich($html, $width, $height, $provider, $title, $author_name, $author_url, $cache_age, $thumbnail_url, $thumbnail_width, $thumbnail_height); $resource->type = self::TYPE_VIDEO; Loading
core/modules/media/tests/fixtures/oembed/rich_twitter.json +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ "author_url": "https:\/\/twitter.com\/drupaldevdays", "html": "<h1>By the power of Grayskull, Twitter works!</h1>", "width": 550, "height": 360, "height": null, "type": "rich", "cache_age": "3153600000", "provider_name": "Twitter", Loading
core/modules/media/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php +5 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,11 @@ public function providerRender() { 'tweet' => [ 'https://twitter.com/drupaldevdays/status/935643039741202432', 'rich_twitter.json', [], [ // The tweet resource does not specify a height, so the formatter // should default to the configured maximum height. 'max_height' => 360, ], [ 'iframe' => [ 'src' => '/media/oembed?url=https%3A//twitter.com/drupaldevdays/status/935643039741202432', Loading