【发布时间】:2016-11-01 12:36:18
【问题描述】:
我在单元格容器中创建服装单元格,我需要播放视频但我尝试使用我的代码显示为空..
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
{
let cell = tableView.dequeueReusableCell(withIdentifier: "VedioCell", for: indexPath) as! FeedCell
let videoURL = NSURL(string: "http://clips.vorwaerts-gmbh.de/VfE_html5.mp4")
let player = AVPlayer(url: videoURL! as URL)
let playerLayer = AVPlayerLayer(player: player)
playerLayer.frame = cell.bounds
cell.layer.addSublayer(playerLayer)
player.play()
return cell
}
提前致谢
【问题讨论】:
标签: ios swift uitableview avplayer tableviewcell