gpt4 book ai didi

google-chrome - 谷歌转换 : How to show metadata in default media player?

转载 作者:行者123 更新时间:2023-12-01 14:08:45 26 4
gpt4 key购买 nike

我试图让我的 chrome 发送器应用程序将元数据发送到默认媒体接收器应用程序,但默认媒体接收器不显示元数据。我找不到文档或示例。有人知道如何实现吗?下面的代码播放音频,但播放器不显示任何图像或其他元数据。

初始化:

 var sessionRequest = new chrome.cast.SessionRequest(chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID);
var apiConfig = new chrome.cast.ApiConfig(sessionRequest,
sessionListener,
receiverListener);
chrome.cast.initialize(apiConfig, onInitSuccess, onError);
chrome.cast.requestSession(onRequestSessionSuccess, onLaunchError);

...

正在加载媒体

url = "url-to-media"
var mediaInfo = new chrome.cast.media.MediaInfo(url, 'audio/aac');
mediaInfo.metadata = new chrome.cast.media.MusicTrackMediaMetadata()
mediaInfo.metadata.albumName = 'This is the name of the album'
mediaInfo.metadata.artistName = 'This is the name of the artist'
mediaInfo.metadata.songName = 'This is the name of the song'
im = chrome.cast.Image('http://m1.behance.net/rendition/modules/575407/disp/822271229466847.png')
mediaInfo.metadata.images = new Array(im)
var request = new chrome.cast.media.LoadRequest(mediaInfo);
session.loadMedia(request,onMediaDiscovered.bind(this, 'loadMedia'), onMediaError())

最佳答案

试试这个 -

mediaInfo.metadata.title = 'This is the name of the song';
mediaInfo.metadata.subtitle = 'This is the name of the artist';

关于google-chrome - 谷歌转换 : How to show metadata in default media player?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21659369/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com