Director Adam McKay — who is best known for helming many memorable Will Ferrell comedies like the “Anchorman” movies, “Talladega Nights,” and “Step Brothers” — is proving he also has skills to make an engaging drama. His latest movie, “The Big Short,” is building impressive notice from critics in its early screenings (the film opens in limited release December 11 and wide on December 23).

Based on the best-selling nonfiction book by Michael Lewis that looks inside the housing-bubble collapse, the unconventional, documentary-like movie grabbed the attention of A-list talent including Steve Carell, Ryan Gosling, Christian Bale, and Brad Pitt, who play the few people in the finance world who saw the crash coming.

But one of the film’s biggest coups was featuring Led Zeppelin’s classic track “When the Levee Breaks” in the debut trailer and in the movie’s end credits.

Led Zeppelin. Warner Bros. Zeppelin has been known for decades as one of the hardest bands to get to approve its music for use in movies (“Almost Famous,” “School of Rock,” and “The Fighter” are some notable projects that pulled it off). McKay confirmed to Business Insider that it was a challenge signing the group on to "The Big Short."

In fact, the filmmakers almost had to postpone the premiere of the trailer because, up to the 11th hour, they didn’t know if they could legally include the song.

“We cut the trailer and put in the Zeppelin song, and it’s not only one of the greatest songs of all time, but it drives you through the trailer,” McKay said. “But then we were told we might not be able to get the rights.”

McKay explained that the producers and music supervisor on the film had covered the globe trying to get approvals. Reaching out to everyone from the publishing company that owns Zeppelin’s music, to surviving band members Robert Plant and John Paul Jones. Even getting the blessing of the family of the band’s deceased drummer, John Bonham. Everyone said yes, but no one could find lead guitarist Jimmy Page.

“I’m like, ‘What do you mean you can’t find Jimmy Page?’ And I was told he has a new girlfriend and I guess they were off having a good time,” McKay said.

Fast-forward to the night before the trailer premiere, and they still couldn’t find Page. McKay said by that point he and his team were trying to figure out another song to replace “When the Levee Breaks.” They even considered postponing the launch of the trailer, but were scared rumors would start around Hollywood that the film was in trouble. While in England, a team of people was on the search for Page.

“We finally heard that he was in some pub out in the English countryside,” McKay said. “So an assistant drove two hours to get to the pub, breaking every speed limit, goes into the pub and puts a computer in front of Jimmy Page so he can look at the trailer and say either yes we can use the song or no. Then at like 1:55 a.m. or something I got the email that he said yes.”

Adam McKay. Michael Bowles/Getty But the story doesn’t end there. McKay also wanted to use the song in the film’s end credits, and when Page was told that, he had one condition.

“He said we can’t edit the song,” McKay said. “He told us he didn’t like how they cut up his songs in movies.”

So McKay was now stuck trying to figure out how to make the uncut song — which has a 1:24 instrumental before Plant begins to sing — work in the credits.

What McKay and his editor, Hank Corwin, came up with was to begin the song very faintly among sounds of New York City traffic during the text cards at the end of the movie, which inform the audience what has happened to the characters. Then when the credits follow, Plant begins to sing.

“That was the crazy thing,” McKay said. “That was a pure accident. It just happened to lay out perfectly when the credits begin.”

Watch “The Big Short” trailer: