gpt4 book ai didi

iphone - 无法使用 MPMoviePlayerController 进行搜索

转载 作者:行者123 更新时间:2023-12-03 19:28:51 26 4
gpt4 key购买 nike

我将在 MPMediaPlayerController 上寻找时间线。

我尝试使用 MPMediaPlayerController 的未记录方法 setCurrentTime,如下所示。

[player setCurrentTime:1.f];

然后苹果崩溃了,如下......

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MPMoviePlayerController setCurrentTime:]: unrecognized selector sent to instance 0x5619fe0'
*** Call stack at first throw:
(
0 CoreFoundation 0x00f59be9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x010ae5c2 objc_exception_throw + 47
2 CoreFoundation 0x00f5b6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x00ecb366 ___forwarding___ + 966
4 CoreFoundation 0x00ecaf22 _CF_forwarding_prep_0 + 50
5 MPlayerExample 0x0000227d -[MPlayerExampleViewController PauseVideo] + 69
6 Foundation 0x000367f6 __NSFireDelayedPerform + 441
7 CoreFoundation 0x00f3afe3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
8 CoreFoundation 0x00f3c594 __CFRunLoopDoTimer + 1220
9 CoreFoundation 0x00e98cc9 __CFRunLoopRun + 1817
10 CoreFoundation 0x00e98240 CFRunLoopRunSpecific + 208
11 CoreFoundation 0x00e98161 CFRunLoopRunInMode + 97
12 GraphicsServices 0x0188e268 GSEventRunModal + 217
13 GraphicsServices 0x0188e32d GSEventRun + 115
14 UIKit 0x002c642e UIApplicationMain + 1160
15 MPlayerExample 0x00001fe4 main + 102
16 MPlayerExample 0x00001f75 start + 53
)
terminate called after throwing an instance of 'NSException'

最佳答案

您可以使用 currentPlaybackTime 属性来查找 MPMoviePlayerController,该属性记录在 MPMediaPlayback Protocol Reference 中。 .

所以你的代码看起来像:

[player setCurrentPlaybackTime:1.0];

关于iphone - 无法使用 MPMoviePlayerController 进行搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5841937/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com