iAd Producer – How to open YT links in Safari?

| | August 18, 2015

I have an error with the iAd browser that does not allow YouTube videos to play. Apple’s workaround is to implement a javascript call on all YouTube-link button taps that launch the link in the Safari web browser instead of the in-app browser using window.location in the JS.

Code implemented:
window.location = "http://…";

But still not launching in the Safari web browser.

Main Code:

this.onViewActivate = function (event) {

window.location = "https://www.youtube.com/watch?v=eM8Wpq-oD5o&index=3&list=PLbh4x6U6o9F6sLbGWaAtgdvEmceJLYgwO";

};

One Response to “iAd Producer – How to open YT links in Safari?”

  1. You code should be using this process:

    document.location = 'http://...

    because the iAd producer is within a UIWebView. this will prompt to user and let them know they are about to quit the application.

Leave a Reply