Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
chore: clear transcript view after video controller is dismissed (#1807)
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Umer committed Oct 12, 2023
1 parent f319b7b commit 3970e5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Source/VideoBlockViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ class VideoBlockViewController : OfflineSupportViewController, CourseBlockViewCo
if !chromeCastManager.viewExpanded {
resetChromeCast()
}
videoTranscriptView?.invalidateTimer()
videoTranscriptView = nil
}

override func viewDidAppear(_ animated : Bool) {
Expand Down
8 changes: 6 additions & 2 deletions Source/VideoTranscript.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class VideoTranscript: NSObject, UITableViewDelegate, UITableViewDataSource, Scr
self.environment = environment
super.init()
setupTable(tableView: transcriptTableView)
transcriptTableView.dataSource = self
transcriptTableView.delegate = self
}

private func setupTable(tableView: UITableView) {
Expand All @@ -52,6 +50,8 @@ class VideoTranscript: NSObject, UITableViewDelegate, UITableViewDataSource, Scr
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 44
tableView.isHidden = true
tableView.dataSource = self
tableView.delegate = self
}

//MARK: - UITableview methods
Expand Down Expand Up @@ -116,4 +116,8 @@ class VideoTranscript: NSObject, UITableViewDelegate, UITableViewDataSource, Scr
@objc func invalidateDragging(){
isTableDragged = false
}

func invalidateTimer() {
draggingTimer.invalidate()
}
}

0 comments on commit 3970e5f

Please sign in to comment.