Skip to content

Commit 1274339

Browse files
committed
Fixed code generation in OpenGraph
1 parent 8f429cf commit 1274339

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Embed/Providers/OpenGraph.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ public function getCode()
8585
case 'ogg':
8686
case 'ogv':
8787
case 'webm':
88-
return Viewers::videoHtml($this->getImage(), $this->get('video'), $this->getWidth(), $this->getHeight());
88+
$image = $this->getImage();
89+
90+
if (is_array($image)) {
91+
$image = current($image);
92+
}
93+
94+
return Viewers::videoHtml($image, $this->get('video'), $this->getWidth(), $this->getHeight());
8995
}
9096
}
9197

@@ -98,7 +104,13 @@ public function getCode()
98104
case 'video/ogg':
99105
case 'video/ogv':
100106
case 'video/webm':
101-
return Viewers::videoHtml($this->getImage(), $this->get('video'), $this->getWidth(), $this->getHeight());
107+
$image = $this->getImage();
108+
109+
if (is_array($image)) {
110+
$image = current($image);
111+
}
112+
113+
return Viewers::videoHtml($image, $this->get('video'), $this->getWidth(), $this->getHeight());
102114
}
103115
}
104116
}

0 commit comments

Comments
 (0)