2014-02-09 50 views
0

我正在嘗試構建一個Spotify應用程序,該應用程序在iFrame中顯示Youtube視頻。我已經做到了這一點,它在一個正常的瀏覽器中工作。然而,當我嘗試在Spotify中運行它時,我在iFrame中發現錯誤,說The Adobe Flash Player or an HTML5 supported browser is required for video playback.我已經手動在Google Chrome之外安裝了Flash,所以我知道它在那裏。我想知道是否還有其他事情需要我去做,以便在Spotify應用中啓用Flash。也許在manifest.jsonSpotify Flash集成

這是我爲我的player源,這幾乎是直接從Youtube上演示:在不支持

var tag = document.createElement('script'); 

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

    player; 
    function onYouTubeIframeAPIReady() { 
    player = new YT.Player('player', { 
     height: '390', 
     width: '640', 
     videoId: 'Gz2GVlQkn4Q', 
     events: { 
     'onReady': onPlayerReady, 
     'onStateChange': onPlayerStateChange 
     } 
    }); 
    } 

    function onPlayerReady(event) { 
    event.target.playVideo(); 
    } 

    var done = false; 
    function onPlayerStateChange(event) { 
    if (event.data == YT.PlayerState.PLAYING && !done) { 
     done = true; 
    } 
    } 
    function stopVideo() { 
    player.stopVideo(); 
    }  

回答

1

閃存內置在Spotify的桌面客戶端使用Spotify的應用程序的瀏覽器。您可以在Spotify Developer Guidelines中找到有關支持的功能的信息。

+0

這也解釋了HTML5後備錯誤,我猜也是如此。