PHPackages                             ayacoo/twitch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ayacoo/twitch

ActiveTypo3-cms-extension[Utility &amp; Helpers](/categories/utility)

ayacoo/twitch
=============

Provides a Twitch online media helper

3.0.2(4mo ago)08GPL-2.0-or-laterPHPPHP &gt;=8.2 &lt; 8.6CI passing

Since Apr 17Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/ayacoo/twitch)[ Packagist](https://packagist.org/packages/ayacoo/twitch)[ Docs](https://www.ayacoo.de)[ RSS](/packages/ayacoo-twitch/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (14)Versions (13)Used By (0)

TYPO3 Extension twitch
======================

[](#typo3-extension-twitch)

1 Features
----------

[](#1-features)

- Twitch videos can be created as a file in the TYPO3 file list
- Twitch videos can be used and output with the text with media element
- Update metadata via command

2 Usage
-------

[](#2-usage)

### 2.1 Prerequisites

[](#21-prerequisites)

Twitch unfortunately does not provide us with an oEmbed interface, so we have to query the data via an API. The setup is done quite quickly, though.

First, you need a Twitch account with 2FA to be able to create an app with it via [Twitch Console](https://dev.twitch.tv/).

The application only needs a name and 2-3 settings. Interesting for us is the ClientId, which we also need for the communication. Client Secret must also be generated, because we need it for the generation of the token need.

After creating the application you still need a token. For this you can install the [Twitch CLI](https://dev.twitch.tv/docs/cli). If everything is installed, you can generate a token with `twitch token` and the input of Client ID and Client Secret. Please save this token.

In the TYPO3 Install Tool you can now store the two settings "Token" and "Client Id". Without this data there will be errors in the backend, and we will not get any data from Twitch.

It may well be that the token needs to be updated regularly.

### 2.2 Installation

[](#22-installation)

#### Installation using Composer

[](#installation-using-composer)

The recommended way to install the extension is using Composer.

Run the following command within your [Composer](https://getcomposer.org/) based TYPO3 project:

```
composer require ayacoo/twitch

```

### 2.3 TypoScript settings

[](#23-typoscript-settings)

#### Privacy

[](#privacy)

With `plugin.tx_twitch.settings.privacy = 1` you can ensure that the IFrame is built with data-src instead of src. If you need more options to influence the HTML, you can use a PSR-14 event.

### 2.4 Hints

[](#24-hints)

#### Output

[](#output)

For the output, the HTML is used directly from [Twitch](https://dev.twitch.tv/docs/embed).

#### SQL changes

[](#sql-changes)

In order not to have to access the oEmbed interface permanently, one thumbnail field are added to the sys\_file\_metadata table

#### TYPO3 v10

[](#typo3-v10)

If you want to use the extension with TYPO3 v10, it should work in principle. The code is close to the v10. You can create a repository via a Github fork and modify / add the necessary lines there.

#### Videos vs Clips

[](#videos-vs-clips)

Clips are excerpts from videos. If you want to enter them specifically, you can control the entry via the Time parameter. If you prefer to have the clips as data sets, you can also register a MediaViewHelper relatively easily. The structure is comparable to the Twitch videos.

3 Developer Corner
------------------

[](#3-developer-corner)

### 3.1 ModifyTwitchOutputEvent

[](#31-modifytwitchoutputevent)

If you want to modify the output of the Twitch HTML, you can use the `ModifyTwitchOutputEvent`.

##### EventListener registration

[](#eventlistener-registration)

In your extension, extend `Configuration/Services.yaml` once:

```
Vendor\ExtName\EventListener\TwitchOutputEventListener:
    tags:
        -   name: event.listener
            identifier: 'twitch/output'
            event: Ayacoo\Twitch\Event\ModifyTwitchOutputEvent
```

```
