我有一个嵌入式YTPlayerView:
YTPlayerView *player = [[YTPlayerView alloc] initWithFrame:newCell.coverImageButton.frame];
[player loadWithVideoId:[self extractYoutubeIdFromLink:posting.postDictionary[@"uri"]]];
player.delegate = self;
[newCell addSubview:player];
它工作正常,我点击视图,它呈现一个全屏播放器。但是当我按“完成”时,视图将被解除,然后在一秒左右后重新显示。
答案 0 :(得分:1)
只需在YTPlayerView-iframe-player.html
中注释这行代码window.setInterval(forcePlay, 5000)
即可
答案 1 :(得分:0)
我认为YTPlayerView
类不需要获得我想要的结果。这非常有效:
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://www.youtube.com/embed/%@",tubeId]];
UIWebView *w = [[UIWebView alloc] initWithFrame:webFrame];
[self.view addSubview:w];
[w loadRequest:[NSURLRequest requestWithURL:url]];