Software Archive
Read-only legacy content
17061 Discussions

Youtube Video Link Opens in App Webview - can't get back to app

Peter_F_6
Beginner
687 Views

Hi there,

I believe this is an IOS issue, but I'm looking for a fix using XDK since my app is built with it.  My app displays a YouTube video using the Youtube iFrame API. If a link is clicked in the video ie YouTube Logo, or Share URL then the Youtube page is loaded into the current webview and I cannot return to my app. I need to overide the behaviour such that the link launches in an external browser, that way I believe IOS adds a 'Return to {app}' link at the top of the new browser window so the user can get back to my app.

I found a related link which seems to have a solution using hooks:

http://stackoverflow.com/questions/36646014/ionic-external-link-in-iframe-opens-in-webview-embed-youtube-player

Is this the right way to go, or do you know of a better solution?

Thanks in advance!

0 Kudos
1 Reply
Elroy_A_Intel
Employee
687 Views

I recommend consider using the Cordova Inappbrowser plugin (https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/). You will be able to open a window to YouTube and navigate within it as well as close it at any time. 

0 Kudos
Reply