Skip to content

Commit

Permalink
refactor: add guard check for media load
Browse files Browse the repository at this point in the history
  • Loading branch information
godly-devotion committed Apr 2, 2024
1 parent a10537c commit 3188fc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Front Row/Support/PlayEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ import SwiftUI
}

func goToTime(_ timecode: String) async {
guard let item = player.currentItem else { return }
guard isLoaded, let item = player.currentItem else { return }

let split = Array(timecode.split(separator: ":").reversed())

Expand All @@ -326,7 +326,7 @@ import SwiftUI

@MainActor
func frameStep(_ byCount: Int) {
guard let item = player.currentItem else { return }
guard isLoaded, let item = player.currentItem else { return }

item.step(byCount: byCount)
}
Expand Down

0 comments on commit 3188fc0

Please sign in to comment.