twilio / video-quickstart-ios

Twilio Video Quickstart for iOS
https://www.twilio.com/docs/api/video
MIT License
461 stars 178 forks source link

Capture screen with avvideoplayer instance #238

Closed tanaev closed 6 years ago

tanaev commented 6 years ago

Hi! I need some help!

User1 shared his screen to User2. User1 opened video from device library while sharing screen User2 can see only avvideoplayer controls and black screen instead video.

Could someone help me, how properly i need setup screen capturer to share screen with video

ceaglest commented 6 years ago

Hey @tanaev,

Can you confirm that you are using AVPlayer? If so, it's not going to be possible to capture copy protected content from an AVPlayerLayer simply by drawing it using TVIScreenCapturer. I believe ReplayKit has the same limitation as well.

When AVPlayer is playing content using an external output the output is obscured unless sufficient copy protection is available, I believe the same concept is used when trying to capture from AVPlayer rendering to the internal screen.

https://developer.apple.com/documentation/avfoundation/avplayer/1624254-isoutputobscuredduetoinsufficien

https://developer.apple.com/documentation/replaykit

Confirms - "ReplayKit is incompatible with AVPlayer content."

Best, Chris

tanaev commented 6 years ago

Thanks @ceaglest !

Yes, im using AVPlayer. And im not sure if its possible to play PHAssets in some way instead of AVPlayer

ceaglest commented 6 years ago

Hi @tanaev,

AVPlayer is certainly the recommended way to play photos assets. Given Apple's restriction on capturing its contents you would have to find some other way to share the videos. You could potentially transfer the video file from one Client to another (perhaps upload it to a shared place).

Is there anything else I can do to help you at this time?

Best, Chris

tanaev commented 6 years ago

That all! Thank you!

Please close the issue

ceaglest commented 6 years ago

You are very welcome. Best of luck on your project.