使用YouTube iFrame显示YouTube视频广告 [英] Displaying YouTube Video ads with YouTube iFrame

查看:215
本文介绍了使用YouTube iFrame显示YouTube视频广告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个显示我的YouTube视频的iOS应用,我是YouTube合作伙伴,当我在浏览器中播放视频时,视频广告会显示出来。然而,在使用官方iOS YouTube播放器时,它没有显示任何类型的视频广告,是否有人知道如何显示视频广告或修复此问题?



YouTube播放机库我正在使用这里有关于StackOverflow的讨论: YouTube iOS中的错误玩家助手'库



最终,在广告中禁用了iFrame广告#58 。这是由YouTube开发者关系团队成员Ibrahim Ulukaya批准的。



使用iFrame API 随时可以弃用,我不会感到惊讶的是YouTube正在开发一个更好的iOS库,类似​​于他们的Android版本。但目前,广告不会显示在 YTPlayerView 中。


I'm currently developing an iOS app that displays my YouTube videos, I am a YouTube partner and video ads show up when I play my videos inside my browser. However while using the official iOS YouTube Player it doesn't show any kind of video ads whatsoever, does anyone know how to display video ads or get this fixed?

The YouTube Player Library I'm using https://github.com/youtube/youtube-ios-player-helper

Here are the parameters I'm using

  NSDictionary *playerVars = @{
                             @"controls" : @1,
                             @"playsinline" : @1,
                             @"autohide" : @0,
                             @"showinfo" : @0,
                             @"autoplay" : @1,
                             @"fs" : @0,
                             @"rel" : @0,
                             @"loop" : @1,
                             @"enablejsapi" : @1,
                             @"modestbranding" : @1
                             };

As you can see in this image it just starts playing the video and doesn't play any video ad before the video starts

解决方案

When the YTPlayerView iFrame loaded an ad, it used to force the user right out of their app and into Safari. I had opened an issue on the library's GitHub project page back in January and there was a discussion about it on StackOverflow here: Bug in 'YouTube iOS Player Helper' library.

Ultimately, iFrame ads were disabled in PR #58. This was sanctioned by Ibrahim Ulukaya, a member of YouTube's developer relations team.

With iFrame API subject to deprecation at any time, I wouldn't be surprised of YouTube was working on a better library for iOS, similar to the one they have for Android. But for now, ads will not show up in the YTPlayerView.

这篇关于使用YouTube iFrame显示YouTube视频广告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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