Optimized ajax calls, indentations, removed stop video function and using input action instead