- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的开放类 Controller 中有一些方法可以实例化 moviePlayer,它设置为“autoPlay = NO”;
我已将 movieplayer.view 添加为 Controller View 的 subview ,对其进行配置并在顶部创建一个全屏按钮以启动视频。从iOS4.3开始,这一直工作得很好。该按钮是透明的,并且显示视频的第一帧(这是自定义汽车自动启动按钮的图片)。
从 iOS6 开始,我只能看到黑屏。单击图像按钮确实会按预期启动视频;调用[moviePlayer播放]
有什么变化是我没有考虑到的吗?我已经提供了我认为必要的两段代码。
#define INTRO_MOVIE @"Intro.mov"
-(void)viewDidLoad
{
if(SHOULD_PLAY_INTRO_VIDEO)//Debug switch to ignore the intro video
{
// Prepare the movie and player
[self configureIntroMoviePlayer];
[self.view addSubview:moviePlayer.view];
[self.view bringSubviewToFront:moviePlayer.view];
// Add and Show the Start Button to start the App
[self configureStartButton];
[self.view addSubview:startButton];
}
}
-(void)configureIntroMoviePlayer
{
LOGINFO
// Prepare the Intro Video
NSString *pathToIntroVideo = [ mainFilePath_ stringByAppendingPathComponent: INTRO_MOVIE];
NSURL *URLToIntroVideo = [NSURL fileURLWithPath:pathToIntroVideo];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:URLToIntroVideo];
[moviePlayer setShouldAutoplay:NO];
moviePlayer.view.frame = CGRectMake(0, -20, 1024, 768);
[moviePlayer setControlStyle:MPMovieControlStyleNone];
//fixing video brightness Difference with iPad2
if(isIpad2)
{
moviePlayer.backgroundView.backgroundColor = [UIColor blackColor];
moviePlayer.view.alpha = .99;
}
// Create the sKip button for cancelling the Intro Video
skipIntro = [UIButton buttonWithType:UIButtonTypeCustom];
[skipIntro showsTouchWhenHighlighted];
skipIntro.frame = CGRectMake(900, 20, 111, 57);
[skipIntro addTarget:self action:@selector(skipIntroWasPressed) forControlEvents:UIControlEventTouchUpInside];
}
最佳答案
我不确定为什么我因缺乏研究或清晰度而对该问题获得 -1 评级?也许我不知道这个论坛的正确用法。我道歉。
我确实发现添加 [moviePlayerprepareToPlay] 解决了问题。就像我说的,奇怪的是第一帧总是在 iOS 6 之前出现。
关于ios6 moviePlayer 第一帧在创建时未出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13017597/
我的开放类 Controller 中有一些方法可以实例化 moviePlayer,它设置为“autoPlay = NO”; 我已将 movieplayer.view 添加为 Controller Vi
我想在没有控件的情况下启动 MoviePlyer,但如果用户触摸屏幕,则会显示控件并允许用户进入全屏或 AirPlay。 self.player = [[MPMoviePlayerController
我面临内存泄漏和其他 MoviePlayer 新启动的问题,因为我的 MoviePlayer 没有响应功能,我在完成按钮上释放该播放器。 (void) playMovieAtURL { MPM
我无法修复/追踪的 iPad/iPhone 应用程序中有一个非常奇怪的错误。 我的应用程序在标准的 MPMoviePlayerController 中播放视频,但界面隐藏,我自己的按钮用于播放和停止。
我正在尝试了解如何向 iPhone MoviePlayer 添加自定义控件。有关我正在尝试做的事情的示例,请参见下图。 我正在尝试添加类似基本影片控件左右两侧的控件。 我在 Open SDK 中通过向
下面是我用来播放电影的代码: playerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:theURL
简而言之,我的应用程序正在这样做: 1)当我点击它时,我的主 View (RootViewController)有一个按钮,它显示播放器(PlayerViewController): 2)在我的播放器
在 Apple 示例代码项目:MoviePlayer 中,我想实现的是,当示例 App 启动时,本地视频会立即以编程方式播放。 我加上最后两句: [self.tabBarController setS
在我的应用程序中,我录制了一个视频并通过 MpMovie Player 播放它。看起来效果不错。 但是当我播放视频时,导航栏(默认进度条)是向下的,而不是与状态栏结合在一起。 我播放视频的代码如下 -
我想从 url 获取视频并在点击按钮时在 View 中播放它。 我有一个从 URL 播放视频的 moviePlayer。一切看起来都不错,但是当我点击“返回”或“下一步”按钮(即更改 viewCont
我正在使用 MoviePlayer Controller 在我的 iOS 应用程序中播放视频。我正在使用这样的方向通知 if(deviceOrientation ==UIDeviceOrientati
我想将自定义控件添加到 mediaPlayer 控件 View 中,就像这个提问者一样: Add Custom Controls to MoviePlayer 但是,上述问题中发布的解决方案在 3.0
我是一名优秀的程序员,十分优秀!