Rikifive 24,475 May 29 Share May 29 (edited) It's not a common problem, but rarely, users mention, that the editor refuses to convert a link into a video embed when trying to share YouTube videos. Unfortunately, by default, when the editor refuses to cooperate like this, there aren't really any ways to work around it and force it to turn links into embedded videos. So as an experiment, I have programmed my first, little actual plugin where I can use JavaScript, that hopefully should help with that. I have added a button to the editor's toolbar between "code" and "spoiler" buttons: Clicking this button will ask for a YouTube video link. When a valid link is provided, it should directly insert the embedded video into the post. It is currently available only on small (phone) and medium (tablet) displays, as that's where I believe this problem likes to happen, depending on device and browser. I suspect this issue doesn't happen on PC's, or at least not as often, so for the time being I haven't added that button on large displays, unless users will wish to have it there too. One thing to note though: The video link should contain the video's ID, consisting of 11 characters. That's the only information it has to extract from the link for it to work. YouTube tends to give links with different formats (like some "youtu.be" stuff), but I used a regular expression to hopefully capture that ID from all of them. If at any point anyone gets an error, despite providing a seemingly valid link, please poke me or simply reply here, so that I can adjust the code. Let me know if it's helpful or not! Edited May 30 by Rikifive 1 1 ❤ ■■■■■■■■■■ ⭐ ■■■■■■■■■■ Link to comment Share on other sites More sharing options...
Acinonyx 651 May 29 Share May 29 (edited) And there I was a few months ago wondering how to embed a video because there was no button until I figured it out. Having it happen automatically was not something I was used to, I think it'll be helpful. Edited May 29 by Acinonyx 1 Link to comment Share on other sites More sharing options...
Street Light 165 May 29 Share May 29 bigly!!! :3 this is neat. i was wondering the other day how i was meant to embed videos on mobile (it was not showing up in the preview) and now i do not have to wonder anymore uwu 1 Link to comment Share on other sites More sharing options...
Snoopy Fan 5,221 May 29 Share May 29 I think it’s very helpful 1 Link to comment Share on other sites More sharing options...
Rikifive 24,475 May 30 Author Share May 30 Thank you for your input everyone! 1 ❤ ■■■■■■■■■■ ⭐ ■■■■■■■■■■ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Join the herd!Sign in
Already have an account? Sign in here.
Sign In Now