Define debug
Update before duration check
Add media isLoaded