Mr Obama dropped in on talks between Mr Miliband and US National Security Adviser Susan Green for about 25 minutes yesterday.
Their exchanges are said to have touched on a range of international issues and were described by one who was in the room as "very warm and friendly".
Last month, Mr Obama intervened in the campaign by saying the interest of America in the Scottish independence issue was to ensure it retained a "strong, robust, united and effective partner".
However, he said the decision on whether to stay part of the UK was for the people of Scotland.
A spokesman for Mr Miliband said: "The leader of the Opposition and the President discussed a range of issues, including the situation in Ukraine, Gaza, and the future of the European Union. They also discussed the economy, climate change and the approaching referendum in Scotland."
Meanwhile, Scottish violinist Nicola Benedetti has admitted to be being "trolled ... all the time" on social media to reveal her views on independence.
The 26-year-old made it clear she would not be drawn about Scotland staying in or leaving the UK.
She said: "I get trolled about it all the time. It barely makes its way to me any more because they have learned they are not going to make me say anything."
Last month JK Rowling said she had been subjected to online abuse by so-called "Cybernats" after donating £1 million to the No campaign.
Ms Benedetti said: "People have to respect your right to a private opinion. It was so emotional over JK Rowling. It's quite frightening.
"If I lived in Scotland, I might feel a greater obligation to speak up. Maybe."