Playing videos in AVPlayerViewController
We have created a controller class that inherited the AVPlayerViewController and are playing it back with the following code:
self.player=[AVPlayer playerWithURL:url];
[self.player play]
When I start playing, sometimes the screen becomes completely dark and no video is displayed.The audio is playing.
Continuous reproduction or difficulty in reproducing.
iOS version: 10.0.2
Please advise me on a workaround.
ios objective-c
The official document says not to create subclasses of AVPlayerViewController.
https://developer.apple.com/reference/avkit/avplayerviewcontroller
Do not subclass AVPlayerViewController.Overriding this class's methods is unsupported and results in undefined behavior.
Why don't you use this as a reference to implement it?
https://stackoverflow.com/a/31277658/4834226
856 Uncaught (inpromise) Error on Electron: An object could not be cloned
776 M2 Mac fails to install rbenv install 3.1.3 due to errors
1235 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
771 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2025 OneMinuteCode. All rights reserved.