Skip to content

Commit

Permalink
Update LoopPlayerMultiPlatform.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
swiftuiux committed Aug 8, 2024
1 parent 8017361 commit 080ee32
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ extension LoopPlayerMultiPlatform: UIViewRepresentable{
/// - context: The context for the view
@MainActor func updateUIView(_ uiView: UIView, context: Context) {
uiView.subviews.filter { $0 is ErrorView }.forEach { $0.removeFromSuperview() }
uiView.subviews.compactMap{ $0 as? LoopingPlayerProtocol }.forEach { $0.setCommand(command) }
uiView.subviews.compactMap{ $0 as? LoopingPlayerProtocol }.forEach {
if let asset = getAssetIfChanged(settings: settings, asset: $0.currentAsset){
$0.update(asset: asset)
}else{
$0.setCommand(command)
}
}

updateView(uiView, error: error)
}
Expand Down

0 comments on commit 080ee32

Please sign in to comment.