sgalinski / sg-video
Unified TYPO3 video/mediathek element for YouTube, Vimeo, and local FAL files; output videos, playlists, channels, and groups/showcases, and migrate from sg_youtube and sg_vimeo.
Package info
gitlab.sgalinski.de/typo3/sg_video.git
Type:typo3-cms-extension
pkg:composer/sgalinski/sg-video
Requires
- typo3/cms-core: ^13.4 || ^14.0
Replaces
- sgalinski/sg_video: 1.0.7
README
License: GNU GPL, Version 2
Repository: https://gitlab.sgalinski.de/typo3/sg_video
Please report bugs here: https://gitlab.sgalinski.de/typo3/sg_video/-/issues
Overview
sg_video is the unified successor for sg_youtube and sg_vimeo.
It provides one TYPO3 content element (tt_content.CType = sgvideo_video) with a provider switch:
- YouTube
- Vimeo
- Custom (local TYPO3/FAL video files)
For migrated YouTube/Vimeo records, frontend behavior and look/feel are aligned with the legacy extensions. The main namespace change for integrators is:
sg-youtube/sg-vimeo->sg-video
Requirements
- TYPO3:
^13.4 || ^14.0 - PHP:
8.3+
Installation
Composer
composer require sgalinski/sg-video
TYPO3 integration
- Activate
sg_videoin TYPO3 Extension Manager. - Include static TypoScript:
SG Video(EXT:sg_video/Configuration/TypoScript).
Configuration
Credentials are configured via TypoScript constants:
plugin.tx_sgvideo.settings.providers.youtube.apiKey = <key>
plugin.tx_sgvideo.settings.providers.vimeo.clientId = <id>
plugin.tx_sgvideo.settings.providers.vimeo.clientSecret = <secret>
plugin.tx_sgvideo.settings.providers.vimeo.personalAccessToken = <token>
Environment fallback keys (read directly by providers):
SG_VIDEO_YOUTUBE_API_KEYSG_VIDEO_VIMEO_PERSONAL_ACCESS_TOKENSG_VIDEO_VIMEO_CLIENT_IDSG_VIDEO_VIMEO_CLIENT_SECRET
website_base/project_theme style env wiring
If you already use existing website_base variables, map them in your project TypoScript:
plugin.tx_sgvideo.settings.providers.youtube.apiKey := getEnv(SITE_WEBSITE_BASE_SGYOUTUBEAPIKEY)
plugin.tx_sgvideo.settings.providers.vimeo.clientId := getEnv(SITE_WEBSITE_BASE_SGVIMEOCLIENTID)
plugin.tx_sgvideo.settings.providers.vimeo.clientSecret := getEnv(SITE_WEBSITE_BASE_SGVIMEOCLIENTSECRET)
Usage
Add content element sgvideo_video and configure:
provider:youtube|vimeo|custom- source kind:
- YouTube:
video|channel|playlist - Vimeo:
video|channel|showcase - Custom:
file
- YouTube:
- source identifier / file reference
Available frontend layouts:
defaultrowsplaylist
Implemented behavior includes:
- unified filters (
searchTerm,duration) - read-more / read-less behavior
- lightbox and no-lightbox behavior parity
- structured data JSON-LD output via
StructuredVideoDataViewHelper
For custom/local videos:
- files are resolved from
settings.fileReferencerelation first sys_file_reference.autoplayis respected in lightbox and inline no-lightbox rendering
Caching and cache bypass
Provider responses use cache sgvideo_cache (24h TTL for provider responses).
Supported URL parameters for bypassing provider cache:
- canonical:
disableSgVideoCache=1 - legacy aliases:
disableYoutubeCache=1disableVimeoCache=1
HTTP request behavior
Provider HTTP calls use explicit timeout settings:
- connect timeout:
2s - request timeout:
8s
Retry/backoff is intentionally not enabled in this release.
Events
sg_video exposes the unified event lifecycle:
SGalinski\SgVideo\Event\BeforeProviderCallEventSGalinski\SgVideo\Event\AfterProviderCallEventSGalinski\SgVideo\Event\AfterFilterVideosEventSGalinski\SgVideo\Event\AfterMapCustomThumbnailsEvent
Migration from sg_youtube / sg_vimeo
Migration is handled by TYPO3 upgrade wizard:
- wizard id:
sgvideo_contentElementMigration - migrates legacy
CTypeand legacylist_typerecords tosgvideo_video - maps legacy FlexForm schema to
sg_video - migrates legacy thumbnail relation field names to
settings.thumbnailImages
Template override note:
sg_videouses one unified template entrypoint (Video/Index.html).- Provider-specific template overrides are no longer split by
tx_sgyoutube/tx_sgvimeo. - Existing custom Vimeo/YouTube templates must be migrated manually to the
sg_videotemplate contract.
Rector/Fractor migration tooling is intentionally de-scoped for this release. The TYPO3 upgrade wizard is the canonical migration path.
See detailed integrator steps in UPGRADE.md.
Non-composer installations
No Vimeo SDK package or PHAR fallback is required.
sg_video uses direct HTTP requests (RequestFactory) for Vimeo API access, so the following are not required:
vimeo/vimeo-apiLibraries/vimeo-api.phar
Frontend assets (sgc)
Build assets from extension root:
npm install
Note:
- The lightbox dependency is vendored in
Resources/Public/JavaScript/Modules/Vendor/BasicLightbox/. sgc builddoes not require extension-localnode_modules/basiclightbox.
If you work inside a website_base monorepo with sgc:
./sgc-core/core/sgc build --ext sg-video
For watcher-based frontend development in website_base, also update .sgc-config.js:
- add
sg-videotoextensions - add
sg-videotowatchExtensions - add these JS
libraryPathsentries:./vendor/sgalinski/sg-video/Resources/Public/JavaScript/Modules./vendor/sgalinski/sg-video/Resources/Public/JavaScript
Generated minified assets in Resources/Public/JavaScript/Dist/ and Resources/Public/StyleSheets/ are shipped and
versioned.
Testing
Run from website_base project root (monorepo usage):
composer ecs vendor/sgalinski/sg-video
composer phpstan local/sg_video
vendor/bin/phpunit --configuration local/sg_video/phpunit.xml.dist