#1
  1. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,153
    Rep Power
    220

    Embed and/or add items to preview box with JS


    Hi;

    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
    Code:
    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
    You see this is A LOT OF work. Then they wanna dd edit feature. So if they click on a button (under the video),
    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?

    Thanks
  2. #2
  3. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,153
    Rep Power
    220
    Anyone?

IMN logo majestic logo threadwatch logo seochat tools logo