Issue #169: Media.seekTo() does not update Media._position value.

Calling Media.seekTo() now updates the Media._position value. I could not make seekTo() to work when your audio clip is not playing as that is not a supported action of the AndroidMedia player class.
This commit is contained in:
macdonst
2011-07-23 03:16:56 +08:00
parent 9f673db79f
commit 1c97467e39
2 changed files with 23 additions and 13 deletions
+4 -1
View File
@@ -63,6 +63,7 @@ var Media = function(src, successCallback, errorCallback, statusCallback, positi
// Media messages
Media.MEDIA_STATE = 1;
Media.MEDIA_DURATION = 2;
Media.MEDIA_POSITION = 3;
Media.MEDIA_ERROR = 9;
// Media states
@@ -187,7 +188,6 @@ PhoneGap.Media.getMediaObject = function(id) {
*/
PhoneGap.Media.onStatus = function(id, msg, value) {
var media = PhoneGap.mediaObjects[id];
// If state update
if (msg === Media.MEDIA_STATE) {
if (value === Media.MEDIA_STOPPED) {
@@ -207,5 +207,8 @@ PhoneGap.Media.onStatus = function(id, msg, value) {
media.errorCallback(value);
}
}
else if (msg == Media.MEDIA_POSITION) {
media._position = value;
}
};
}