2 AVPlayers playing the same file

I have a video asset downloaded from the Internet. I want to display this Video twice on the screen on a 2 different video layers (video playback is the same, both start and pause together).

Things I've tried:

  • 2 AVPlayers the same AVAsset, but the video was downloaded twice.
  • 1 AVPlayer with 2 AVPlayerLayer, only 1 video was shown on screen.
  • 2个相同视频内容的视频播放器

    The video content is the same so the video should be downloaded once. The 2 video players should be sync.

    What should I do?


    I needed to achieve 2 video playback, and I based it on the example here, though this doesn't involve downloading the video: http://iosguy.com/2012/01/11/multiple-video-playback-on-ios/

    The source code is here: https://github.com/cezarsignori/MyVideoPlayer

    Hopefully that helps a bit.


    您可以尝试将视频下载或流式传输到在同一应用程序中的另一个线程上运行的本地服务器,并且此本地主机服务器可能能够向2个AVPlayers提供2个视频流。

    链接地址: http://www.djcxy.com/p/56878.html

    上一篇: 全屏:AVPlayerLayer在调整其父视图的大小时不会调整大小

    下一篇: 2个AVPlayers播放相同的文件