Skip to content
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

Custom Width and Height for Youtube shorts #158

Open
cdo9 opened this issue Oct 12, 2023 · 6 comments
Open

Custom Width and Height for Youtube shorts #158

cdo9 opened this issue Oct 12, 2023 · 6 comments

Comments

@cdo9
Copy link

cdo9 commented Oct 12, 2023

Before using this package i was doing this :

<iframe loading="lazy" width="315" height="560"
    class="lazyload my-0 mx-auto"
    src="https://www.youtube-nocookie.com/embed/{{ $youtubeVideoId }}"
    title="YouTube video player"
    frameborder="0"
    allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
    allowfullscreen=""></iframe>

Is it possible to do something similar for embedding youtube shorts ?

@cdo9 cdo9 closed this as completed Oct 12, 2023
@cdo9
Copy link
Author

cdo9 commented Oct 12, 2023

I found my answer alone, sorry :)

<lite-youtube videoid="{{ $youtubeVideoId }}" class="mx-auto" style="width: 315px; height: 560px;" playlabel="Play: Keynote (Google I/O '18)"></lite-youtube>

@cdo9 cdo9 reopened this Oct 13, 2023
@cdo9
Copy link
Author

cdo9 commented Oct 13, 2023

I reopen this cause my workaround is not doing exactly the same.

@Wolfleader101
Copy link

bump any solutions for embedding shorts?

@Milkywayrules
Copy link

curious, I wanna try this library, but can we actually embed Shorts? Is your problem only with the styling and not the embedded Short functionality?

cc @cdo9

@Wolfleader101
Copy link

curious, I wanna try this library, but can we actually embed Shorts? Is your problem only with the styling and not the embedded Short functionality?

cc @cdo9

Never got this library working so just stuck with standard iframes
i.e

      <iframe
        width="315"
        height="560"
        src="https://www.youtube.com/embed/Ce1xtpew1Qo"
        title="YouTube video player"
        allow="accelerometer; autoplay; clipboard-write; encrypted-media;
gyroscope; picture-in-picture;
web-share"
        allowfullscreen></iframe>
        

Works fine for me.

@cdo9
Copy link
Author

cdo9 commented Feb 27, 2024

I am now doing this, but not using this package anymore, using this one : https://github.com/justinribeiro/lite-youtube - I don't remember why I've switched but it's working well for me like this :)

<div class="max-w-3xl mx-auto">
    @if($isVideoFormatPortrait)
        <lite-youtube videoid="{{ $youtubeVideoId }}" short></lite-youtube>
    @else
        <lite-youtube videoid="{{ $youtubeVideoId }}"></lite-youtube>
    @endif
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants