File tree Expand file tree Collapse file tree 4 files changed +25
-7
lines changed
Sources/StreamVideo/Utils
StreamVideoTests/TestUtils/VirtualTime Expand file tree Collapse file tree 4 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ import UIKit
1111
1212public final class ScreenPropertiesAdapter : @unchecked Sendable {
1313
14- public private( set) var preferredFramesPerSecond : Int = 0
15- public private( set) var refreshRate : TimeInterval = 0
16- public private( set) var scale : CGFloat = 0
14+ public private( set) var preferredFramesPerSecond : Int = 30
15+ public private( set) var refreshRate : TimeInterval = 0.16
16+ public private( set) var scale : CGFloat = 1
1717
1818 init ( ) {
1919 Task { @MainActor in
Original file line number Diff line number Diff line change @@ -67,9 +67,21 @@ public struct DefaultTimer: Timer {
6767 /// implementation.
6868 /// - Returns: A publisher that emits ``Date`` values.
6969 public static func publish(
70- every interval: TimeInterval
70+ every interval: TimeInterval ,
71+ file: StaticString = #file,
72+ function: StaticString = #function,
73+ line: UInt = #line
7174 ) -> AnyPublisher < Date , Never > {
72- TimerStorage
75+ guard interval > 0 else {
76+ log. warning (
77+ " Interval cannot be 0 or less " ,
78+ functionName: function,
79+ fileName: file,
80+ lineNumber: line
81+ )
82+ return Just ( Date ( ) ) . eraseToAnyPublisher ( )
83+ }
84+ return TimerStorage
7385 . currentValue
7486 . timer ( for: interval)
7587 . eraseToAnyPublisher ( )
Original file line number Diff line number Diff line change @@ -61,7 +61,10 @@ protocol Timer {
6161 /// - repeating: A Boolean indicating if the timer should repeat.
6262 /// - Returns: A publisher that emits the current `Date` on each fire.
6363 static func publish(
64- every interval: TimeInterval
64+ every interval: TimeInterval ,
65+ file: StaticString ,
66+ function: StaticString ,
67+ line: UInt
6568 ) -> AnyPublisher < Date , Never >
6669}
6770
Original file line number Diff line number Diff line change @@ -40,7 +40,10 @@ struct VirtualTimeTimer: Timer {
4040 }
4141
4242 static func publish(
43- every interval: TimeInterval
43+ every interval: TimeInterval ,
44+ file: StaticString ,
45+ function: StaticString ,
46+ line: UInt
4447 ) -> AnyPublisher < Date , Never > {
4548 DefaultTimer
4649 . publish ( every: interval)
You can’t perform that action at this time.
0 commit comments