2017-11-27 14 views

답변

0

를 호출되지 않았다 ? OP 코드에서 언급 한 것들을 찾을 수 없습니다.
+0

이 위의 질문에 대한 답변입니다 : 불행하게도 shouldWaitForLoadingOfRequestedResource delegate 당신은 @"anyname"

NSURLComponents *components = [[NSURLComponents alloc] initWithURL:url resolvingAgainstBaseURL:NO]; components.scheme = @"anyname"; 

와의 Info.plist URL을 키 - 값 urltypes 방식을 추가로 @"http" 교체가 필요

import UIKit import AVKit import AVFoundation class ViewController: UIViewController, AVAssetResourceLoaderDelegate var player: AVPlayer! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } override func viewDidAppear(_ animated: Bool) { let videoURL = URL(string: "https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8") let asset = AVURLAsset(url: videoURL! as URL, options: nil) asset.resourceLoader.setDelegate(self, queue: DispatchQueue.main) let item = AVPlayerItem(asset: asset) let player = AVPlayer(playerItem: item) let playerViewController = AVPlayerViewController() playerViewController.player = player self.present(playerViewController, animated: true) { playerViewController.player!.play() } } func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForLoadingOfRequestedResource loadingRequest: AVAssetResourceLoadingRequest) -> Bool { NSLog("This method is never called") return true } } 
m00am