December 29th, 2016, 04:52 PM
Embed and/or add items to preview box with JS
I hope I can get some good advice here (and some padding on this textarea).
Client wants to have a text area where user can paste code from YouTube, Spotify, AppleStore and
some other social media sites and as they paste the code, a preview window updates and based
on the user's code, it either embeds the video (or playlist etc etc), or shows the thumbnail retrieved via api.
I am a bit confused because there are just so many variations. For YouTube on it's own we have
You see this is A LOT OF work. Then they wanna dd edit feature. So if they click on a button (under the video),
Option 1: https://www.youtube.com/watch?v=TEoG_5vV9A8
Option 2: <iframe width="560" height="315" src="https://www.youtube.com/embed/TEoG_5vV9A8" frameborder="0" allowfullscreen></iframe>
Option 3: https://youtu.be/TEoG_5vV9A8
then they can load the pasted code in the same box and update it.
So my question is, how do you go about a task like this? Add the feature so it looks after all 3 YouTube
code options, then get into Spotify etc etc?
There has to be an easier way to this.
Would you please advise?
December 30th, 2016, 02:36 PM