-
-
Notifications
You must be signed in to change notification settings - Fork 258
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
[Feature Request] YouTube Embeds #896
Comments
Sort of disagree with this being a dupe, the implementation would be quite different, native video tag vs iframe |
I'm looking at this as a discussion to embed media. This is a different source of media I guess. So it sounds like you want a youtube specifc plugin? Or do you want it to handle other video services too? There is a lot of magic happening here in this image link. And it feels weird doing it like this. Why not just provide a youtube link and have it translated to the iframe. Much like MagicLink does with Github links etc? Why with image tags? |
I'm not yet sure if I want to maintain a youtube extension yet, but I want to understand this approach as it seems awkward. |
The thing is, youtube embeds only work with iframes, so yes, in theory it could work with every other video service that requires this but we'd then have to have the url as parameter or a different tag per service.
That's what I want, yes
Was the easiest because I could abuse the alt tag |
Whoops! @gir-bot add T: feature |
Maybe this feature is already covered by |
Going through the backlog again. Not sure I'd bother taking ownership of |
I think with #897 on its way, and thinking about this more, I think I kind of see how I may approach this. I imagine we will just look for link patterns in the tree. We might abstract it so people can write their own functions for more niche video services, but the basic idea is that we'll crawl the tree looking for anchor tags, and loop through our supported services seeing:
After that, we just wrap it up in an iframe. Users can add whatever iframe attributes they want via I kind of want it general so I don't have to manually keep a list of every service and support lesser-known niche services. So abstracting it in such a way as to allow some flexibility will probably be key. In the end, I don't even think it needs to rely on MagicLink specifically. I'm thinking that both #897 and this one can probably be moved into some media type extension. |
I have something basic working for this as well. It'll just find the links and convert them. I'm only supporting Youtube, Vimeo, and Dailymotion out of the box. People can extend it if they like. I will probably only support very popular reputable sites officially. Some sites in the mdx_video plugin weren't worth supporting. Metacafe redirects to something different these days, etc. This will all get bundled in whatever I end up calling the new media embedding plugin. |
Basic support of the main 3 video platforms you mentioned, associated with the generic support mechanism is perfect to show any user how to tweak and extend the configuration to their needs. Thanks a lot @facelessuser for these sensible choices! Indeed, I don't want you to burnout trying to maintain the whole list of videos platform out there. |
I will probably end up using the This way, embedding video will be an explicit action, not implicit. And you can just link a video externally if you like without embedding it as well.
Let me know if this sounds crazy, but I think I like this a bit better. And it keeps both embedding physical media and media services consistent with the option of linking to videos without embedding if desired. |
Additionally, if no |
#1465 Experimental branch now has video service embedding and normal audio/video embedding. Still needs tests, but this so far is the final proposal unless feedback steers it in a different direction. I also squeezed in subtitle support in normal video/audio support via |
#1777 may be a better way to implement this |
I currently do some very ugly hacks in JavaScript at the moment to get a few missing Markdown features working.
One of them is a tag for YouTube embeds. Currently I'm scanning the
alt
tag of images forYOUTUBE
and then replace the image with an iframe like so:Now if we could do this natively and on compile instead of run, that would be great.
The text was updated successfully, but these errors were encountered: