Giter Club home page Giter Club logo

h8uoembed's People

Contributors

hteumeuleu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

h8uoembed's Issues

Center image thumbnail when its ratio is different than the player's

Youtube thumbnails often have a different ratio than the video player. For example, in this request, the thumbnail size is 480x360 (4:3 ratio) but the video player size is 480x270 (16:9 ratio).

I'd like to have the static container the same size of the player, so that when a user clicks on the thumbnail, the iframe replacement doesn't move the height of the page. Currently I set the thumbnail size to 100% so that it fits the same width as the video player. But this means that its height is too big (see this example).

I need to find a solution that works at all sizes, and for responsive sites as well.

Add CSS and JS on wp_head instead of wp_footer

Adding CSS and JS on wp_footer instead of wp_head is dirty. The reason for this is that I want those assets to be added on the page only if necessary. In order to do this, I use the embed_oembed_html filter (which is called everytime WordPress displays a cached version of an oEmbed object) in order to construct an array of videos of the current page (H8UoEmbed->video_providers). But this means that this array will always be empty when wp_head is called. I need to find another hook or another way to do this.

Avoid double click when autoplay isn't available

When a user clicks on the static video link, it replaces the thumbnail with the real video player. In order to prevent a second click to launch the video, I added an autoplay=1 parameter in the iframe src. But for some services (like FunnyOrDie.com) or on certain devices (like on Android or iOS), autoplay doesn't work, thus forcing the user to click a second time (once the player is fully loaded) to effectively play the video.

I need to find a way to force the video to play, or to change the UI so the user understands that the video won't play right away.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.