Two schoolboys have faced the Children's Court in Mandurah over a disturbing alleged "vape attack" on a black swan.

The two teenagers faces are visible in the video, which has been widely shared across social media, and appeared to show the bird pinned to the floor.

The Perth private school students allegedly filmed themselves pinning the native black swan to the floor before one child held its beak and forced it to inhale smoke.