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

Vimeo video embed is by default non responsive #3225

Closed
Xaviju opened this issue Aug 1, 2018 · 8 comments
Closed

Vimeo video embed is by default non responsive #3225

Xaviju opened this issue Aug 1, 2018 · 8 comments
Labels

Comments

@Xaviju
Copy link

Xaviju commented Aug 1, 2018

Feature request

Set default vimeo embed code as provided in the vimeo website

Setting it as the provided embed code by Vimeo will give us by default responsive videos in posts using the vimeo helper tag provided by hexo.

<div style="padding:56.25% 0 0 0;position:relative;">
  <iframe src="//player.vimeo.com/video/${video_id}?title=0&byline=0&portrait=0" style="position:absolute;top:0;left:0;width:100%;height:100%;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
  </div>
@Xaviju
Copy link
Author

Xaviju commented Aug 1, 2018

Thinking twice about this, we might not want this behavior by default because it will not allow users to control the player with CSS so easily.

If you think this is interesting, I could add the option in the vimeo tag as follows:

{vimeo 324234 responsive}

Closing this issue for now.

@Xaviju Xaviju closed this as completed Aug 1, 2018
@Xaviju
Copy link
Author

Xaviju commented Aug 1, 2018

My suggestion is:

{vimeo id}

Will default to a responsive video 100% width as provided by default by vimeo.

Otherwise adding a width and height will return a video with specific size.

{vimeo id width height}

If width or height are not provided will fallback to responsive.

@Xaviju Xaviju reopened this Aug 1, 2018
@stale
Copy link

stale bot commented Sep 30, 2018

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 30, 2018
@Xaviju
Copy link
Author

Xaviju commented Oct 3, 2018

I can do this myself, but I need some feedback by the core team before working on a PR. Otherwise, I'll close it.
If there is a better workflow for feature requests and PRs please let me know.

@stale stale bot removed the stale label Oct 3, 2018
@tomap
Copy link
Contributor

tomap commented Oct 7, 2018

Indeed, that seems to be easily doable.
Are you willing to do a pull request.
Code is fairly simple:
https://github.com/hexojs/hexo/blob/0b26940f7e0a35f6937b944012468bbf0d844010/lib/plugins/tag/vimeo.js

If you look at other tags in this folder, you'll find a way to do what you want (optional parameters, ...)

@Xaviju
Copy link
Author

Xaviju commented Oct 11, 2018

Nice, thanks for the feedback.
I'll create the PR

@Xaviju
Copy link
Author

Xaviju commented Oct 11, 2018

#3283

@stale
Copy link

stale bot commented Dec 10, 2018

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 10, 2018
@stale stale bot closed this as completed Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants