-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: #88 add AVContentProposalViewController to VideoPlayerViewContr…
…oller
- Loading branch information
1 parent
92d4f9b
commit b7828d2
Showing
5 changed files
with
207 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
BilibiliLive/Component/Player/BLContentProposalViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// BLContentProposalViewController.swift | ||
// BilibiliLive | ||
// | ||
// Created by yicheng on 2023/11/20. | ||
// | ||
|
||
import AVKit | ||
import UIKit | ||
|
||
class BLContentProposalViewController: AVContentProposalViewController { | ||
let nextButton = BLCustomTextButton() | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
view.addSubview(nextButton) | ||
view.backgroundColor = UIColor.clear | ||
nextButton.addTarget(self, action: #selector(actionAccept), for: .primaryActionTriggered) | ||
nextButton.title = "下一个:" + (contentProposal?.title ?? "") | ||
nextButton.titleFont = UIFont.systemFont(ofSize: 30) | ||
nextButton.snp.makeConstraints { make in | ||
make.right.equalToSuperview().offset(-50) | ||
make.height.equalTo(60) | ||
make.width.greaterThanOrEqualTo(200) | ||
make.width.lessThanOrEqualTo(500) | ||
make.bottom.equalToSuperview().multipliedBy(0.75) | ||
} | ||
} | ||
|
||
@objc func actionAccept() { | ||
dismissContentProposal(for: .accept, animated: true) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.