Skip to content

Commit

Permalink
Review fixes for dead comments and some reorganization for view layout
Browse files Browse the repository at this point in the history
Closes: #1537
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
kroucis authored and jb55 committed Sep 5, 2023
1 parent 07522b1 commit 9723efd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
13 changes: 5 additions & 8 deletions damus/Views/Video/DamusVideoPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,9 @@ struct DamusVideoPlayer: View {

private var VideoTime: some View {
Text("\(self.model.currentTime.secondsToHumanReadableTimecode) / \(self.model.totalDuration.secondsToHumanReadableTimecode)")
.padding([.leading, .trailing], 1)
.padding([.top, .bottom], nil)
.monospacedDigit()
.foregroundColor(muteIconColor)
// Both of these ensure that the Text label doesn't jump around from digit width changes
.monospacedDigit()
.fixedSize(horizontal: true, vertical: true)
.onTapGesture {
self.model.play.toggle()
Expand All @@ -175,9 +174,6 @@ struct DamusVideoPlayer: View {

VideoPlayer(url: url, model: model)
.zIndex(0.0)
// .onAppear {
// self.model.start()
// }
.onTapGesture {
if let tapHandler = onVideoTapped {
tapHandler()
Expand Down Expand Up @@ -230,10 +226,11 @@ struct DamusVideoPlayer: View {

VideoTime
.frame(maxWidth: .infinity, alignment: .center)
.padding([.leading, .trailing], 1)
.padding([.top, .bottom], nil)

// Settings, Fullscreen, and Volume
HStack {
// TODO: Changing playback speed is currently broken for unknown reasons.
SettingsButton

if model.has_audio == true {
Expand Down Expand Up @@ -383,7 +380,7 @@ fileprivate extension DamusVideoPlayer {
fileprivate extension DamusVideoPlayer {
/// A seek time slider ranging from 0.0 (beginning) to `totalDuration` at the end.
/// `onEditingChanged` is called when the user begins or ends editing the current play location using this slider.
/// `onTimeFinalized` is called when the user end editing and the new time has been calculated, ready for seek.
/// `onTimeFinalized` is called when the user ends editing and the new time has been calculated, ready for seek.
/// Inspired by [pratikg29's VerticalVolumeSlider](https://github.com/pratikg29/Custom-Slider-Control/blob/main/AppleMusicSlider/AppleMusicSlider/VerticalVolumeSlider.swift)
struct SeekSlider : View {
@Binding var time: Double
Expand Down
4 changes: 0 additions & 4 deletions damus/Views/Video/VideoPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,6 @@ extension VideoPlayer: UIViewRepresentable {
self.videoPlayer = videoPlayer
}

deinit {
print("Coordinator.deinit!")
}

@MainActor
func startObserver(uiView: VideoPlayerView) {
guard observer == nil else { return }
Expand Down

0 comments on commit 9723efd

Please sign in to comment.