Skip to content

bug(Youtube player): 100% width #28489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
javatlacati opened this issue Jan 27, 2024 · 3 comments
Closed
1 task done

bug(Youtube player): 100% width #28489

javatlacati opened this issue Jan 27, 2024 · 3 comments
Labels
needs triage This issue needs to be triaged by the team

Comments

@javatlacati
Copy link

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

16.2.12

Description

For mobile devices sometimes we'd like to make the YouTube video 100% of the width.

In order to achieve that in previous versions I did as follows:

<div #demoYouTubePlayer id="demoYouTubePlayer" class="demo-youtube-player">
            <youtube-player
                    [videoId]="song?.video?.id"
                    suggestedQuality="highres"
                    [height]="250"
                    style="width:100%"
                    [startSeconds]="song?.video?.start||0">
            </youtube-player>
    </div>

yet now it's not working.

Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-k5bgl5?file=src%2Findex.html
Steps to reproduce:

  1. update from 16.2.12 to 17.1.1

Expected Behavior

It shoult take the whole width of the screen

Actual Behavior

style doesn't affect the result probably now it's embedded in an extra tag

Environment

  • Angular: 17.1.0
  • CDK/Material: NO
  • Browser(s): Edge 120.0.2210.144
  • Operating System: Windows 11 Pro
@crisbeto
Copy link
Member

This wasn't really officially supported before either since YouTube needs to know the width of the video. You can get it back like this: https://stackblitz.com/edit/components-issue-pkftug?file=src%2Fapp%2Fexample-component.html,src%2Fapp%2Fexample-component.css

@BojanKogoj
Copy link

BojanKogoj commented Feb 19, 2024

This broke our websites as well, since we used this

<youtube-player
  width="100%"
  height="100%"
  ... />

A similar fix to the one you provided helped, but I just wish this was mentioned in changelog as a potential breaking change (even though it technically isn't one).

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs triage This issue needs to be triaged by the team
Projects
None yet
Development

No branches or pull requests

3 participants