iOS - YouTube播放器全屏时控制栏颜色

4
我使用UIWebView在一个视图中嵌入了YouTube视频。
NSString *html = [NSString stringWithFormat:@"<html> <body style=\"margin:0;\"><iframe class=\"youtube-player\" type=\"text/html\" width=\"%f\" height=\"%f\" src=\"http://www.youtube.com/embed/%@\" frameborder=\"0\" allowfullscreen></iframe></body></html>", self.view.bounds.size.width - kTitleLabelLeftIndent*2, kUIWebViewHeight, self.utubeId];

utubeWebView = [[UIWebView alloc]init];
[utubeWebView setAllowsInlineMediaPlayback:YES]; 
[utubeWebView loadHTMLString:html baseURL:nil];

我的应用程序中已经很好地嵌入了YouTube URL。当我在utudeWebView上点击播放按钮时,它会显示一个全屏幕,如下图所示:

enter image description here

其中顶部的红色控制栏看起来不太好看。请问有人能告诉我如何更改该栏的颜色吗?

任何建议都将不胜感激。提前致谢,

John

1个回答

6

我找到了它为什么变成红色的原因。

在我的AppDelegate中,我设置了NavigationBar的外观:

[[UINavigationBar appearance] setTintColor:[UIColor redColor]];

我没有注意到navigationBar和视频控制条之间的关系,因为我将我的navigationBar设置为隐藏。
不知何故,navigationBar颜色的设置也会影响MPmoviePlayerController的控制条的颜色。因此,设置NavigationBar的Tint Color,我可以改变控制条的颜色。以下是一些示例: enter image description here enter image description here

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接