I checked CastVideos-ios sample app and now using this code to switch current item when casting to Chromecast:
let builder = GCKMediaInformationBuilder(contentURL: url)
if let remoteMediaClient = GCKCastContext.sharedInstance().sessionManager.currentCastSession?.remoteMediaClient {
remoteMediaClient.loadMedia(with: builder.build())
}
It works for the videos from this example, but I also need to play videos with FairPlay protection. How can I set AVAssetResourceLoaderDelegate in such case? Or should I use another approach?