Permalink
Browse files

Resume playback when clicking a chapter

  • Loading branch information...
alejx committed Jan 30, 2019
1 parent 596390f commit 7c88b0352e43089539440e3c94c3eb02f8052661
Showing with 8 additions and 8 deletions.
  1. +1 −0 iina/PlayerCore.swift
  2. +7 −8 iina/PlaylistViewController.swift
@@ -801,6 +801,7 @@ class PlayerCore: NSObject {
func playChapter(_ pos: Int) {
let chapter = info.chapters[pos]
mpv.command(.seek, args: ["\(chapter.time.second)", "absolute"])
togglePause(false)
// need to update time pos
syncUITime()
}
@@ -439,16 +439,15 @@ class PlaylistViewController: NSViewController, NSTableViewDataSource, NSTableVi
let tv = notification.object as! NSTableView
if tv == playlistTableView {
showTotalLength()
return
}
guard tv.numberOfSelectedRows > 0 else { return }
if tv == chapterTableView {
let index = tv.selectedRow
player.playChapter(index)
let chapter = player.info.chapters[index]
tv.deselectAll(self)
tv.reloadData()
mainWindow.displayOSD(.chapter(chapter.title))
}
let index = tv.selectedRow
player.playChapter(index)
let chapter = player.info.chapters[index]
tv.deselectAll(self)
tv.reloadData()
mainWindow.displayOSD(.chapter(chapter.title))
}

func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {

0 comments on commit 7c88b03

Please sign in to comment.