我正在将音频直播和音频点播 m3u8 文件从我的 iOS 发送器应用程序流式传输到 chromecast。这样做时,接收器屏幕是黑色的,并且不显示有关当前流式音频的任何信息。只有当流暂停时,才会显示信息。有没有办法在播放音频时显示音频信息?如果 mp3 文件流式传输到 chromecast,则音频信息显示为播放和暂停状态。
我正在使用 Cast 4.0.1 SDK,这是我的媒体设置:
// setup metadata with playback information
let metadata = GCKMediaMetadata(metadataType: GCKMediaMetadataType.musicTrack)
metadata.setString(playback.title, forKey: kGCKMetadataKeyTitle)
metadata.setString(playback.subtitle, forKey: kGCKMetadataKeyArtist)
metadata.addImage(GCKImage(url: playback.imageSmall, width: 1024, height: 1024))
let streamType: GCKMediaStreamType = .buffered
let contentType: String = "application/vnd.apple.mpegurl"
let duration: Double = playback.duration
let mediaInfo = GCKMediaInformation(contentID: streamURL.absoluteString, streamType: streamType, contentType: contentType, metadata: metadata, streamDuration: duration, mediaTracks: nil, textTrackStyle: nil, customData: nil)
// seek to start position
let mediaLoadOptions = GCKMediaLoadOptions()
mediaLoadOptions.playPosition = playPosition
// load media and start playback
let request = session.remoteMediaClient?.loadMedia(mediaInfo, with: mediaLoadOptions)
request?.delegate = self