gpt4 book ai didi

ios - 隐藏视频控件 MPMoviePlayerController

转载 作者:搜寻专家 更新时间:2023-11-01 05:54:24 25 4
gpt4 key购买 nike

我已经引用了对同一个问题的几个回答,但他们的解决方案对我不起作用。我只想在观看本地内容的视频时隐藏所有用户控件。它在 moviePlayer?.controlStyle = MPMovieControlStyleNone 线上出错,错误为“使用未解析的标识符用于 MPMovieControlStyleNone。

这是我的完整代码块。

import UIKit
import MediaPlayer

var moviePlayer : MPMoviePlayerController?

class ViewController: UIViewController {

func playVideo() {
let path = NSBundle.mainBundle().pathForResource("IntroVideo", ofType: "mp4")
let url = NSURL.fileURLWithPath(path!)
moviePlayer = MPMoviePlayerController(contentURL: url)
if let player = moviePlayer {
player.view.frame = self.view.bounds
moviePlayer?.controlStyle = MPMovieControlStyleNone
player.prepareToPlay()
player.scalingMode = .AspectFill
self.view.addSubview(player.view)
}
}

override func viewDidLoad() {
super.viewDidLoad()
playVideo()
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}

最佳答案

moviePlayer!.controlStyle = MPMovieControlStyle.None for ios 8 and 9

关于ios - 隐藏视频控件 MPMoviePlayerController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26523084/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com