-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Now that MUXSDKCustomerVideoData.videoCdn deprecated how can we specify the CDN string without doing a full custom integration?
I see a guide for custom integration here
https://www.mux.com/docs/guides/data-custom-objectivec-integration
But that is not something we should need to do.
We used to be be able just doing this:
/// MUX
extension VideoAnalyticsManager {
private func setupMux(playerItem: PlayerItem, url: URL, playerController: PlayerControllerProtocol) {
log.info("MUX: setup")
let playerData = MUXSDKCustomerPlayerData()
playerData.environmentKey = Configuration.mux.envKey
playerData.viewerUserId = SecureSettings.userId.description
playerData.playerName = Configuration.brainiac.partnerId
playerData.playerVersion = BuildInfo.current.shortVersionText
playerData.playerInitTime = NSNumber(value: Date().timeIntervalSince1970 * 1000)
let videoData = MUXSDKCustomerVideoData()
if url.isFileURL {
videoData.videoCdn = "Downloaded Video"
videoData.videoIsLive = false
}
else {
videoData.videoCdn = url.host
videoData.videoIsLive = true
}
let name = playerItem.video.assetName
let videoId = playerItem.video.id
let titleId = playerItem.title.id
videoData.videoTitle = "\(name). Video ID: \(videoId). Title ID: \(titleId)."
videoData.videoId = videoId.description
videoData.videoDuration = NSNumber(value: playerItem.video.runtime * 1000)
videoData.videoStreamType = "HLS"
videoData.videoIsLive = 0
let viewData = MUXSDKCustomerViewData()
guard let customerData = MUXSDKCustomerData(customerPlayerData: playerData, videoData: videoData, viewData: viewData) else {
log.error("Unable to create MUXSDKCustomerData")
return
}
guard let playerLayer = playerController.playerLayer else {
log.error("Unable to get player layer for MUX")
return
}
MUXSDKStats.monitorAVPlayerLayer(playerLayer, withPlayerName: Configuration.brainiac.partnerId, customerData: customerData)
}
private func removeMux() {
log.info("MUX: remove")
MUXSDKStats.destroyPlayer(Configuration.brainiac.partnerId)
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels