当前位置: 动力学知识库 > 问答 > 编程问答 >

objective c - Youtube iOS Player Helper library didn't work

问题描述:

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

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.

网友答案:

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..

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.. :)

I hope it helps!

EDIT:

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.

So, just add this to your AppDelegate.h

@property (nonatomic) BOOL videoIsInFullscreen;

Then, this to your AppDelegate.m

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

Then you should be fine :)

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!!!

分享给朋友:
您可能感兴趣的文章:
随机阅读: