MillmanY / MMPlayerView

Custom AVPlayerLayer on view and transition player with good effect like youtube and facebook
MIT License
730 stars 118 forks source link

Black screen #95

Open pankajpatel1305 opened 4 years ago

pankajpatel1305 commented 4 years ago

Sometimes the black screen comes when the screen rotation changes.

macchamps commented 3 years ago

Hello, I also facing this issue.

fukemy commented 3 years ago

lul same issues, my eyes got red when find the problem make black screen.... then when debug view hierarchy found coz of mmplayerview

fukemy commented 3 years ago

ok after trying to debug i saw MMLanscapeWindow suddenly appear in window hierarchy, oh my .... even i did not wanna to shink video... (just add to collectionViewCell). Ok, just disable it

public lazy var mmPlayerLayer: MMPlayerLayer = {
        let l = MMPlayerLayer()
        l.cacheType = .memory(count: 5)
        l.coverFitType = .fitToPlayerView
        l.autoPlay = true
        l.player?.volume = 0
        l.repeatWhenEnd = true
        l.fullScreenWhenLandscape = false -> HERE
        l.videoGravity = AVLayerVideoGravity.resizeAspect
        return l
    }()
octal-pankaj commented 3 years ago

Getting the same issue...@fukemy thanks for your answer, but it does not work for me... If there is any other solution please let me know

fukemy commented 3 years ago

@octal-pankaj , just capture view hierachy, if you see MMLanscapeWindow. Then search all project with that key "fullScreenWhenLandscape", and tried to find the code to disable it