kingslay / KSPlayer

A video player for iOS、macOS、tvOS、visionOS , based on AVPlayer and FFmpeg, support the horizontal, vertical screen. support adjust volume, brightness and seek by slide, support subtitles.
GNU General Public License v3.0
887 stars 184 forks source link

Make time in ControllerTimeModel Double(TimeInterval), not Int #655

Closed romanyczn1 closed 7 months ago

romanyczn1 commented 7 months ago

Most of swiftui funcs prefer TimeInterval's, like animation

Describe the solution you'd like I would prefer that ControllerTimeModel will not convert TimeInterval to Int

p.s. I know that i can just get duration from Player;)

kingslay commented 7 months ago

改成int是为了降低cpu占用率。因为swiftui是值有变化的话,都会刷新界面。所以如果用TimeInterval's的话,那一秒就会刷新好几次。如果使用int,那一秒只会刷新一次。