AVPlayer does not play video Instantly on iOS 10, while audio playing only

后端 未结 4 936
南方客
南方客 2021-02-09 00:15

I am creating video with AVAssetExportSession and playing video when it finishes. But Visual Part not showing instantly but only audio is playing instantly. Visual part comes af

4条回答
  •  悲哀的现实
    2021-02-09 00:26

    Im facing the same problem and my solution is take old code into main thread:

            -(void)ExporterManager:(DoCoExporterManager *)manager DidSuccessComplementWithOutputUrl:(NSURL *)outputUrl{
    //...
    dispatch_async(dispatch_get_main_queue(), ^{
                [_playView setContentUrl:outputUrl.path];
            });
    //...
        }
    

    Im using exportAsynchronouslyWithCompletionHandler to process my video.someone thinks that AVVideoCompositionCoreAnimationTool is the cause of the issuehttps://forums.developer.apple.com/thread/62521. I'm not sure,but i do use it.

    Just try it!

    Hope this helps!

提交回复
热议问题