I want to play live broadcasting/streaming video in ios. i am trying using AsyncDisplayKit but video is not playing. is there any library for this?.
DispatchQueue.global(qos: DispatchQoS.QoSClass.background).async(execute: {
if self.mainNode == nil {
self.mainNode = ASDisplayNode()
self.videoNode = ASVideoNode()
self.videoNode!.frame = CGRect(x: 0.0, y: 0.0, width: self.bounds.width, height: self.bounds.height)
self.videoNode!.gravity = AVLayerVideoGravityResizeAspectFill
self.videoNode!.shouldAutoplay = true
self.videoNode!.shouldAutorepeat = false
self.videoNode!.muted = false
self.videoNode.delegate = self
self.videoNode.isUserInteractionEnabled = true
self.videoNode!.placeholderEnabled = true
DispatchQueue.main.async(execute: {
self.mainNode!.addSubnode(self.videoNode!)
self.addSubview(self.mainNode!.view)
})
}
self.videoNode?.asset = AVAsset(url: self.url)
DispatchQueue.main.async(execute: {
self.videoNode?.placeholderImage()
})
})