不按默认视频图标即可在 iPhone 上播放 YouTube 视频

发布于 2024-10-11 01:22:08 字数 329 浏览 6 评论 0原文

我想知道是否可以在不启动默认小照片图标的情况下启动 YouTube 视频。我只需要一个可以启动来播放 YouTube 视频的常规图标。不幸的是,正如 Youtube 官方建议所暗示的那样,目前还没有办法满足我的请求。是否有人关注这个问题并已经解决了这个问题?

http://apiblog.youtube.com/2009 /02/youtube-apis-iphone-cool-mobile-apps.html

i want to know if it is possible to launch the youtube video without launching the default small photo icon. I just need a regular icon which is able to be launched to play a youtube video. Unfortunately, as the Youtube official suggestion suggests, there is currently no way to fulfill my request. Does any body concern this issue and already figure this out?

http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谜兔 2024-10-18 01:22:08

如果我正确理解你的问题:

  1. 将 youtube 播放器嵌入 UIWebview 并将 webview 设置为隐藏
  2. 在你的自定义按钮方法中执行以下操作:

    a- 在 webview 子视图中搜索 UIButton :

-(UIButton*)getButtonInView:(UIView*)看法{

UIButton *button = nil;
     if([view isMemberOfClass:[UIButton class]]){
      return (UIButton*) view;
     }

 if(view.subviews && [view.subviews count] > 0) {
  for(UIView *subview in view.subviews) {
   button=[self getButtonInView:subview];
   if(button) return button;
  }
 }

 return button;

}

b- 将操作发送到获取的按钮:

[button sendActionsForControlEvents:UIControlEventTouchUpInside];

希望这会有所帮助

----注意----

正如 lxt 提到的。请注意,此解决方案依赖于 Youtube 插件实现,不要更改,否则将来可能会崩溃。

if I understood your question correctly:

  1. embed youtube player in a UIWebview and set the webview to hidden
  2. in your customized button method do the following:

    a- search for UIButton in the webview subviews :

-(UIButton*)getButtonInView:(UIView*)view{

UIButton *button = nil;
     if([view isMemberOfClass:[UIButton class]]){
      return (UIButton*) view;
     }

 if(view.subviews && [view.subviews count] > 0) {
  for(UIView *subview in view.subviews) {
   button=[self getButtonInView:subview];
   if(button) return button;
  }
 }

 return button;

}

b- send action to the fetched button:

[button sendActionsForControlEvents:UIControlEventTouchUpInside];

hope that will help

----NOTE----

As mentioned by lxt. Please note that that this solution relies on Youtube plugin implementation not changing otherwise it might break in the future.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文