Skip to content

Commit cdcbd1c

Browse files
committed
improved support for ustream
1 parent ef69d16 commit cdcbd1c

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

src/Providers/OEmbed/Ustream.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
namespace Embed\Providers\OEmbed;
3+
4+
class Ustream extends OEmbedImplementation
5+
{
6+
/**
7+
* {@inheritdoc}
8+
*/
9+
public static function getEndPoint()
10+
{
11+
return 'http://www.ustream.tv/oembed';
12+
}
13+
14+
/**
15+
* {@inheritdoc}
16+
*/
17+
public static function getPatterns()
18+
{
19+
return ['https?://www.ustream.tv/*'];
20+
}
21+
}

tests/UstreamTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
class UstreamTest extends PHPUnit_Framework_TestCase
3+
{
4+
public function testOne()
5+
{
6+
$info = Embed\Embed::create('http://www.ustream.tv/channel/red-shoes-billiards-60803-camera-1');
7+
8+
$this->assertEquals($info->title, 'Red Shoes Billiards 1pkt,banks camera 1');
9+
$this->assertEquals($info->imageWidth, 120);
10+
$this->assertEquals($info->imageHeight, 90);
11+
$this->assertEquals($info->type, 'video');
12+
$this->assertEquals($info->authorName, 'redsh0es');
13+
$this->assertEquals($info->authorUrl, 'http://www.ustream.tv/user/redsh0es');
14+
$this->assertEquals($info->providerName, 'Ustream');
15+
$this->assertEquals($info->providerUrl, 'http://www.ustream.tv/');
16+
}
17+
}

0 commit comments

Comments
 (0)