I try to get a URL of a YouTube-video from database and embed it in a page.
I get the "An error occured. Please try again later" message. Pls help! :(
String in the DB: https://www.youtube.com/watch?v=JjFsNSoDZK8
HTML code (inside a table):
<tr><td colspan=3><iframe id='Trailer' width="640" height="360" src="" frameborder="0" allowfullscreen></iframe></td></tr>
JS code (jQuery):
$("#MovieDetails").find("#Trailer").attr('src',arr['Trailer'].replace("youtube.com/","youtube.com/embed/") + "?feature=player_detailpage");
(Here, MovieDetails is the id of the table); Also, that string at the end: "?feature=player_detailpage", even without it is not working.
Tried several ways to change the URL-string but cannot seem to find the right one. Same mistake always.
EDIT: If I use the code from YouTube (that it gives you in movie info -> share -> embed) and hardcode it in my page, it works.