Giter VIP home page Giter VIP logo

Comments (9)

paulirish avatar paulirish commented on August 11, 2024 7

there's been a few more issues/PRs about this:


I think @smartcorestudio's proposed solution is both flexible and means lite-youtube-embed doesn't have to get bloated to support each feature that the iframe does.

So the idea is make use of a single attribute on our element. Its value will be added into the YT iframe src's query params.

<lite-youtube videoid="..." params="start=10&end=30"></lite-youtube>

or to use a LOT of them

<lite-youtube videoid="..." params="start=10&end=30&modestbranding=2&rel=0&enablejsapi=1&origin=http://lol.com"></lite-youtube>

I like using an attribute called params. I can think of a few alternatives, but I like this the best.

Thoughts?

from lite-youtube-embed.

paulirish avatar paulirish commented on August 11, 2024 1

update: [email protected] published

from lite-youtube-embed.

pavelloz avatar pavelloz commented on August 11, 2024

Seems like a good solution to all current and possible future param-related feature requests anyone might have :)

PS. Sorry for duplicated issue

from lite-youtube-embed.

Garbee avatar Garbee commented on August 11, 2024

I'll make sure we get this params attribute in nice and tidy with PR #28 when I clean it up this weekend (or tomorrow morning possibly. Tight on time tonight.) It's a super good way to give "full" support without building out attributes for every parameter.

from lite-youtube-embed.

laukstein avatar laukstein commented on August 11, 2024

@paulirish, don't you think it would make more sense to simplify it with url param containing whatever (embed or not) YouTube link with or without extra params, like:

  1. id=ogfYd705cRs (old format)
  2. url="https://www.youtube.com/watch?v=ogfYd705cRs" (new format)
  3. url="https://www.youtube.com/watch?time_continue=10&v=ogfYd705cRs&feature=emb_logo" (with params)
  4. url="https://www.youtube.com/embed/ogfYd705cRs?autoplay=1&start=10&end=30&modestbranding=2&rel=0&enablejsapi=1&origin=https://github.com" (pasted from embedded iframe, plus extra params)

<lite-youtube> could analyze url and parse it however decided.

I would even propose to change lite-youtube to something like video-embed allowing to handle videos from multiple video hosts, YouTube, Vimeo, etc. Here what I mean (maybe can handle without closing tag or like <lite-video url=""/>) :

  1. <video-embed url="https://www.youtube.com/watch?v=ogfYd705cRs">
  2. <video-embed url="https://vimeo.com/270506902">
  3. <video-embed url="https://www.dailymotion.com/video/x209qoh">

from lite-youtube-embed.

pavelloz avatar pavelloz commented on August 11, 2024

^ This seems like a much bigger task (including renaming and changing purpose of the whole project) than forwarding params to the url ;-)

PS. lite-vimeo-embed: https://github.com/luwes/lite-vimeo-embed

from lite-youtube-embed.

lborgman avatar lborgman commented on August 11, 2024

Is there any problem with just adding "params=..." now for the element? What could go wrong?

from lite-youtube-embed.

justinribeiro avatar justinribeiro commented on August 11, 2024

Cheers @paulirish for the note on that PR. That unified params approach works pretty well in practice for a case like this (at least in my experience building other not-so-public web components for corps). Maximum flexibility with least amount of element API churn.

from lite-youtube-embed.

paulirish avatar paulirish commented on August 11, 2024

fixed by #51 (which just landed. shipping in 0.1.0)

from lite-youtube-embed.

Related Issues (20)

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.