| @@ 14-22 (lines=9) @@ | ||
| 11 | $html = $node->ownerDocument->saveXML($node); |
|
| 12 | ||
| 13 | // youtube or vimeo |
|
| 14 | if (preg_match('~//www.youtube.com/embed/([^/\?]+).*\"~si', $html, $matches)) { |
|
| 15 | return array( |
|
| 16 | 'type' => 'video', |
|
| 17 | 'data' => array( |
|
| 18 | 'source' => 'youtube', |
|
| 19 | 'remote_id' => $matches[1] |
|
| 20 | ) |
|
| 21 | ); |
|
| 22 | } |
|
| 23 | ||
| 24 | if (preg_match('~//player.vimeo.com/video/([^/\?]+).*\?~si', $html, $matches)) { |
|
| 25 | return array( |
|
| @@ 24-32 (lines=9) @@ | ||
| 21 | ); |
|
| 22 | } |
|
| 23 | ||
| 24 | if (preg_match('~//player.vimeo.com/video/([^/\?]+).*\?~si', $html, $matches)) { |
|
| 25 | return array( |
|
| 26 | 'type' => 'video', |
|
| 27 | 'data' => array( |
|
| 28 | 'source' => 'vimeo', |
|
| 29 | 'remote_id' => $matches[1] |
|
| 30 | ) |
|
| 31 | ); |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||
| 35 | public function matches(\DomElement $node) |
|