The end is funny, but the start is wrong. In 1581, Brazil was Portuguese, due to the Treaty of Tordesillas signed in 1494. It's why Brazil speaks Portuguese instead of Spanish like the rest of Latin America.
True, but the animation is correct: because of a messed up succession, all of Portugal belonged to the Spanish crown from 1580 to 1640 - Felipe II of Spain was Filipe I of Portugal (followed by III/II and IV/III).
In 1640 Portugal fought for independence, and got a new dynasty going. That's shown in the sequence, Brazil popping out is noticeable ...
http://en.wikipedia.org/wiki/Treaty_of_Tordesillas