The good folks at PBS Eons
added a new video on the origin of pterosaurs. The following repeats (with added images) my comments on the PBS Eons video on YouTube.
This video is SO WRONG
so many times. The origin of pterosaurs is not ‘foggy.’

Figure 1. Short-legged Gracilisuchus, along with sisters, long-legged bipedal Pseudhesperosuchus and Scleromochlus.
(Fig. 1) close to the origin of dinosaurs. Note the tiny hands on Scleromochlus. Note the lack of pedal digit 5 on Scleromochlus. By contrast, pterosaurs had large hands and a specialized pedal digit 5 that had two large phalanges that folded together such that the distal phalanx was dorsal side down, making an impression behind pedal digits 1–4 (Figs. 10, 11). More on this below.
False. Look at all the excellent pterosaur fossils we know of, some with soft tissue.
Peters 2000 introduced the clade Fenestrasauria for pterosaurs + their above named ancestors. These in turn were part of a new clade of lepidosaurs, named Tritosauria, nesting between Rhynchocephalians and Protosquamates published in Peters 2007.
dominated by digit 4. See: http://reptileevolution.com/pterosaur-wings.htm
for Reptilia (=Amniota, see cladogram link below). Not wise to bring up this invalidated clade name.
was attained four times by convergence (two from the genus Dorygnathus, two more from the genus Scaphognathus, Fig. 3). Transitional taxa were all tiny Solnhofen forms (Fig. 3). As in many other clades, phylogenetic miniaturization attended the genesis of derived pterosaurs.
Quetzalcoatlus (Fig. 4) grew so large because it was flightless. All azhdarchids over six-feet-tall had clipped wings (vestigial distal wing phalanges) good for flapping and walking on, not for flying.

Figure 4. Estimating giant azhdarchid weight from estimated height and comparables with similar smaller taxa.
All soft tissue shows the short chord wing membrane was stretched between the elbow and wing tip. See: http://reptileevolution.com/pterosaur-wings.htm

Figure 5. Tritosaur pectoral girdles demonstrating the evolution and migration of the sternal elements to produce a sternal complex.
when we have excellent samples of every stage? (see links below)
does not require flapping — and gliders do not evolve into flappers (e.g. colugos, squirrels, sugar gliders, etc.)
worked for bats, but they were seeking prey beneath their perches as fingers 3-5 then 2-5 elongated. Pterosaurs only elongated one digit: #4. It made a better wing than bug-in-the-leaf-litter trap.
is Lamarckian, growing bigger wings to catch insects just out of reach for most is not good science.

Figure 6. Cosesaurus forelimb with pro to-aktinofibrils trailing the ulna.
The valid hypothesis for bird and pterosaur wing evolution is competitive attractiveness during mate selection (think birds-of-paradise) with cosesaur-like creatures flapping and displaying. BTW, both Cosesaurus and Longisquama are preserved with membranes trailing finger 4, (Fig. 6) which folds in the plane of the wing in Longisquama (Fig. 7).
Sharovipteryx (Fig. 8) had membranes (uropatagia) trailing each hind limb. These are reduced in pterosaurs, which continue to use their hind limbs as horizontal stabilizers, their feet as twin rudders, as the flapping forelimbs, closer to the center of gravity, become ever larger, better for display, then for short flapping hops, then for flight.

Figure 8. Sharovipteryx reconstructed. Note the flattened torso.
The scapula of Scleromochlus (Fig. 1) was tiny. It only had to support a tiny forelimb with vestigial fingers.
because it, too was a biped. But that was nothing compared to the larger pelvis of Cosesaurus (Fig. 9), which also had a prepubis, a pterosaurian trait not found on Scleromochlus. The pelvis of Sharovipteryx was larger still.

Figure 9. Cosesaurus flapping. Tere should be some bounce in the tail and neck, but that would involve more effort and physics.
As in crocs and dinos, and most reptiles, the caudofemoral muscles were pulling the femur. Compare that with the attenuated tail of pterosaurs, Cosesaurus and Sharovipteryx. Only pelvic muscles were pulling the femur.
That’s what we also see in Cosesaurus, Sharovipteryx and Longisquama.

Figure 10. Cosesaurus and Rotodactylus, a perfect match. Elevate the proximal phalanges along with the metatarsus, bend back digit 5 and Cosesaurus (left) fits perfectly into Rotodactylus (right).
We have Rotodactylus ichnites (hand and footprints, Figs. 10, 11) that match Middle Triassic Cosesaurus in the Early Triassic. These include the impression of pedal digit 5 behind toes 1-4. Nothing else like them in the fossil record.
Scleromochlus was like the modern jerboa, with its tiny vestigial hands, totally inappropriate as a pterosaur ancestor.
Not all pterosaur tracks are quadrupedal. Only derived pterosaurs, those that frequented beaches were. We have bipedal pterosaur tracks (Fig. 12). See references below.

Figure 11. Cosesaurus foot in lateral view matches Rotodactylus tracks.
Note the backward pointing manual digit 3 in quad tracks. Note the fusion of four to thirteen sacrals into a sacrum and the elongation of the ilium to anchor large femoral muscles and anchor the increasingly larger sacrum in all pterosaurs. In order to flap, you have to be a biped.

Figure 12. Pteraichnus nipponensis, a pterosaur manus and pes trackway, matched to n23, ?Pterodactylus kochi (the holotype), a basal Germanodactylus.
those that underwent phylogenetic miniaturization during the Jurassic. At that time, the fly-size hatchlings of the hummingbird-sized adults (Fig. 13) could not leave the moist leaf litter or risk desiccation until growing to a sufficient size. So they walked around on all fours until attaining flight size.

Figure 2. A hypothetical hatchling No. 6 alongside a fly, a flea and the world’s smallest insect, a fairy fly (fairy wasp). The fairy wasp is shown enlarged here (scaled in red) and in figure 1.
The extinction of pterosaurs can be attributed to their great size at the end of the Cretaceous. They had no tiny representatives, like they did at the end of the Jurassic, to weather the rapid climate changes and/or seek shelter.
References
that some pterosaur experts don’t want to talk about:
Peters D 2002. A New Model for the Evolution of the Pterosaur Wing – with a twist. Historical Biology 15: 277-301.