I am trying to make an iPhone application where you press a button and it streams a video from my mac to the phone via MAMP. When I hit the button the player shows up however the video does not play and I get this error.
2018-03-15 10:19:30.487597-0500 stream[5956:2522500] CredStore - performQuery - Error copying matching creds. Error=-25300, query={
class = inet;
"m_Limit" = "m_LimitAll";
"r_Attributes" = 1;
sync = syna;
}
2018-03-15 10:19:30.644950-0500 stream[5956:2522500] [] <<<< AVOutputDeviceDiscoverySession (FigRouteDiscoverer) >>>> -[AVFigRouteDiscovererOutputDeviceDiscoverySessionImpl outputDeviceDiscoverySessionDidChangeDiscoveryMode:]: Setting device discovery mode to DiscoveryMode_None (client: stream)
2018-03-15 10:19:30.714388-0500 stream[5956:2522500] [framework] CUICatalog: Invalid asset name supplied: '(null)'
2018-03-15 10:19:30.714440-0500 stream[5956:2522500] [framework] CUICatalog: Invalid asset name supplied: '(null)'
2018-03-15 10:19:30.763593-0500 stream[5956:2522500] [] <<<< AVOutputDeviceDiscoverySession (FigRouteDiscoverer) >>>> -[AVFigRouteDiscovererOutputDeviceDiscoverySessionImpl outputDeviceDiscoverySessionDidChangeDiscoveryMode:]: Setting device discovery mode to DiscoveryMode_Presence (client: stream)
2018-03-15 10:19:30.846707-0500 stream[5956:2522500] [framework] CUICatalog: Invalid asset name supplied: '(null)'
2018-03-15 10:19:30.846763-0500 stream[5956:2522500] [framework] CUICatalog: Invalid asset name supplied: '(null)'
Here is the full code:
import UIKit
import AVKit
import AVFoundation
class ViewController: UIViewController {
@IBAction func playVideo(_ sender: Any) {
guard let url = URL(string: "http://host-2:8888/The Serenity Trance Sample Pack (138 bpm Loops, Vocals, Drums, Snares, Presets, and more!).m3u8") else {
return
}
// Create an AVPlayer, passing it the HTTP Live Streaming URL.
let player = AVPlayer(url: url)
// Create a new AVPlayerViewController and pass it a reference to the player.
let controller = AVPlayerViewController()
controller.player = player
// Modally present the player and call the player's play() method when complete.
present(controller, animated: true) {
player.play()
}
}
}