nystudio107 /
craft-youtubeliveembed
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * YouTube Live Embed plugin for Craft CMS |
||
| 4 | * |
||
| 5 | * This plugin allows you to embed a YouTube live stream and/or live chat on your webpage |
||
| 6 | * |
||
| 7 | * @link https://nystudio107.com |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 8 | * @copyright Copyright (c) 2019 nystudio107 |
||
|
0 ignored issues
–
show
|
|||
| 9 | */ |
||
|
0 ignored issues
–
show
|
|||
| 10 | |||
| 11 | namespace nystudio107\youtubeliveembed\controllers; |
||
| 12 | |||
| 13 | use craft\web\Controller; |
||
| 14 | use nystudio107\youtubeliveembed\YoutubeLiveEmbed; |
||
| 15 | |||
| 16 | /** |
||
|
0 ignored issues
–
show
|
|||
| 17 | * @author nystudio107 |
||
|
0 ignored issues
–
show
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
|
|||
| 18 | * @package YoutubeLiveEmbed |
||
|
0 ignored issues
–
show
|
|||
| 19 | * @since 1.0.0 |
||
|
0 ignored issues
–
show
|
|||
| 20 | */ |
||
|
0 ignored issues
–
show
|
|||
| 21 | class InfoController extends Controller |
||
| 22 | { |
||
| 23 | // Protected Properties |
||
| 24 | // ========================================================================= |
||
| 25 | |||
| 26 | protected $allowAnonymous = [ |
||
| 27 | 'is-live', |
||
| 28 | ]; |
||
| 29 | |||
| 30 | // Public Methods |
||
| 31 | // ========================================================================= |
||
| 32 | |||
| 33 | |||
| 34 | /** |
||
| 35 | * Returns whether the stream is currently live |
||
| 36 | * |
||
| 37 | * @return bool |
||
| 38 | */ |
||
| 39 | public function actionIsLive(): bool |
||
| 40 | { |
||
| 41 | return YoutubeLiveEmbed::$plugin->embed->isLive(); |
||
| 42 | } |
||
| 43 | } |
||
| 44 |