【发布时间】:2016-03-28 12:07:58
【问题描述】:
我是 iOS 开发的新手。我想播放视频。所以我使用 MPMoviePlayerController 来播放我的视频。现在我想为这个视频设置圆角半径。不知道怎么弄?
我尝试layer.cornerRadius 获取故事板中的背景视图。它不工作。
这是我的电影播放器代码
let url = NSURL.fileURLWithPath(path)
moviePlayer = MPMoviePlayerController(contentURL: url)
if let player = moviePlayer {
player.view.frame = videoBackgroundView.bounds
player.prepareToPlay()
player.scalingMode = .Fill
videoBackgroundView.addSubview(player.view)
}
是否可以为视频设置角落?请有人帮我解决这个问题。
【问题讨论】:
-
尝试将
mask应用于图层,但这样会丢失角落里的视频 -
怎么做?任何样品
标签: ios swift mpmovieplayercontroller mpmovieplayer