Wanted to consult with others who are using the YouTube player as an iFrame in their apps.
Basically everything works fine. but my app got rejected by Apple because my app is considered “for kids” - and kids shouldn’t be redirected to other places w/o what Apple call “parental gateway”
“Parental gateway”: is capturing the “stepping out of the app before loading YouTube” event - show some “allow page” that only adults can understand, and if you click “yes” or answer some question - you are forwarded to YouTube.
App behavior: so current state, you’re loading my app, it has many YouTube videos, then you click on one of them.
After the click loads the video in an iFrame ( embed ) - there’s a small YouTube logo on the player/video itself.
When you click it - basically you’re not being forwarded to YouTube’s app ( like Ionic native YouTube does ) - it basically “taking over” my entire app, and then I have two problems:
you can’t go back to my App, only if you click “Home” button twice - remove my app, and reload my app
How can I capture that event - so I can implement the “Parental Gateway” that Apple wants
The thumbnails is not the problem, the video player is the problem.
the native youtube player by Ionic show videos outside the app, right ? I can’t leave the app, it’s for 2 year-old kids … they won’t know how to go back …
This is the app in Android may it will give a little bit context:
I see that modestbranding=1 must go together with showinfo=1
if showinfo will be 0 - the YouTube Logo will appear instead ( you can reproduce with the above link )
The rel=0 I’m not sure, doesn’t have any affect.
The Issue I have with showinfo=1 is that you can click its title - and it will also forward you to YouTube
So it’s either the logo that will forward you to YouTube or the title
as a file yes, but what I need to do in order to use it in Ionic ? it doesn’t seems to be working the same as Angular2 “namespaces” examples …
If you/someone can edit this stackblitz - that would be a great help: https://stackblitz.com/edit/ionic-6nlzzm
( ignore all the other tabs, just look a pages/home/ and home.ts )
Tried … plyr didn’t work. and basically these solutions still embed the player and blocking any functionality of it - will cause a violation of the YouTube’s terms and service.
But bottom line, I’m receiving error from iPad ( everywhere else it works )
Unable to post message to https://www.youtube.com. Recipient has origin http://x.x.x.x:8101.
I wonder,
What’s the container I’m using ? there are so many names out-there “inappbrowser” / webview / UIwebview WKwebview etc … etc …
I’m trying to understand what I’m using - so maybe that container has its own events - that maybe I can listen to … ?
cli packages: (/Users/arlevi/.npm-packages/lib/node_modules)
@ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages:
cordova (Cordova CLI) : 7.0.1
local packages:
@ionic/app-scripts : 3.1.6
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.1
ios-sim : 5.0.8
Node : v7.2.0
npm : 4.0.5
OS : OS X El Capitan
Xcode : Xcode 8.2.1 Build version 8C1002
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : legacy