Some YouTube videos do not play, in apps with the ytplayer SDK

情到浓时终转凉″ 提交于 2019-12-25 02:46:39

问题


We're testing our app with the ytplayer SDK provided by YouTube. Please refer to the link below. https://developers.google.com/youtube/v3/guides/ios_youtube_helper?hl=ko

The problem is, when I play some videos I can not play only in the app. This video plays very well on Youtube apps, mobile webs (Safari apps) and desktop browsers. (videoId:ozUdQJxvQCk)

I tried it in the SDK sample app on YouTube, but the problem was the same. In other words, it's not just my app's issue.

The error code returned from the SDK looks like this: "Decoding failed with error code -1"

If anyone knows how to solve it, please answer it.

==

Attach the sample app code. Of the two videos, the above is normal and the one below is the problematic one.

- (void)viewDidLoad {
    [super viewDidLoad];

    // Do any additional setup after loading the view, typically from a nib.
    CGRect rect = CGRectMake(0, (self.view.frame.size.height - self.view.frame.size.width) / 2, self.view.frame.size.width, self.view.frame.size.width);
    YTPlayerView *yt = [[YTPlayerView alloc] initWithFrame:rect];
    [self.view addSubview:yt];

    // [yt loadWithVideoId:@"yv90i_afcPI"];  // it's ok
    [yt loadWithVideoId:@"ozUdQJxvQCk"];  // video unavailable
}

来源:https://stackoverflow.com/questions/55788562/some-youtube-videos-do-not-play-in-apps-with-the-ytplayer-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!