How to embed YouTube player in Meteor App?

853 views Asked by At

I put a YouTube video with iframe in my HTML code and it shows up in my localhost version, but not on iOS simulator. Is there anything wrong? How can I embed a YouTube video in my myApp.html so that it will show up both in iOS simulator and localhost?

It seems that this should be okay if I use Meteor package like this one (1). But is there any other way to do this without having to install a package?

  1. https://atmospherejs.com/adrianliaw/youtube-iframe-api
1

There are 1 answers

0
RonLugge On

I was able to get youtube videos working with fairly standard iFrames:

<iframe ng-if="video.youtube_url_2" ng-src="{{video.youtube_url_2}}" frameborder="0" allowfullscreen></iframe>

The key was to create a mobile-config.js file (put it in the root of the project, alongside your README file and so forth) with the following rules (I suspect it was the first one that did it, including both 'just in case' -- this was literally a problem that fixed itself when I fixed a second issue):

App.accessRule('*', {type:'navigation'});
App.accessRule('maps:*', {type:'intent'});