我有我的應用程序通過AVPlayer成功地流式傳輸MP3。我實現了一個MPVolumeView來支持AirPlay,但是我注意到我的蘋果電視上的標題信息沒有顯示流媒體MP3中的任何內容,而只是「未知」信息。無論如何,從應用程序來控制這些信息,或者這是由流式傳輸引起的問題嗎?任何幫助將非常感激!!Apple TV上的AirPlay元數據(AVPlayer - MPVolumeView)
3
A
回答
3
我想更新此問題,以防其他人需要在AirPlay播放期間控制在Apple TV上看到的內容。此功能適用於iOS5,但下面的代碼示例將在包含iOS4支持的應用程序上正確編譯。
Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter");
if (playingInfoCenter) {
UIImage *albumArtImage = [UIImage imageNamed:@"Album-Image-Name.png"];
MPMediaItemArtwork *artwork = [[MPMediaItemArtwork alloc] initWithImage:albumArtImage];
MPNowPlayingInfoCenter *center = [MPNowPlayingInfoCenter defaultCenter];
NSDictionary *songInfo = [NSDictionary dictionaryWithObjectsAndKeys:
@"Artist Name", MPMediaItemPropertyArtist,
@"Title Name", MPMediaItemPropertyTitle,
@"Album Name", MPMediaItemPropertyAlbumTitle,
artwork, MPMediaItemPropertyArtwork,
nil];
center.nowPlayingInfo = songInfo;
}
這是在您的媒體播放器(如AVPlayer)上調用播放方法時所有設置。
0
如果您使用的是iOS 5,請查看MPNowPlayingInfoCenter。它很容易使用並獲取元數據給AppleTv和其他設備。您可能還需要實施對遠程控制的支持。我唯一沒有正確工作的是持續時間和當前位置。
+0
嗨。您可以通過提供您建議的圖書館鏈接以及開發人員提供的說明來提高您的文章質量。 – rdurand 2012-10-26 09:16:33
相關問題
- 1. iPad上的Airplay - 獨立的UIView在Apple TV上顯示
- 2. Apple App上的AirPlay元數據來自Mac App
- 3. Airplay與AVPlayer?
- 4. MPVolumeView AirPlay按鈕不顯示
- 5. 新的Apple TV上的Airplay(第三代)第二屏幕不是1080p
- 6. 支持AirPlay,以及的MPMoviePlayerController關係MPVolumeView
- 7. 避免MPVolumeView中的AirPlay按鈕動畫
- 8. MPVolumeView AirPlay按鈕沒有顯示
- 9. MPVolumeView更改Airplay圖標大小
- 10. Sirikit for Apple tv
- 11. Apple TV上的CAKeyframeAnimation沒有顯示
- 12. Apple TV上的以太網端口
- 13. Apple TV上的多人遊戲
- 14. 如何使用AVPlayer停止AirPlay音頻?
- 15. 我可以在iOS 4.3中使用AirPlay將靜止圖像發送到Apple TV
- 16. 在iOS上編譯irssi(Apple TV)
- 17. MPNowPlayingInfoCenter nowPlayingInfo通過AirPlay忽略AVPlayer音頻
- 18. 打開Apple TV App Store
- 19. 帶AirPlay的MPMusicPlayerController?
- 20. AVPlayer獲取元數據但不播放
- 21. Facebook,Spotify(iOS)使用MPVolumeView或自定義視圖來播放airplay?
- 22. iOS Airplay viewcontroller數據同步
- 23. 配置Apple TV的啓動URL
- 24. Apple Live照片元數據
- 25. 強制視圖重新加載Apple TV/tvos上的tvml內容
- 26. dateFormatter.dateFromString - 模擬器及Apple TV上不同的結果
- 27. TVJS如何檢測Apple TV遙控器上的滑動?
- 28. Apple TV上的字幕未顯示在自動模式下
- 29. 減少響亮的聲音在Apple TV上編程
- 30. 如何在Swift中檢測Apple TV上的按鈕高亮
你有沒有找到一種方法來做到這一點?我正在嘗試做同樣的事情。我有元數據在播放器的timedMetaData屬性中解碼,但我不確定如何在Apple TV上顯示它。 – Ben 2011-06-10 13:57:38
還沒有。如果我找到任何東西,我會發表評論。 – stitz 2011-06-10 16:02:00
您可以發佈您使用過的代碼嗎? – Nir 2011-08-02 08:41:28