负载2个不同势I帧相同的YouTube视频,而无需装载了两次(Load same youtube v

2019-10-21 13:26发布

有谁知道,如果有可能加载2个不同势I帧相同的YouTube视频,而无需装载了两次?

我要的是模仿的Youtube iPhone应用程序。 该视频仍在播放在应用程序的右下角:

我做了什么 :

<div id="youtube_iframe_big_player" data-youtube-id="youtubeId"></div>
<div id="youtube_iframe_reduced_player" data-youtube-id="youtubeId"></div>

<script>

    var tag = document.createElement('script');
    tag.src = "https://www.youtube.com/iframe_api";
    var firstScriptTag = document.getElementsByTagName('script')[0];
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

    var player;

    function onYouTubeIframeAPIReady() {
        player = new YT.Player('youtube_iframe_big_player', {
            height: '390',
            width: '640',
            videoId: $("#youtube_iframe_big_player").attr("data-youtube-id"),
            events: {
                'onReady': onPlayerReady,
                'onStateChange': onPlayerStateChange
            }
        });
    }
<script>

我已经尝试过了波纹管:

player = new YT.Player('youtube_iframe_big_player, youtube_iframe_reduced_player', {
...
文章来源: Load same youtube video on 2 diffrent iframes without loading it twice