Open kokoichi206 opened 2 years ago
rectPos は @State, 下のコードでは while 文が終わったところでしか UI の更新が走らない
.onTapGesture {
while player.currentTime().seconds < totalTime {
print(player.currentTime().seconds)
rectPos = calculatePosition(timeSec: player.currentTime().seconds)
print(rectPos)
}
print(rectPos)
}
AVPlayer.play() のタイミング
上だと 30 秒終了したタイミングで動画の再生が始まってしまう。。。