Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heimrichhannot/contao-youtube
Youtube Content Element, with responsive support, preview image, play button and many more.
https://github.com/heimrichhannot/contao-youtube
Last synced: about 1 month ago
JSON representation
Youtube Content Element, with responsive support, preview image, play button and many more.
- Host: GitHub
- URL: https://github.com/heimrichhannot/contao-youtube
- Owner: heimrichhannot
- Created: 2015-01-08T10:39:13.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-10-29T08:56:16.000Z (about 5 years ago)
- Last Synced: 2024-10-30T00:26:59.727Z (about 2 months ago)
- Language: PHP
- Size: 341 KB
- Stars: 1
- Watchers: 9
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# YouTube
YouTube is a contao module to provide responsive youtube videos with preview images and better privacy control.
It provides support for content elements and news items.## Technical instruction
Youtube videos can be added to news templates with ease. Just add the following code (for example: news_full.html5):
```
addYouTube): ?>
= $this->youtubeVideo; ?>```
To use preview images from youtube, you have to generate an API key (https://developers.google.com/youtube/v3/getting-started) and place it in the contao settings.
## Features
* Responsive youtube videos (requires jQuery)
* Preview image for youtube videos
* If no custom image is given, the preview image will be loaded from youtube and saved under 'files/media/youtube/'
* Privacy mode (requires jQuery)
* In privacy mode the video is displayed, after the user accepted a privacy advice within a modal prompt (requires bootstrap 3 modal window support)
* The user can mark his selection as permanent with a checkbox (state will be saved in a cookie)![alt privacy modal](./docs/img/privacy_modal.jpg)
### Content elementsName | Description
---- | -----------
ContentYoutube | The default core youtube content element with additional features.### Fields
tl_module:
Name | Description
---- | -----------
youtube_template | Select a youtube template within your news module.
autoplay | Start the video on page view, only for reader modules.tl_page:[root pages only]
Name | Description
---- | -----------
youtube_template | Select a youtube template within your root page.
youtubePrivacy | Enable youtube privacy mode for all elements on pages within this root page.
youtubePrivacyTemplate | Select a youtube privacy template within your root page.### Hooks
Name | Arguments | Description
---- | --------- | -----------
parseArticles | $objTemplate, $arrItem, $objModule | Add youtube to news templates.