Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- Watch Youtube:<br />
- <input type = "text" id = "videoURL" size = "48" maxlength = "48" value = "" autofocus />
- <button onclick = "showNewVideo()">Show Me</button>
- <p id = "feedback"> </p>
- <object width = "640" height = "385">
- <param name = "movie" value = "http://www.youtube.com/v/EjUbBsJ0Aow" />
- <param name = "allowFullScreen" value = "true" />
- <param name = "allowscriptaccess" value = "always" />
- <embed name = "videoEmbed" src = "http://www.youtube.com/v/EjUbBsJ0Aow"
- type = "application/x-shockwave-flash"
- allowscriptaccess = "always" allowfullscreen = "true"
- width = "640" height = "385" />
- </object>
- <script>
- function showNewVideo() {
- var videoURL = document.getElementById("videoURL");
- var videoId = videoURL.value.split("v=")[1];
- if(videoId) {
- document.getElementById("feedback").innerHTML=" ";
- var newURL = "https://www.youtube.com/v/" + videoId;
- document.getElementsByName("movie")[0].value = newURL;
- document.getElementsByName("videoEmbed")[0].src = newURL;
- } else {
- document.getElementById("feedback").innerHTML="no video id?";
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement