added loadedmetadata event and attr for setting autoplay