Slide 11
Slide 11 text
Load Media
let meta = GCKMediaMetadata(metadataType: .Movie)
meta.setString("わさビーフの奇妙な冒険 #1", forKey: kGCKMetadataKeyTitle)
meta.setString("堅あげポテトは砕けない", forKey: kGCKMetadataKeySubtitle)
meta.addImage(
GCKImage(URL: NSURL(string: “https://wasabeef.jp/cover.webp")!, width: 480, height: 720))
let mediaInfo = GCKMediaInformation(
contentID: "https://wasabeef.jp/jojo-anim.m3u8",
streamType: .Buffered,
contentType: "application/x-mpegurl",
metadata: meta,
streamDuration: 0,
mediaTracks: [],
textTrackStyle: nil,
customData: nil
)
if let session = GCKCastContext.sharedInstance().sessionManager.currentCastSession {
session.remoteMediaClient.loadMedia(mediaInfo, autoplay: true)
}