This is an excerpt from "Always/Never: The Quest for Nuclear Safety, Control, and Survivability," a documentary made by the Sandia National Laboratories in 2010, categorized as OFFICIAL USE ONLY, and never released to the public. The film was produced, directed, and edited by Dan Curry.
In this sequence, Sandia weapon designers discuss how a 4 megaton hydrogen bomb almost detonated in North Carolina on January 23, 1961, when a B-52 bomber broke apart midair, three days after the inauguration of President John F. Kennedy.
A single switch---the arm/safe switch in the cockpit--prevented a nuclear detonation that would have destroyed much of North Carolina and blanketed the east coast with lethal radioactive fallout. But as the Sandia engineers note in the film, that type of switch failed on numerous occasions and was subsequently replaced. What they don't say in the film is that stray electricity from loose wires in the airplane, as it broke apart, could also have fully armed the hydrogen bomb and detonated it.
The details of this nuclear weapon accident and of many others can be found in the book, Command and Control, by Eric Schlosser.