360 camera panorama

Hello, I need the ability to take a 360 panorama equirectangular image or 360 Photo Sphere (similar to google street view) directly in my application using a users native device. The plugin needs to give me the flexibility to configure the capture quality, and needs to be able to be saved as a png, jpeg, mp4, or gif. It would have to be able to understand the device orientation so it knows when the device is rotating.

Here is an example of the 360 photo/video captures using google street view:
Virtual Reality Basics - How to take 360 Photos with a Phone :iphone: DIY in 5 Ep. 21 - YouTube

OR a secondary work around is the ability to have a camera plugin that requires a user to take a set number of photos using their native camera in my app, while also reading the orientation/compass, and then when the set number of photos is captured they are all uploaded to DB at once?

If anyone knows how to accomplish, please assist.