java - How to make a youtube link as embed? -


<% string song = request.getparameter("songname"); string band = request.getparameter("band"); string url = request.getparameter("url"); %> <div align="center">     <br><br>  <% out.print(band + " - " + song); %><br><br>     <iframe width="560" height="315" src="<%out.print(url);%>" frameborder="0" allowfullscreen></iframe> </div> <% %> 

let's url https://www.youtube.com/watch?v=kxyiu_jcytu want make https://www.youtube.com/embed/kxyiu_jcytu can put @ src=""

you can use replace() method:

<% out.print(url.replace("watch?v=", "embed/")); %> 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -