Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding twitch provider
  • Loading branch information
msurguy committed Apr 18, 2019
1 parent 31c2146 commit b6bc91a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Providers/OEmbed/Twitch.php
@@ -0,0 +1,9 @@
<?php

namespace Embed\Providers\OEmbed;

class Twitch extends EndPoint implements EndPointInterface
{
protected static $pattern = '*.twitch.tv/*';
protected static $endPoint = 'https://api.twitch.tv/v5/oembed';
}
20 changes: 20 additions & 0 deletions tests/TwitchTest.php
@@ -0,0 +1,20 @@
<?php

namespace Embed\Tests;

class TwitchTest extends AbstractTestCase
{
public function testOne()
{
$this->assertEmbed(
'https://www.twitch.tv/videos/72749628',
[
'title' => 'EU LCS Summer - Week 3 Day 1: FNC vs. S04 | H2K vs. G2 (EULCS2)',
'type' => 'video',
'code' => '<iframe src="https://player.twitch.tv/?%21branding=&amp;autoplay=false&amp;video=v72749628" width="500" height="281" frameborder="0" scrolling="no" allowfullscreen></iframe>',
'providerName' => 'Twitch',
'providerUrl' => 'https://www.twitch.tv/',
]
);
}
}

0 comments on commit b6bc91a

Please sign in to comment.