You can convert the old YouTube embed code to the new one using jQuery. However, please note that the YouTube Flash player has been deprecated, and it's recommended to use the newer iframe-based embed code instead.

Here's how you can achieve the conversion:

HTML (Old Embed Code):

<object type="application/x-shockwave-flash" width="280" height="195" data="" id="ltVideoYouTube" vspace="4" hspace="4" align="left">

  <param name="movie" value="" />

  <param name="wmode" value="transparent" />

  <param name="allowScriptAcess" value="always" />

  <param name="quality" value="best" />

  <param name="bgcolor" value="#FFFFFF" />

  <param name="FlashVars" value="playerMode=embedded" />

  <embed src="" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="280" height="195"></embed>



JavaScript (using jQuery) - Insert this snippet into the <head> section of your website:

<script src=""></script>


$(document).ready(function() {

  // Get all old YouTube embed objects

  $('object[data^=""]').each(function() {

    // Get the YouTube video ID from the data attribute

    var youtubeVideoID = $(this).attr('data').split('/').pop();


    // Create the new iframe-based embed code

    var newEmbedCode = '<iframe width="280" height="195" src="' + youtubeVideoID + '" frameborder="0" allowfullscreen></iframe>';


    // Replace the old embed object with the new iframe code





In this JavaScript code, we use jQuery to select all object elements with a data attribute that starts with "". This allows us to target the old YouTube embed objects. We then extract the YouTube video ID from the data attribute and create a new iframe-based embed code with the video ID. Finally, we replace the old object element with the new iframe code using the .replaceWith() method.

Please ensure that you include the jQuery library (as shown in the JavaScript section) before using this code. Additionally, it's always a good practice to test the code on a test page to ensure everything works as expected with your specific setup.