meteor

How to play YouTube videos inside Meteor in Cordova?

只谈情不闲聊 提交于 2019-12-23 05:08:08
问题 I'm building a Meteor app that will be deployed to both iOS and Android. Some of the pages have an embedded YouTube player. Locally and when deployed to Galaxy, the YouTube videos play without a hitch. When built for iOS, the videos do not play. When built for Android, the videos do play. On iOS, nothing shows, though the iFrame that's supposed to hold the video is rendered. That is, an empty space is shown. In mobile-config.js I have tried App.accessRule('*://*.youtube.com/*'); App

How to run method on client when subscribe is complete

浪尽此生 提交于 2019-12-23 04:52:40
问题 Here is my setup: //in global.js file items = new Meteor.Collection("items"); //on server in main.coffee Meteor.publish "nearItems", (lat, lng) -> return items.find( { loc : { $near : [lng, lat] } }) //on client in map.coffee Meteor.autosubscribe -> Meteor.subscribe( "nearItems", 37.78, -122.416, addMarkers) addMarkers = -> places = items.find().fetch() console.log "Adding this many markers:", items.length for item, i in places theLatLng = new google.maps.LatLng(item.loc[1], item.loc[0])

Create a Meteor User in Fixtures with specific ID?

孤者浪人 提交于 2019-12-23 04:52:31
问题 I need to create a fixtures file and after a reset my Meteor.user needs to have a very specific ID because I need to preserve its relationships to other pieces of data, which use the user ID. fixtures: if ( Meteor.users.find().count() === 0 ) { Accounts.createUser({ _id: "LHrhapueRmyJkajZ2", // This does not work, but I need it to be this. username: 'admin', email: 'admin@none.com', password: '123456', profile: { first_name: 'John', last_name: 'Doe', company: 'ABC', } }); }; UPDATE: I figured

Meteor's cordova: geolocation plugin doesn't work on mobile

拥有回忆 提交于 2019-12-23 04:47:59
问题 I'm deploying my Meteor (1.2.0.2) app to an Android device. I installed the plugin by meteor add cordova:cordova-plugin-geolocation@1.0.0 Added Cordova plugin cordova-plugin-geolocation@1.0.0. I used the plugin by: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { navigator.geolocation.getCurrentPosition(function(p){ // onSuccess console.log(p); }, function(e){ console.log(e); }); } On desktop works perfectly (print p as Geolocation object) but on

How does a Meteor database mutator know if it's being called from a Meteor.method vs. normal code?

谁说胖子不能爱 提交于 2019-12-23 04:38:13
问题 If one does something on the client like Foo.insert({blah : 1}) where Foo is a Meteor collection, this actually triggers a Meteor.method call as documented in the last paragraph of http://docs.meteor.com/#meteor_methods that executes code on both the client and the server. However, let's say I define a method (on client and server) that does the same thing: Meteor.methods({ bar: function() { Foo.insert({blah : 1}) } }); Now, I trigger this on the client with Meteor.call("bar"); Foo.insert

Cannot get Accounts-Base package to point to the correct database

北城余情 提交于 2019-12-23 04:38:08
问题 I have a Meteor app. that uses a database different form the default 'meteor' one: var database = new MongoInternals.RemoteCollectionDriver("mongodb://127.0.0.1:3001/my-db"); However, every time I register a new user, using the Accouts-Base package, it keeps adding the new user record to the Users collection in the 'meteor' database. Is there any way to use this package with an alternate database? P.s. I am in development environment if that makes any difference. 回答1: Looking directly at the

meteor callback heaven calling a callback after another callback

有些话、适合烂在心里 提交于 2019-12-23 04:33:08
问题 I have set up 3 functions where the need to run after each other I have set up my callback correctly and able to invoke functionTwo after functionOne like this... functionOne(functionTwo) // this is fine How do invoke functionThree after functionTwo? I tried functionOne(functionTwo(functionThree)) but this is wrong My code var functionOneAsync = function(callback) { request.post('http://www.goodreads.com/oauth/access_token', { oauth: {consumer_key: 'somekey', consumer_secret: 'somesecretkey',

Can node-inspector debug an app without pausing it?

被刻印的时光 ゝ 提交于 2019-12-23 04:31:45
问题 Node-inspector is a fantastic tool for debugging server-side code just as one would use the Chrome developer tools. I'm using it to debug a Meteor server, as in https://stackoverflow.com/a/19438774/586086. One thing that would be even better would be to be able to use the debugging console to inspect objects while the app is running, without pausing it , as allowed by the Chrome developer tools. Currently, if one tries to do this without pausing, the following type of error is displayed: It

Can node-inspector debug an app without pausing it?

喜夏-厌秋 提交于 2019-12-23 04:31:09
问题 Node-inspector is a fantastic tool for debugging server-side code just as one would use the Chrome developer tools. I'm using it to debug a Meteor server, as in https://stackoverflow.com/a/19438774/586086. One thing that would be even better would be to be able to use the debugging console to inspect objects while the app is running, without pausing it , as allowed by the Chrome developer tools. Currently, if one tries to do this without pausing, the following type of error is displayed: It

Boolean in nested schema causing required state

耗尽温柔 提交于 2019-12-23 04:26:34
问题 I have schemas set up so that I can have an array of complex input sets via autoform. Something like: address = { street:{ type: String }, city: { type: String }, active_address: { type: Boolean, optional: true }, ... } people: { name:{ type: String }, address:{ type: [address], optional: true, defaultValue: [] } } This way adding an address is optional, but if you add an address all of the address fields are required. Trying to submit the form throws a required error for every field under