Video Player and Audio Player: Make the controls robust while media is not attached
commitc0e80b2e6f7a32df03446c86c4e45d78bf1ce668
authoryoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 24 Jul 2014 13:55:32 +0000 (24 13:55 +0000)
committeryoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 24 Jul 2014 13:55:32 +0000 (24 13:55 +0000)
treee54a4d3a6d050d35044c836c8824672802f7265b
parent4305aac1c80309738bb7bd21d34cf88d10dc2a65
Video Player and Audio Player: Make the controls robust  while media is not attached

Media controls, which is used by the video player and the audio player, is asynchronously, attached a media to so we need to consider the time while the media is not attached yet. This patch adds following changes for such a time.

Major changes:
- Adds checks of attached media in operations. If no media is attached, just skip it rather than exception.
- Disables the controls at first. User can easily know that no media is attached yet.

BUG=none
TEST=Video player and audio player work

Review URL: https://codereview.chromium.org/412103002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285238 0039d316-1c4b-4281-b951-d872f2087c98
ui/file_manager/file_manager/foreground/js/media/media_controls.js