该讯息与此帖相同 - MobileVLCKit iOS Camera roll video "VLC is unable to open the MRL" error 如何更改消息甚至在应用程序中禁用它?
class PlayerViewController: UIViewController,VLCMediaPlayerDelegate{
@IBOutlet var ActivityIndicator: UIActivityIndicatorView!
@IBOutlet var movieView: UIView!
var mediaPlayer = VLCMediaPlayer()
var webcamURL: String!
var previousDeviceOrientation: UIDeviceOrientation = UIDevice.current.orientation
override func viewDidLoad() {
super.viewDidLoad()
let url = URL(string: webcamURL)
let media = VLCMedia(url: url)
mediaPlayer.media = media
mediaPlayer.drawable = movieView
mediaPlayer.play()
movieView.frame = UIScreen.screens[0].bounds
let gesture = UITapGestureRecognizer(target: self, action: #selector(PlayerViewController.movieViewTapped(_:)))
movieView.addGestureRecognizer(gesture)
ActivityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.white;
ActivityIndicator.center = view.center;
ActivityIndicator.startAnimating();
}
}
答案 0 :(得分:0)
在Swift中,它会是这样的:
let options = ["--extrainf="]
let mediaPlayer = VLCMediaPlayer(options: options)