Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MiniPlayer: Audio #221

Merged
merged 1 commit into from Apr 3, 2019

Conversation

Mikanbu
Copy link
Member

@Mikanbu Mikanbu commented Mar 15, 2019

Checklist

  • I've run bundle exec fastlane test from the root directory to see all new and existing tests pass
  • I've followed the vlc-ios code style
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Description

This adds a new mini player for audio according to the new design.

With this PR, I didn't want to break the whole VLCPlayerDisplayController architecture we currently have. So in order to use VLCPlayerDisplayController I created a MiniPlayer interface.

Therefore, this removes the usage of VLCMiniPlaybackView from the project.

For now, in VLCPlayerDisplayController, only the AudioMiniPlayer is used.
This should be fixed with the integration of a VideoMiniPlayer later on.

@Mikanbu
Copy link
Member Author

Mikanbu commented Mar 15, 2019

Rebased to style fix on master.

@Mikanbu Mikanbu force-pushed the newui/miniplayer/audio/init branch from 77afcac to bef7906 Compare March 21, 2019 12:52
@Mikanbu
Copy link
Member Author

Mikanbu commented Mar 21, 2019

Rebased and add handling of video output.

Copy link
Member

@carolanitz carolanitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm overall. I would just change the selected state image and double check the setMediaInfo for video

var visible: Bool = false
var contentHeight: Float {
return 72.0
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this would resize itself based on it's constraints and content, thinking of longer titles or people with bigger font. That is something the old UI lagged

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say in a follow-up ticket. For me, this isn't a priority.

Sources/MiniPlayer/AudioMiniPlayer.swift Outdated Show resolved Hide resolved
currentMediaHasTrackToChooseFrom: Bool,
currentMediaHasChapters: Bool,
for controller: VLCPlaybackController) {
updatePlayPauseButton()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there is a bug where the isPlaying event doesn't always get triggered that we worked around in the old UI. Can you double check if it was handled in the UI or somewhere else?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure to see which bug you are referring to? Looking at the old mini player it doesn't look like there was anything special.
Please let me know if I missed something.

Sources/MiniPlayer/AudioMiniPlayer.swift Outdated Show resolved Hide resolved
switch sender.state {
// case .began:
// In the case of .began we could a an icon like the old miniplayer
case .ended:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it a ticket and remove the suggestion and commented out code. Instead of leaving that in code, commenting here on the PR is better than checking suggestions in into the codebase :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I didn't want to create a ticket before the PR was merged.
I still would want to keep the comment with a ref to the ticket but I can also remove it.

Sources/MiniPlayer/AudioMiniPlayer.swift Show resolved Hide resolved
Resources/Xib/MiniPlayer/AudioMiniPlayer.xib Outdated Show resolved Hide resolved
private extension AudioMiniPlayer {
private func initView() {
Bundle.main.loadNibNamed("AudioMiniPlayer", owner: self, options: nil)
addSubview(audioMiniPlayer)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks odd to me that the AudioMiniplayer loads a Nib that is also called AudioMiniPlayer and adds that as a subview.
I would've expected this call to be wherever the AudioMiniplayer is instantiated and to have the rest of the setup code in initWithDecoder or awakeFromNib.

Sources/MiniPlayer/AudioMiniPlayer.swift Outdated Show resolved Hide resolved
Sources/MiniPlayer/AudioMiniPlayer.swift Show resolved Hide resolved
This add a new audio mini player according to the new design.
For now, we will use the same player for audio and video.

(closes videolan#164)
@Mikanbu Mikanbu force-pushed the newui/miniplayer/audio/init branch from 9b98a32 to c797a1d Compare April 3, 2019 13:08
@Mikanbu
Copy link
Member Author

Mikanbu commented Apr 3, 2019

Addressed review, rebased & fixupped.

@vlc-mirrorer vlc-mirrorer merged commit c797a1d into videolan:master Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants