我正在構建一個具有Chromecast支持的科爾多瓦icecast應用程序。到目前爲止,我得到它的工作感謝一個插件模仿官方Chrome API的密切關係。如何設置/更改專輯封面?
事情是:我想設置風格媒體接收器的專輯藝術,但我不能得到它的工作..是否anybode有一個這樣的例子?
我當前的代碼(段)
var mediaInfo = new chrome.cast.media.MediaInfo(station.station_url);
mediaInfo.contentType = "audio/mpeg";
mediaInfo.metadata = new chrome.cast.media.MusicTrackMediaMetadata();
mediaInfo.metadata.title = station.station_name;
mediaInfo.metadata.images = [
new chrome.cast.Image(station.station_icon), // ex: http://www.thestation.com/icon.png
new chrome.cast.Image("img/web_hi_res_512_001.png") // fallback
];
編輯1:添加「新」前chrome.cast.Image(),而不是它有助於但這是它是如何應該做:)
編輯2:現在我們討論使用Chrome API設置圖像的主題:如何在不調用loadMedia的情況下更新圖像?我認爲我需要使用sendMessage,但我不知道如何格式化消息。還有就是談論發送郵件的頁面,並將其提到的圖像,但它並沒有給出一個例子 - 這基本上使得它沒用:https://developers.google.com/cast/docs/reference/messages
PS:你可以看看這裏的項目:https://code.google.com/p/icerrr/
嗯我覺得第二個問題基本上和這個一樣:http://stackoverflow.com/questions/23416648/what-payload-to-send-to-the-chromecast-default-media-receiver-via -cast-castapi-S – REJH 2014-09-22 13:42:00