gpt4 book ai didi

iphone - MPMoviePlayerController 没有 UI 控件

转载 作者:行者123 更新时间:2023-11-29 04:09:40 24 4
gpt4 key购买 nike

我正在尝试添加从服务器中提取的视频,以便在我的应用程序中播放。

视频现在可以播放,但我没有任何音量 UI 控件。全屏等。

有人可以帮忙吗?这是我的代码

NSURL *url = [NSURL URLWithString:@"http://www.gzerodesign.com/sharksclips/video.mp4"];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];

// Register to receive a notification when the movie has finished playing.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];

if ([moviePlayer respondsToSelector:@selector(setFullscreen:animated:)]) {
// Use the new 3.2 style API
moviePlayer.controlStyle = MPMovieControlModeDefault;
moviePlayer.shouldAutoplay = YES;
[[moviePlayer view] setFrame:[[self view] bounds]];
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];
[moviePlayer play];
} else {
// Use the old 2.0 style API
moviePlayer.movieControlMode = MPMovieControlModeHidden;
[moviePlayer play];
}

最佳答案

我只体验过New 3.2风格的API。

moviePlayer.controlStyle = MPMovieControlModeDefault;

注释掉

//moviePlayer.controlStyle = MPMovieControlModeDefault;

您可能有全屏按钮和跳过按钮。但不显示音量。

我没有尝试,但我搜索了这个。

MPMoviePlayerViewController not showing volume slider?

关于iphone - MPMoviePlayerController 没有 UI 控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14616903/

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