Added functions to work better with other plugins like videojs-playLists
Avoding errors because of undefined objects