[Hỏi đáp] Thay đổi cấu trúc thẻ của youtube hiển thị

  Bài viết hay nhất1
<embed src="https://www.youtube.com/v/TF5hXSEnRIg" allowscriptaccess="always" allowfullscreen="true" width="425" height="350" type="application/x-shockwave-flash" wmode="transparent" quality="high" scale="exactfit"></embed>

Thay vì hiển thị fm như trên . Ko hiển thị trên mobile gây khó khăn khi xem . Mình muốn thay đổi thành link bên dưới , dùng được với skin trong code càng tốt :D

<iframe src="//www.youtube.com/embed/TF5hXSEnRIg?autoplay=1&amp;autohide=1" allowfullscreen="" frameborder="0" height="315" width="560"></iframe>

Code:

    var skin = 'http://content.longtailvideo.com/skins/glow/glow.zip';
    plugin = 'fbit-1'; // Use coma to separate each plugin
    width = '100%';
    height = '450';
    allowfullscreen = 'true'; // true or false
    autostart = 'false'; // true or false
    stretching = 'uniform'; // none or exactfit or unifrom or fill
    volume = '100'; // from 0 to 100
    centered = 'true'; // true of false
    where = 'body'; // body or .post
    ////////// DO NOT EDIT ANYTHING BELOW THIS LINE /////////////
    $.getScript('http://player.longtailvideo.com/jwplayer.js');
    $(function() {
        var a = encodeURIComponent(skin);
        $(where + ' embed[src*="youtube"]').each(function() {
            $(this).replaceWith("<embed class='jwplayer' name='jwplayer' src='http://player.longtailvideo.com/player.swf' width='" + width + "' height='" + height + "' allowscriptaccess='always' allowfullscreen='" + allowfullscreen + "' flashvars='file=" + $(this).attr("src") + "&skin=" + a + "&plugins=" + plugin + "&autostart=" + autostart + "&stretching=" + stretching + "&volume=" + volume + "' />");
            if (centered == "true") {
                $(".jwplayer").wrap("<center/>")
            }
        })
    });
  Bài viết hay nhất2
Thử dùng code này thử xem.

Code:
$('embed').each(function(){$(this).replaceWith('<iframe src="'+$(this).attr('src')+'?autoplay=1&amp;autohide=1" allowfullscreen="" frameborder="0" height="315" width="560"></iframe>')});
You cannot reply to topics in this forum