我正在开发的 iOS 应用程序中播放直播电视流。我正在使用 MPMoviePlayerController 并且需要创建自定义控件(播放、暂停、进度条等)。
在尝试获取 currentPlaybackTime 时,我注意到一些非常奇怪的行为:它像没有明天一样跳来跳去。
持续时间属性稳定在 7170 秒,它永远不会改变。playableDuration 属性随着电影的播放而增长,并且 currentPlaybackTime 不断地跳来跳去:
playableDuration: 7179.875398
currentPlaybackTime: 7170.181204
--------------
playableDuration: 7187.655396
currentPlaybackTime: 7171.079373
--------------
playableDuration: 7197.208128
currentPlaybackTime: 7172.131998
--------------
playableDuration: 7197.208128
currentPlaybackTime: 7173.139118
--------------
playableDuration: 7197.208128
currentPlaybackTime: 7174.139770
--------------
playableDuration: 7197.208128
currentPlaybackTime: 7175.139666
--------------
playableDuration: 7197.208128
currentPlaybackTime: 7176.140805
--------------
playableDuration: 7197.208128
currentPlaybackTime: 7177.139057
--------------
playableDuration: 7197.208128
currentPlaybackTime: 7178.139128
--------------
playableDuration: 7197.208128
currentPlaybackTime: 7179.139911
--------------
playableDuration: 7199.822063
currentPlaybackTime: 7170.095921
--------------
playableDuration: 7209.959997
currentPlaybackTime: 7171.140078
--------------
playableDuration: 7209.959997
currentPlaybackTime: 7172.140715
--------------
playableDuration: 7209.959997
currentPlaybackTime: 7173.076899
--------------
playableDuration: 7209.959997
currentPlaybackTime: 7174.139497
--------------
playableDuration: 7209.959997
currentPlaybackTime: 7175.139907
--------------
playableDuration: 7209.959997
currentPlaybackTime: 7176.138233
--------------
playableDuration: 7209.959997
currentPlaybackTime: 7177.139523
--------------
playableDuration: 7209.959997
currentPlaybackTime: 7178.135736
--------------
playableDuration: 7209.959997
currentPlaybackTime: 7179.138545
--------------
playableDuration: 7209.959997
currentPlaybackTime: 7180.111102
--------------
playableDuration: 7219.939398
currentPlaybackTime: 7171.132859
--------------
playableDuration: 7219.939398
currentPlaybackTime: 7172.128591
--------------
playableDuration: 7219.939398
currentPlaybackTime: 7173.136137
--------------
playableDuration: 7219.939398
currentPlaybackTime: 7174.135416
--------------
playableDuration: 7219.939398
currentPlaybackTime: 7175.137593
--------------
playableDuration: 7219.939398
currentPlaybackTime: 7176.131573
--------------
playableDuration: 7219.939398
currentPlaybackTime: 7177.137812
--------------
playableDuration: 7219.939398
currentPlaybackTime: 7178.131751
--------------
playableDuration: 7219.939398
currentPlaybackTime: 7179.135922
--------------
playableDuration: 7219.939398
currentPlaybackTime: 7180.139828
--------------
playableDuration: 7229.752731
currentPlaybackTime: 7171.129731
--------------
playableDuration: 7229.752731
currentPlaybackTime: 7172.136576
--------------
playableDuration: 7229.752731
currentPlaybackTime: 7173.132362
--------------
playableDuration: 7229.752731
currentPlaybackTime: 7174.139998
如您所见,它从 7179 跳到 7170,然后从 7180 跳回 7171,一次又一次……换句话说,似乎没有办法获得稳定递增的 currentPlaybackTime。这导致我的进度条跳来跳去,进度标签(0:04:30 / 2:00:00)也表现得非常奇怪。
有没有人见过这种行为?有解决方法吗?