Processing 3’s IPCapture abilities are not a “function”. They come from a library! Specifically, the ipcapture library.
This library won’t “just work” when you switch to using P5.js. Thankfully, the source for that library is available, here:
So you could - in theory - not use the library, but make use of its source code to do the same thing (connect to a camera at an IP address). Of course you would have to find the JavaScript equivalent for a java Authenticator, but that’s a different story…
Or you could JFGI for “javascript how to connect to ip camera”.
This looks helpful: http://how-to.wikia.com/wiki/How_to_embed_IP_Camera_in_web_page_and_website
This looks promising: http://foscam.us/forum/a-how-to-embed-any-foscam-ip-camera-in-webpage-using-1-line-t9113.html