SmartPlay API returns true but content not playing on the receiver.
The sender is connected to the receiver.
The User selects any video to cast to the receiver.
Application code dos and don'ts
Make sure AppAdapter methods are implemented
Step 1 - Make sure the following adapter method is implemented to return the success callback with the right metadata
func getVZBMetadata(
fromVideo appVideoObject: Any,
onSuccess successCallback: @escaping (VZBVideoMetadata) -> Void,
onFailure failureCallback: @escaping (Error) -> Void
) {
if let videoModel = appVideoObject as? VideoModel {
let metadata = VZBVideoMetadata()
metadata.guid = videoModel.videoId
metadata.title = videoModel.title
metadata.subTitle = videoModel.playListTitle
metadata.imageURL = videoModel.imageURL
metadata.isLive = videoModel.isLive
successCallback(metadata)
return
}
// default
failureCallback(NSError(domain: "Unrecognized video type: \(appVideoObject)", code: 2, userInfo: nil))
}
Step 2 - Make sure the following adapter method is implemented to return the success callback with the right stream information
func getVZBStreamInfo(
fromVideo appVideoObject: Any,
for _: VZBScreenType,
onSuccess successCallback: @escaping (VZBVideoStreamInfo) -> Void,
onFailure failureCallback: @escaping (Error) -> Void
) {
if let videoModel = appVideoObject as? VideoModel {
let streamInfo = VZBVideoStreamInfo()
streamInfo.videoURL = videoModel.hlsURL
stramInfo.guid = videoModel.guid
// optional
streamInfo.customStreamInfo = [
"authToken" : "<authToken>",
"refreshToken" : "<refreshToken>",
...
]
successCallback(streamInfo)
return
}
// default
failureCallback(NSError(domain: "Unrecognized video type: \(appVideoObject)", code: 2, userInfo: nil))
}
Step 3 - Make sure the receiver is able to deep-link to the player with the right playback information.