如何通过Chromecast sdk投射清单文件?

时间:2017-04-01 16:51:00

标签: ios swift chromecast

如何投射清单文件? 我尝试创建这样的媒体信息:

let customData = NSMutableDictionary()
        customData[CONTENT_ID_KEY] = contentData.contentID
        customData[CONTENT_TYPE_KEY] = Int(getMediaType(contentData).rawValue)

        let mediaInformation = GCKMediaInformation(contentID: contentData.contentID, streamType: GCKMediaStreamType.buffered, contentType: "application/vnd.ms-sstr+xml", metadata: metaData, streamDuration: 0, mediaTracks: nil, textTrackStyle: GCKMediaTextTrackStyle.createDefault(), customData: customData)

然后我尝试开始施放:

let castSession = GCKCastContext.sharedInstance().sessionManager.currentCastSession
castSession.remoteMediaClient?.loadMedia(mediaInformation, autoplay: true, playPosition: 0)

然后chromecast开始加载,但几秒钟后就停止了。可能是什么问题?

0 个答案:

没有答案