[xExtension-YouTube] add player autosize feature#291
Conversation
|
Any comment @kevinpapst ? |
| { | ||
| $content = ''; | ||
|
|
||
| if ($this->autoSize) { |
There was a problem hiding this comment.
You removed the class youtube-plugin-video. Can you re-add it, to not break existing customizations?
| if ($this->autoSize) { | ||
| $iframe_attribute = 'class="yt_player_autosize"'; | ||
| } else { | ||
| $iframe_attribute = 'width="' . $this->width . '" height="' . $this->height . '"'; |
There was a problem hiding this comment.
I can't remember why the style attribute was used, but I am almost certain, that I added it on purpose.
It's gone now.
|
|
||
| return array( | ||
| 'yt_videos' => array( | ||
| 'autosize' => 'Autogröße des Players', |
There was a problem hiding this comment.
| 'autosize' => 'Autogröße des Players', | |
| 'autosize' => 'Automatische Größe des Players', |
kevinpapst
left a comment
There was a problem hiding this comment.
Thanks for sharing this 👍 will test it later on.
Could you please have a look at my comments.
|
Thanks for the original implementation and discussion. I have picked this work up in #488, rebased it conceptually onto the current YouTube extension, and incorporated the review feedback here as well as the CSP-related findings from #382. Since the replacement is now available for review in #488, I think this PR can be closed as superseded once the new PR is accepted. |
## Summary - add an opt-in responsive sizing setting for the YouTube and PeerTube players - preserve the existing `youtube-plugin-video` class and fixed-size behavior by default - move player sizing out of the inline `style` attribute so it works with FreshRSS CSP - keep the `referrerpolicy` introduced in #382 This takes over the work from #291 and applies its review feedback to the current implementation. ## Behavior When automatic sizing is enabled, the player uses the existing `youtube-plugin-video` class together with `yt-player-autosize`, which applies a full-width 16:9 aspect ratio. When it is disabled or unset, the configured `width` and `height` attributes are preserved. ## Validation - `npm run eslint` - `npx stylelint "**/*.css"` - `npm run markdownlint` - reviewed the generated iframe branches for YouTube, youtube-nocookie, PeerTube, and original-content handling PHPStan and PHPCS were not run locally because PHP and `make` are unavailable on PATH and Docker Desktop could not start. They are expected to run in GitHub Actions.
Hi all,
I implemented this functionality that allows the youtube iframe's size to be automatically determined.
Hopefully others can enjoy this functionality as well.
Best regards