Youtube iOS Player Helper 库不起作用 [英] Youtube iOS Player Helper library didn't work

查看:34
本文介绍了Youtube iOS Player Helper 库不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试实现 youtube-ios-player-helper 库以在我的应用中播放视频.我可以准备好播放器并加载视频.并且可以显示起始缩略图.但是,当我尝试播放视频时,却收到了以下错误消息:

I tried to implement the youtube-ios-player-helper library to play videos in my app. I can get the player ready and load the video. And the starting thumbnail can be shown. However, when I tried to play the video, I got this error message instead:

SendDelegateMessage(NSInvocation *): delegate (webView:identifierForInitialRequest:fromDataSource:) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode

然后我尝试构建和运行 youtube ios player helper 示例项目,它遇到了同样的问题.有人可以帮我解决这个问题吗?提前致谢.

And then I tried building and running the youtube ios player helper example project, and it has got the same issue. Can anybody help me with this? Thanks in advance.

推荐答案

不幸的是,这个 youtube iOS 助手有很多问题,比如布局、文件位置等等.不介意分享它并帮助其他人使用它..

Unfortunately this youtube iOS helper has many issues, like layout, file locations and so on.. I have drafted a bit improved version for my own use but, I don't mind to share it and help others to use this..

它的工作原理与 iOS 助手相同,但是,它有一些其他改进和功能来执行您可能感兴趣的其他事情..

It works the same as the iOS helper but, it has some other improvements and functions to do other things that might be of your interest..

您可以在 此处找到库,如果您对如何使用它有疑问,请告诉我..

You can find the library here let me know if you have questions how to use it..

我已经将它构建到一个带有硬编码播放列表的项目中..

I have it build it into a project already with a hardcoded playlist..

如果您需要帮助,我可以指导您如何使用它.. 告诉我.. :)

I can walk you through on how to use it if you need help.. just let me know.. :)

希望能帮到你!

抱歉,差点忘了这个库现在需要你的 AppDelegate.h 和 AppDelegate.m 中的一些东西,如果你的应用设置为纵向,这将帮助你强制横向模式.

Sorry, almost forgot this library requires some things in your AppDelegate.h and AppDelegate.m for now if your app is set to be portrait this will help you to force landscape mode.

所以,只需将此添加到您的 AppDelegate.h

So, just add this to your AppDelegate.h

@property (nonatomic) BOOL videoIsInFullscreen;

然后,这到你的 AppDelegate.m

Then, this to your AppDelegate.m

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
    if(self.videoIsInFullscreen == YES)
    {
        return UIInterfaceOrientationMaskAllButUpsideDown;
    }
    else
    {
        return UIInterfaceOrientationMaskPortrait;
    }

那你应该没问题:)

另外,我在这个库中添加了一个网站还没有完成,但它会引导你完成如何使用图书馆在这里!!!

Also, I have added a website to this library is not finish yet but it kinda walks you through how to use the library in here!!!

这篇关于Youtube iOS Player Helper 库不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆