Prev/Next/Autoplay/Pause support

Moved js to use a method and add for Prev/Next/Pause and autoplay behaviour