added custom video function and saving of preferences