Parse platform 在Uiimage中将视频检索为PFFile

Parse platform 在Uiimage中将视频检索为PFFile,parse-platform,uiimage,pffile,Parse Platform,Uiimage,Pffile,我正在尝试将从Parse检索到的视频放到UIimage中,我需要这方面的帮助。 我把视频作为文件检索。 这是我的密码 func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell :mineCell = tableView.dequeueReusableCellWithIdentifier("mineCell")a

我正在尝试将从Parse检索到的视频放到UIimage中,我需要这方面的帮助。 我把视频作为文件检索。 这是我的密码

 func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell :mineCell = tableView.dequeueReusableCellWithIdentifier("mineCell")as! mineCell

    cell.usernameLabel.text = creator[indexPath.row]

    videoFile[indexPath.row].getDataInBackgroundWithBlock { (videoData :NSData?, error:NSError?) -> Void in
        if videoData != nil{
        let video = UIImage(data: videoData!)
            cell.videoView.image = video
            println("it should the video load in the UImage ")
        }
        else {
            println(error)
        }
    }
    return cell

问题是您无法将视频数据放入UIImage

您需要获取UIImage作为视频的缩略图

在此基础上,通过以下步骤可以完成从PFFile播放视频

// Load yourObject which has the video (PFFile)
var fileURL = NSURL(string: yourObject.video.url!)
var moviePlayer = MPMoviePlayerViewController(contentURL: fileURL)
self.presentMoviePlayerViewControllerAnimated(moviePlayer)
moviePlayer.moviePlayer.play()

好。您有实际问题吗?感谢您重播@planetmaker,实际问题是视频没有加载到uiimage中,是否有其他方法加载它