2013-10-20 28 views
0

玩家的應用程序,我有很多的進展這一點,並希望實施「看不見的球員」 Chromecast上接收機這裏說明:Deezer invisible player創建Chromecast上

我有我的演示應用程序的運行,並且我能夠從發件人傳遞給接收者我的訪問令牌和我的令牌到期。 Instanciating DZ的球員,像這樣:

DZ.init({ 
        appId : deezer_app_id, 
        channelUrl : deezer_channel_url, 
        player : { 
         onload : onPlayerLoaded, 
         token : { 
          accessToken:event.message.accessToken, 
          expire:event.message.expire 
         } 
        } 
       }); 

的onPlayerLoaded功能只是記錄暫時的消息。

我目前得到:

Unsafe JavaScript attempt to access frame with URL http://mydomain/chrome/myreceiver.html from frame with URL http://www.deezer.com/es/plugins/player.php?channel=http://Mydomain/chrome/channel.php&app_id=IDVALUE&emptyPlayer=true. Domains, protocols and ports must match. 
external-v00202097.js:40 
FB.getLoginStatus() called before calling FB.init(). vb.js:56 
Flash is not installed or is too old vb.js:56 
Unsafe JavaScript attempt to access frame with URL http://mydomain/chrome/myreceiver.html from frame with URL http://static.ak.facebook.com/connect/xd_arbiter.php?version=27#channel=f3a…Ffb_xd_fragment%23xd_sig%3Df2d6a19d8%26&origin=http%3A%2F%2Fwww.deezer.com. The frame requesting access set 'document.domain' to 'facebook.com', but the frame being accessed did not. Both must set 'document.domain' to the same value to allow access. 
xd_arbiter.php:18 
Unsafe JavaScript attempt to access frame with URL http://Mydomain/chrome/myreceiver.html from frame with URL https://s-static.ak.facebook.com/connect/xd_arbiter.php?version=27#channel=…Ffb_xd_fragment%23xd_sig%3Df2d6a19d8%26&origin=http%3A%2F%2Fwww.deezer.com. The frame requesting access has a protocol of 'https', the frame being accessed has a protocol of 'http'. Protocols must match. 

現在第一個沒有意義的,因爲我有我的channelURL設置爲相同的域,與檢查人員看我可以保證無論在channelURl和上鉻鑄造接收器,我們有相同的document.domain。

第二個錯誤似乎是從deezer加載flash中的某個東西(奇怪,因爲該示例沒有在flash中聲明任何東西)。

第三個錯誤會因爲某種原因而被稱爲FB。

我知道通過iframe的YouTube的API已與鉻合作,所以我認爲這是可能的,但閃存問題和跨域似乎是一個問題。

有什麼建議嗎?

回答

1

關於域,有時當您在http://developers.deezer.com上爲您的應用指定的域包含http://時,您有時會收到錯誤,因爲它不應該包含http://。

關於Flash,Deezer播放器基於Flash進行加密,所以您需要安裝它才能使其正常工作。

Facebook包含在Deezer播放器中(用於共享,登錄目的),當您的頁面加載到iframe中時會收到警告。您可以忽略這些警告。

+0

啊,所以這是一個死衚衕嘗試做到這一點,因爲Chromecast沒有閃光燈...... – cromestant

1

我對Deezer並不熟悉,因此無法評論Deezer相關問題,但「Unsdafe ...」消息也可能由嘗試使用file:// *;這是Chrome中的一項額外安全措施。另外,iframe的sanbox屬性是什麼?它是否包含「允許同源」?

+0

我無法控制iframe,它似乎是由Deezer SDK輸入的。讓我對此進行進一步調查。感謝您的回答 – cromestant

+0

看上面的鏈接,並檢查代碼(http://developers.deezer.com/sdk/javascript/example-invisible)似乎iframe是實現他們之間的消息和後端:oauth2relay ######## – cromestant

+0

這可能會導致安全問題,然後 –