diff --git a/src/MediaEmbed/Data/stubs.php b/src/MediaEmbed/Data/stubs.php index 3b05444..ddada31 100644 --- a/src/MediaEmbed/Data/stubs.php +++ b/src/MediaEmbed/Data/stubs.php @@ -48,7 +48,9 @@ 'name' => 'Facebook', 'website' => 'https://www.facebook.com', 'url-match' => [ - 'https://www.facebook.com/[0-9a-z-_.]+/videos/([0-9]+)/' + 'https://www.facebook.com/[0-9a-z-_.]+/videos/([0-9]+)/', + 'https://www.facebook.com/[0-9a-zA-Z-_.]+/videos/(?:vb.\d+)/(\d+)/', + 'https://www.facebook.com/[0-9a-zA-Z-_.]+/videos/(?:vl.\d+)/(\d+)/' ], 'embed-src' => '//www.facebook.com/video/embed?video_id=$2', 'embed-width' => '480', diff --git a/src/MediaEmbed/Object/MediaObject.php b/src/MediaEmbed/Object/MediaObject.php index ae4bd30..4ce1bcf 100644 --- a/src/MediaEmbed/Object/MediaObject.php +++ b/src/MediaEmbed/Object/MediaObject.php @@ -114,6 +114,9 @@ public function stub($property = null, $value = null) { if ($value === null) { return isset($this->_stub[$property]) ? $this->_stub[$property] : null; } + if(!empty($property) && !empty($value)){ + $this->_stub[$property] = $value; + } return $this; } diff --git a/tests/MediaEmbed/MediaEmbedTest.php b/tests/MediaEmbed/MediaEmbedTest.php index 086a87d..4c660c2 100644 --- a/tests/MediaEmbed/MediaEmbedTest.php +++ b/tests/MediaEmbed/MediaEmbedTest.php @@ -21,6 +21,8 @@ class MediaEmbedTest extends \PHPUnit_Framework_TestCase { 'http://youtu.be/MKlq4gQKtU0' => 'MKlq4gQKtU0', 'https://www.facebook.com/mega90er/videos/1309058692443747/' => '1309058692443747', 'https://www.facebook.com/diginights.HN/videos/1231155290281511/' => '1231155290281511', + 'https://www.facebook.com/SkySports/videos/vb.10911153761/10153310275743762/?type=2&theater' => '10153310275743762', + 'https://www.facebook.com/demotivateurFood/videos/vl.184872862011827/1034411179983244/?type=1' => '1034411179983244', // Not yet possible //'https://www.youtube.com/playlist?list=PLD1FA4687572EDB23' => 'PLD1FA4687572EDB23',