【问题标题】:How can i start a video downloaded from parse in MPMoviePlayerController如何启动从 MPMoviePlayerController 中的解析下载的视频
【发布时间】:2015-11-22 00:03:27
【问题描述】:

如何使用从解析中下载的 MPMoviePlayerController 播放视频,保存为 PFFile? 我用这个代码下载了视频文件:

    var query = PFQuery(className:"Video")
    query.whereKey("Nome", equalTo:"prova")
    query.findObjectsInBackgroundWithBlock {
        (objects: [AnyObject]?, error: NSError?) -> Void in

        if error == nil {
            // The find succeeded.
            println("Successfully retrieved \(objects!.count) scores.")
            if let objects = objects as? [PFObject] {
                for object in objects {
                    var imageFile:PFFile =object.objectForKey("Video")
                    imageFile.getDataInBackgroundWithBlock {
                        (imageData: NSData?, error: NSError?) -> Void in

                     ?????????????   
                    }

            }
        } else {
            println("Error: \(error!) \(error!.userInfo!)")
        }
    }

【问题讨论】:

    标签: xcode parse-platform ios8 mpmovieplayer pffile


    【解决方案1】:

    您可以将该数据临时保存在文档目录中并播放来自 NSString *strLocation = [@"~/Documents/downloadedFile.mov" stringByExpandingTildeInPath]; // Use Your Downloaded Data [data writeToFile:strLocation atomically:YES]; // Pass URL of that saved file in Player MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:strLocation]];的视频

    希望对你有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-16
      • 1970-01-01
      相关资源
      最近更新 更多