BMPlayer icon indicating copy to clipboard operation
BMPlayer copied to clipboard

Full screen mode in Portrait Mode

Open DipyaChandniDas opened this issue 7 years ago • 11 comments

Hi @BrikerMan Can you please advice, if would make fullscreen mode in Portrait. The video should not show in middle of the screen rather it should display in scale to fill mode.

DipyaChandniDas avatar Jul 31 '17 09:07 DipyaChandniDas

check #92 and #111

BrikerMan avatar Jul 31 '17 09:07 BrikerMan

@BrikerMan I am sorry, I am not able to get code to do this. Could you please provide me the code to do this?

DipyaChandniDas avatar Jul 31 '17 12:07 DipyaChandniDas

change videoGravity of the player~

BrikerMan avatar Aug 01 '17 00:08 BrikerMan

Please see the the image attached the, we have changed the gravity to AspectFill but its still coming in the center where as We want the video should be Zoomed and should be shown in full screen.

img_0193 png

DipyaChandniDas avatar Aug 09 '17 14:08 DipyaChandniDas

@BrikerMan We are seriously in need of this feature. Please help us.

DipyaChandniDas avatar Aug 09 '17 14:08 DipyaChandniDas

I don't get what you need. Please provide me with some sketch maybe. DipyaChandniDas [email protected]于2017年8月9日 周三下午10:30写道:

@BrikerMan https://github.com/brikerman We are seriously in need of this feature. Please help us.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BrikerMan/BMPlayer/issues/135#issuecomment-321272853, or mute the thread https://github.com/notifications/unsubscribe-auth/AI71S5-RPQlLoQesw-MNWWRPddxiDSz_ks5sWcKEgaJpZM4OoGIU .

BrikerMan avatar Aug 09 '17 14:08 BrikerMan

Sorry for replying on old thread. I have similar issue, and I think the videoGravity can't work properly because this line in BMPlayerLayerView in layoutSubviews will override the instance videoGravity:

self.playerLayer?.videoGravity = AVLayerVideoGravity.resizeAspect

In my case I changed it into

self.playerLayer?.videoGravity = self.videoGravity

deden avatar May 14 '19 03:05 deden

Sorry for replying on old thread. I have similar issue, and I think the videoGravity can't work properly because this line in BMPlayerLayerView in layoutSubviews will override the instance videoGravity:

self.playerLayer?.videoGravity = AVLayerVideoGravity.resizeAspect

In my case I changed it into

self.playerLayer?.videoGravity = self.videoGravity

Which version u are using?

BrikerMan avatar May 14 '19 07:05 BrikerMan

version 1.0.2

deden avatar May 20 '19 04:05 deden

I am having same issue, there is no effect if change the video gravity, later i found `

override open func layoutSubviews() {
    super.layoutSubviews()
    switch self.aspectRatio {
    case .default:
        self.playerLayer?.videoGravity = AVLayerVideoGravity.resizeAspect
        self.playerLayer?.frame  = self.bounds
        break
    case .sixteen2NINE:
        self.playerLayer?.videoGravity = AVLayerVideoGravity.resize
        self.playerLayer?.frame = CGRect(x: 0, y: 0, width: self.bounds.width, height: self.bounds.width/(16/9))
        break
    case .four2THREE:
        self.playerLayer?.videoGravity = AVLayerVideoGravity.resize
        let _w = self.bounds.height * 4 / 3
        self.playerLayer?.frame = CGRect(x: (self.bounds.width - w )/2, y: 0, width: w, height: self.bounds.height)
        break
    }
}`

I didn't understand, while setting videoGravity from my ViewController and later the video videoGravity got changed by this class. BMPlayerLayerView.swift any solution

mohanbright avatar Jul 01 '20 13:07 mohanbright

同问,当设置videoGravity时,在layoutSubviews被重写了,设置videoGravity方法失效

JenkinChen avatar Aug 31 '20 08:08 JenkinChen