-
-
Notifications
You must be signed in to change notification settings - Fork 257
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] Video Embeds #897
Comments
So it looks at extensions? |
Why
I'd have to think about this as right now, I'm not sure on the syntax. |
I just picked a random example, really |
For me, features with a fully fleshed out proposal have a better chance of consideration. Either I have to sit down and come up with it (unless I have a direct need for it, this becomes low priority) or the issue filer should present it. So I took it as a real proposal, one I'm not too keen on. I could see someone maybe just doing something like this with
Then just use a tree processor to look for images with a type attribute of With that said though, it feels weird using images for this, but someone could throw together a quick and dirty Markdown extension to do this. They could even use this method to embed youtube. Without a syntax that I'm fully behind, I'm not sure I would do this. I'd have to think about this. |
I guess if you look at the |
I meant I picked a random suggestion from the topic I linked.
Yeah that's where https://github.com/cmrd-senya/markdown-it-html5-embed supports two modes as well, the MagicLink one and image syntax one |
markdown-it example is probably more inline with a direction I would consider at this point. it kind of meshes with what we already do. We could easily just scan link extensions and convert them to media elements. I'm curious what you gain from using image format vs link format. I wonder if I would even waste time implementing both forms. Maybe it allows you to more easily identify media links instead of scanning all links 🤷♂️ . I'd have to look into it more. Something to consider though. |
@gir-bot add P: maybe |
For my own video needs in Markdown I rely on |
|
I'd say mp4 and webm as containers |
Sounds good, I'm debating looking into at least this one for the next release. I may skip YouTube and such for now. |
Seemed pretty easy to get something up and going. We don't even really have to do anything special. We just let Magiclink find the links as normal, or the normal link methods, and then we use a treeprocessor right after
I like this because we don't really need to do anything special, we just let the user drop in the links, and we just handle it. Let me know what you'd want out of such functionality. Are there things we feel we need to expose options to? |
Oh wow, yeah, that is really great. Could you post the generated HTML as well? |
Yeah, I just referenced the markdown-it plugin's readme and used that format: <video controls width=50>
<source src=./images/elephants-dream.webm type=video/webm>
Your browser does not support playing HTML5 video. You can<a href=images/elephants-dream.webm>download a copy of the video file</a>instead.
</video> I guess they also will inject a content description from the title (or maybe the alt -- from somewhere 🤷🏻 ) which we could maybe do as well. It should map both |
Ah yeah I think that would work, as comparision, this is the "standard" of how I do my videos: <div class="mt-video">
<video autoplay loop muted playsinline poster="/img/EditorManual/Abilities/Gem.png">
<source src="/img/MyFirstMultiplayer/DragDropBushes.webm" type="video/webm" />
<source src="/img/MyFirstMultiplayer/DragDropBushes.mp4" type="video/mp4" />
</video>
</div> |
Okay, so it looks like you have fallbacks...I wonder if we could make something like that work somehow... |
Okay, here's an idea. What if when videos are grouped together the first is taken as the main one, and all the subsequent ones are fallbacks. So here, the first video is the main one, the second is the fallback, and the third one spawns a new video. I decided that maybe the
Let me know what you think. This is all kind of an experiment right now. |
As an alternative, we could link them only if they are marked with a
|
We now have audio and video supported. We assume video for webm, but if a user overrides with an audio type attribute, we will respect it. We also now sort out I'll probably scan around for commonly supported mime types and add them. After that, it is just deciding if we want to have fallback logic, and if so, what does that look like. Hopefully, this will make it in the 9.0 release, but we'll see. I don't want to rush it if it ends up being half-baked. |
I think I like the marking as fallback idea more because it's a little clearer to read. Would something like this work as well?
|
Experimental branch here: https://github.com/facelessuser/pymdown-extensions/tree/feature/magic-media
Not currently. But how would you chain more than one fallback? Maybe if we require a separator like |
Just an FYI, I haven't implemented the |
Implemented By default, it will assume the following MIME types based on the extension but will accept a MIME type override as
TODO: maybe tomorrow The only other thing I can think to add is maybe some kind of default attribute option. Like if you always set |
Okay, everything is up in pull request #1465. Feedback is welcome. Let me know if this is what everyone was hoping for. Still need to write tests and docs once we've decided if this is a viable direction. |
I will test it, I'm not sure when I'll have time but I hope next week! |
No worries. Take your time. |
Don't know if I'll get to it, but probably need subtitle support |
#1777 may be a better way to implement this |
Since proper Markdown support is not going to happen anytime soon, would it be possible to implement it in material-extensions like suggested here? https://talk.commonmark.org/t/embedded-audio-and-video/441/102
There is https://github.com/cmrd-senya/markdown-it-html5-embed as an example implementation.
The text was updated successfully, but these errors were encountered: