My question has two parts: (1) I believe it is a mitzvah to hear the entirety of Megillat Esther twice on Purim, both at maariv and also at some point during the daytime. Is that correct? (2) would listening to Megillat Esther chanted on YouTube fulfill the mitzvah?
As far as when: Rambam, Laws of Megillah and Chanukah, 1:3.
ומצוה לקרותה בלילה, וביום; וכל הלילה כשר לקריאת הלילה, וכל היום כשר לקריאת היום
There is a mitzva to read it at both the night and the day. The entire night is appropriate for the night reading, and the entire day for the day reading.
It's normally read in the evening after a Maariv service; but the mitzva is simply to read it once "at night" (i.e. from when it gets nicely dark out until dawn, but preferably before midnight). And once "during the day", preferably between sunrise and sunset, but allowably from dawn (~ an hour before sunrise).
As for listening on YouTube: better than nothing, but probably not a fulfillment of the real mitzva. The Chayei Adam writes that if you can't make it to a real megillah reading, it's still better than nothing to read it yourself -- out loud, i.e. moving your mouth and engaging your vocal cords -- out of a printed book.
By the way, generally speaking: you get the mitzva just with the words, the tune isn't necessary.
So if you had to choose between reading it yourself out of a printed book and listening to an online recording, I'd think of the former as preferable -- but hey, you can do both. All of this is better than nothing, but it's unlikely to completely fulfill the obligation.
There are responsa debating whether one accomplishes the mitzva hearing a live reading over a microphone or the radio, and a "canned" reading such as one heard on YouTube is even further removed.
(Rabbi Ovadiah Yosef zt'l quotes his elder, the responsa Bar Livai, who disqualified a Megillah reading over the radio because doing a mitzva in a newfangled electronic way cannot be called lishmah)
The answer to your first question is yes, one must hear the megillah (read live) both in the evening (after ma'ariv0 and during the day (usually after shacharis - but any time). A number of people point out that it should be done before fulfilling the other mitzvos of the day.
These gifts should be given by day. It is proper to give the gifts to the poor after the Reading-of-the-Megillah.
These gifts should be given in the daytime, after the Megillah is read.
The answer to your second question is that one must hear it read "live" In fact there is even a question if a sound system within the synagogue is valid or not.
Use of an Amplification System for Reading the Megillah and Hearing the Megillah which go into this issue.
@DanF pointed out
Regarding sound systems, this even lead to a discussion of whether one can use hearing aids and cochlear implants. I believe this was researched and discussed in a pamphlet by Rabbi Shukotowich of Baltimore who researched how the technology works. He ruled that these devices are OK to fulfill the mitzvah b/c of their "instantaneous" sound delivery.