ref #19. replace loadedmetadata to loadeddata