我在播放時丟失「視頻」聲音時出現問題。iPhone MPMoviePlayerController在真實設備上播放視頻時會丟失聲音
我遵循了所有的標準,但視頻/音頻有時會被靜音或只是在視頻文件的末尾消失。我不知道爲什麼。有沒有人知道可能是什麼問題?
這隻發生在真實設備上運行應用程序時,我無法在模擬器上重現問題。
「didReceiveMemory」警告是否會導致此問題?有時我會收到這條消息。
謝謝你的幫助。請參閱下面的詳細信息。
視頻文件正在通過URL地址進行流式傳輸,格式爲MPEG-4 Movie,格式小於6.2 MB。
我有以下代碼:
- (IBAction) playMovie:(NSString*)theUrl
setMovieType:(NSString *)theType
setPlayOption:(int)theOption
setSenderUIButton:(UIButton *) thisSender
{
NSString *getvdoUrl = [[NSString alloc] initWithString:theUrl];
NSURL *thisVdoURL = [NSURL URLWithString:getvdoUrl];
[getvdoUrl release];
getvdoUrl = nil;
MPMoviePlayerController *movieplayer = [[MPMoviePlayerController alloc]
initWithContentURL:thisVdoURL];
thisVdoURL = nil;
if (movieplayer)
{
self.vdoPlayer = movieplayer;
[movieplayer release];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:self.vdoPlayer];
[self.vdoPlayer play];
}
}
-(void) moviePlayBackDidFinish:(NSNotification*)theNotification
{
MPMoviePlayerController *movieplayer= [theNotification object];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:movieplayer];
movieplayer.initialPlaybackTime = 0.0;
[movieplayer stop];
}
以下是我的視頻文件開始播放之前收到的警告信息。
警告:無法爲 讀取的符號 「/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3 (7E18)/Symbols/System/Library/VideoDecoders/VCH263.videodecoder」 (文件不找到)。
警告:無法爲 讀取的符號 「/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3 (7E18)/Symbols/System/Library/VideoDecoders/H264H1.videodecoder」 (找不到文件) 。
警告:無法爲 讀取的符號 「/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3 (7E18)/Symbols/System/Library/VideoDecoders/MP4VH1.videodecoder」 (找不到文件) 。
2010-03-29 16:57:25.830 .... V2 [4663:207]設置 文件:///私人的/ var /移動/應用/ 7DCB1FCC-7268-4551-B737-8B418CA4A07E/TMP/MediaCache/[HTML]
我也得到類似的警告和奇怪的內存問題,找到任何解決方案? – Shizam 2010-04-12 16:36:47