Making a VideoBox video load when scrolled to

I’m trying to use onviewportenter to make it so my video automatically starts playing when someone scrolls down to it and stops playing when they scroll away. I can’t figure out how to do it properly.