Draw button on top of AVPlayer

前端 未结 5 2085
执念已碎
执念已碎 2020-12-28 09:29

I have to draw a label or button on top of video relay next previous , leave comment . List of video have it, once user select one item from the table,it need t

5条回答
  •  青春惊慌失措
    2020-12-28 10:09

    I think the best way to make the avplayer buttons is explained here: IOS 8 Video Playback using AVPlayer and AVPlayerViewController .

    So , I prefeer and agree with these instructions, but if you still want to add these buttons you can try to add them to the self.window

    if let app = UIApplication.sharedApplication().delegate as? AppDelegate, let window = app.window {
            let myFirstButton = UIButton()
            myFirstButton.setTitle("test", forState: .Normal)
            window.addSubview(myFirstButton)
            ...
    }
    

提交回复
热议问题